Here's the math behind it because it's always fun to make some formulas in LaTex.
We look at the effective potential energy V(R) for the nuclei of a molecule with N atoms in the Born-Oppenheimer picture  which is a function of the nuclear positions R=(x1, y2, ..., zN)T. This function is expanded into a Taylor-Series up to second order which you can write like this (where a suitable origin 0 is chosen):
The second term, the Hessian matrix
That was actually just kind of a warm up as we are interested in the energy gradient which we can expand to first order in the following way:
With normal mode analysis we can describe the motions at a local minimum. At a local minimum the gradient is 0 and all the eigenvalues of the Hessian are greater or equal to zero. The first condition gives:
Now we have a convenient description of the gradient that we can plug into Newton's second axiom. We get a differential equation system with an equation for every coordinate. This can of course be represented by a matrix equation. First it is convenient to introduce a diagonal matrix M that contains the masses (each of them 3 times because there are x,y, and z coordinates for every atom):
Then the equation system looks like this:
 That means electronic kinetic energy and all potential energy terms.