Analytical solution of derivative of dynamical matrix