Roller Coaster Project From Stewart's Calculus
Author: John Maharry

Applied Project from Page 182 in Stewart's Calculus Book.

Suppose you are asked to design the first ascent of a roller coaster. You decide that the slope of the ascent should be 0.8 and the slope of the drop should be -1.6. You decide to connect these two straight stretches y =L1(x) and y=L2(x) by a parabola y=f(x)=ax²+bx+c where x and f(x) are measured in feet. 

For the track to be smooth, there can't be abrupt changes in direction, so you want the linear segments to be tangent to the parabolaat the transition points P and Q. To simplify the equations, suppose P is at the origin.

1. Suppose the x-coordinate of Q is 100 feet.
2. Move the sliders to change a,b,c, and the y-coordinate of Q to make the track smooth.
3. Write equations for a,b,and c that will ensure the track is smooth.
4. Solve the equations to find a,b,and c.

Second Part:

The above solution might look smooth, but it might not feel smooth because the piecewise defined function doesn't have a continuous second derivative. (The rate at which the first derivative (or slope) is changing isn't defined. The slope "jumps" at that point.)

So to improve the design you decide to use a quadratic function 
q(x)= ax²+bx+c for values 10 < x < 90

and cubic functions as follows

h(x) = Kx³+Lx²+Mx+N  for values 0 < x < 10
and 
g(x) = Ex³+Fx²+Gx+H for values 90 < x < 100

1) Write a system of equation in 11 variables to ensure that the functions and their first and second derivatives agree at all the transition points.
2) Use a linear systems sovler to determine the values of the variables 
(you can find one online at http://mac6.ma.psu.edu/lin_equations/index.html )
3. Plot them and check out your roller coaster....

Parabola f(x)=(a/100)x²+bx+c

'a' is divided by 100, because the slider can't get that precise.

Q = -31 (slider from -60 to 0, step 1)
P = Intersect(xAxis, yAxis)
A = (-2, -1.6)
Q_1: (100.0, Q)
B: (x(Q_1) + 1.0, y(Q_1) - 1.6)
L1 = Ray(P, A)
L2 = Ray(Q_1, B)
a = -1.6 (slider from -4 to 2, step 0.1)
b = 1.8 (slider from -5 to 5, step 0.1)
c = -3.4 (slider from -5 to 5, step 0.1)
f(x) = a / 100.0 * x^(2.0) + b * x + c