How do Piecewise Functions work?
A piecewise function is a function that is defined in "pieces". That is, it has a different definition for different intervals of the input variable. In this example, we are plotting the altitude of a model rocket for times from [math]t=0[/math] (launch) to [math]t=49.5[/math] (touchdown). During this time, the rocket experiences three distinct modes of flight:[br][br](1) For the first two seconds, the engine accelerates the rocket upward ever faster.[br](2) Between 2 and 12 seconds, the rocket coasts upward, slowed by gravity, and eventually begins to fall.[br](3) After 12 seconds, the parachute opens and the rocket drifts smoothly back to earth.[br][br]Each of these three "pieces" (called [i]subintervals[/i]) of the rocket's travel has a different function that calculates the altitude. In order to determine the altitude at any time [i]t[/i], we have to determine which of the three parts of flight the rocket is in at that time. So we find the interval containing our value of [math]t[/math] in the list, then we plug [math]t[/math] into the function that is on the same line in the list as the interval.[br][br]You can run the simulation automatically, but you should also try manually setting the [math]t[/math] slider to various values of [math]t[/math], to see how the piecewise function works. Whichever interval contains the selected value of [math]t[/math] is highlighted with a pointer. The function next to the pointer is the one that uses [math]t[/math] to calculate the altitude at that time.