Roscovitine derivatives are potent inhibitors of cyclin-dependent kinase 5 (CDK5), but they exhibit different activities, which has not been understood clearly up to now. On the other hand, the task of drug design is difficult because of the fuzzy binding mechanism. In this context, the methods of molecular docking, molecular dynamics (MD) simulation, and binding free energy analysis are applied to investigate and reveal the detailed binding mechanism of four roscovitine derivatives with CDK5. The electrostatic and van der Waals interactions of the four inhibitors with CDK5 are analyzed and discussed. The calculated binding free energies in terms of MM-PBSA method are consistent with experimental ranking of inhibitor effectiveness for the four inhibitors. The hydrogen bonds of the inhibitors with Cys83 and Lys33 can stabilize the inhibitors in binding sites. The van der Waals interactions, especially the pivotal contacts with Ile10 and Leu133 have larger contributions to the binding free energy and play critical roles in distinguishing the variant bioactivity of four inhibitors. In terms of binding mechanism of the four inhibitors with CDK5 and energy contribution of fragments of each inhibitor, two new CDK5 inhibitors are designed and have stronger inhibitory potency.