### Details of the Calculation At the point x in the picture the potential energy lost is mgy so the kinetic energy at that point is given by: Solving for v gives: (We have written y(x) and v(x) instead of just y and v to emphasize the fact that the elevation drop and hence the velocity both depend on the horizontal coordinate x.) This is our basic formula and we must now manipulate it until we can solve it.

First, the velocity v is measured along the curve so we must rewrite it in terms of its horizontal and vertical components. To do this let:
• s represent the accumulated distance along the curve,
• ds represent a small incremental distance along the curve, and
• dx and dy represent the horizontal and vertical components of ds
Then:
• ds/dt represents the velocity along the curve,
• dx/dt represents the x component of the velocity,
• dx and dy are given by Pythagoras' theorem, and
• the chain rule gives: Substituting this into our basic formula gives: At this point the curve y(x) for the roller coaster track must be specified. Then it and its derivative y'(x) can be substituted into this formula and this is seen to be a differential equation whose solution is some function x(t). For example if the curve is actually a ramp or straight line with slope k, that is if y(x)=kx, then this equation becomes: The differential equation can be solved by separation of variables, ie. by moving everything involving the variable x to the right-hand-side and everything involving the variable t to the left-hand-side, like this: An integration gives the final solution: For example in the case that the curve is the straight-line ramp, y(x)=kx, this equation becomes: Solving for x gives: This is the well known result for a mass undergoing constant acceleration down a ramp.