GraphingCalculator 3.5;
Window 76 16 838 840;
PaneDivider 414;
Slider -4 4;
SliderSteps 99;
SliderControlValue 0;
SliderVariable h;
2D.BottomLeft -1.203125 -3.609375;
Expr y=sin([x]);
Text "The purple graph is the function whose derivative we seek.";
Color 3;
Expr a=1;
Text "*a* is the x value where we will approximate the tangent line.
If *h* is the displacement from *a* where the secant line will be drawn, then";
Color 6;
Expr m=(sin([a+h])-sin([a]))/h;
Text "where *m* is the slope of the secant line between the two points:";
Color 4;
Expr vector(a,sin([a]));
Text "and";
Color 4;
Expr vector(a+h,sin([a+h]));
Text "The secant line between the above two points is the red graph which goes through (*a*, sin(*a*)) with slope *m*:";
Color 2;
Expr y=sin([a])+m*[x-a];
Text "
*m* approximates the derivative of the purple function at *x*=*a* when *h* is small. ";
Color 17;
Expr m;
Text "
(For some settings of the range of the parameter *h*, *h* will take the value *h*=0. The computer cannot compute 0/0 and gives some spurious value for *m*. It then plots some 'funny' line instead of the tangent line. The settings choosen here avoid that issue. If you wish to illustrate that issue, change the value of *a* to 2, then click on the symbol *h* in the slider at the bottom of the graph and change the number of steps to 40. At *a*=1, the 'funny' line turns out to be close to the tangent.)
";