Sensitivity analysis in molecular dynamics and inverse scattering