The Src-homology-3 (SH3) domain of the Caenorhabditis elegans protein Sem-5 binds proline-rich sequences. It is reported that the SH3 domains broadly accept amide N-substituted residues instead of only recognizing prolines on the basis of side chain shape or rigidity. We have studied the interactions between Sem-5 and its ligands using molecular dynamics (MD), free energy calculations, and sequence analysis. Relative binding free energies, estimated by a method called MM/PBSA, between different substitutions at sites -1, 0, and +2 of the peptide are consistent with the experimental data. A new method to calculate atomic partial charges, AM1-BCC method, is also used in the binding free energy calculations for different N-substitutions at site -1. The results are very similar to those obtained from widely used RESP charges in the AMBER force field. AM1-BCC charges can be calculated more rapidly for any organic molecule than can the RESP charges. Therefore, their use can enable a broader and more efficient application of the MM/PBSA method in drug design. Examination of each component of the free energy leads to the construction of van der Waals interaction energy profiles for each ligand as well as for wild-type and mutant Sem-5 proteins. The profiles and free energy calculations indicate that the van der Waals interactions between the ligands and the receptor determine whether an N- or a Calpha-substituted residue is favored at each site. A VC value (defined as a product of the conservation percentage of each residue and its van der Waals interaction energy with the ligand) is used to identify several residues on the receptor that are critical for specificity and binding affinity. This VC value may have a potential use in identifying crucial residues for any ligand-protein or protein-protein system. Mutations at two of those crucial residues, N190 and N206, are examined. One mutation, N190I, is predicted to reduce the selectivity of the N-substituted residue at site -1 of the ligand and is shown to bind similarly with N- and Calpha-substituted residues at that site.