Now, using the chain rule, we see that
Also, we see that which shows that
An alternate way to see this calculation uses that fact that . Now, we can calculate
This last step is due to the fundamental theorem of calculus for one variable integration (ie. .) We see immediately that this expression is really the kinetic energy at Q minus the kinetic energy at P.
which is easily seen to be the potential energy at P minus the potential energy at Q.
which is the expression for the Law of Conservation of Energy.