Mathematics 161                                  Laboratory 4                             September 24, 1992
	  
Name: _____________________________   Lab Partner: ___________________________
	  
Consulted with:  ____________________________________________________________

© Lafayette College, 1994

Secant Lines & Difference Quotients

The derivative is one of the most powerful mathematical tools ever discovered.  Today we investigate its mathematical origin: the limit of the slope of secant lines.

Part 0: A Dry Run

Preliminaries

Mathematica has the capability of animating a sequence of graphs (flashing them on the screen in rapid sucession so that the graph appears to move).  To create the sequences of graphs needed in this lab, your intrepid instructor has created a special command that is contained in a “Mathematica package.”  To “teach” Mathematica the command, we input the package as follows:

<<i:\course\root\math161\derivative.m

For an example of the procedure we are using, define the “squaring” function

s[x_] := x^2

DON’T FORGET THE UNDERLINE! We wish to find the slopes of secant lines that intersect the graph of y = s(x) at (1/2, 1/4) and another point.  In particular, we wish to find the limit of the slopes of the secant lines as the second point of intersection approaches the first.

Tables Revisited

To find the limit of the slopes of the secant lines in this example, we will use the “difference quotient” for the squaring function, defined as follows

m[h_] := ((1/2 + h)^2 - (1/2)^2)/h

Now, just like last week, we can create a table of values for the slopes of secant lines using the commands

T = Table[{1/2^n, m[1/2^n]}, {n,1,10}]

N[T]

From the table the limit should be apparent.  What is it?

Sequences of Plots

The special command introduced in this lab is SecantAni.  To apply it to the problem at hand we enter the command:

SecantAni[s, 1/2, {x, 0, 1}, {y, -1, 1}]

This command generates a sequence of plots of the graph of s(x), each with a secant line intersecting the graph at the point where x = 1/2.  The second intersection point approaches the first as the plots progress.  The two lists in braces specify the domain and range for the plots (it is important for them to remain constant so that the animation will be smooth).

Finding Coordinates from Plots

In order to estimate the slope of a line we need the coordinates of two points on the line.  Working with the secant line of the LAST plot, to find its slope we know one point on the line: (1/2, 1/4).  To find the coordinates of a second point, we can use Mathematica.  Select the plot (so that it has a box around it), and put the cursor inside of it.  If we hold down the Control key on the keyboard (it may be labeled “Ctrl”), the cursor symbol becomes crosshairs.  (If this doesn’t happen, try deselecting the plot and then selecting it again.)  When you move the cursor, the cordinates of the points you pass through now appear in the box at the lower left of the window.  Place the crosshairs over a point on the secant line, and read off the coordinates.  Computing the difference quotient is now arithmetic.  For example, on my office machine, the point (1, 0.772) falls on this line (as near as I can tell). Using Mathematica to compute the difference quotient, we find

(0.772 - 0.25)/(1 - 0.5)

Notice that this is in agreement with the table of values we created above.

Animating Graphics

The plots can be animated by the following procedure:

1) When the SecantAni command is completed, at the bottom of the window there is a graph contained in two brackets (they are blue and at the extreme right of the window).  Move the mouse until the cursor points at the outer bracket:  the cursor symbol becomes a horizontal arrow pointing at a vertical line; the cursor is pointing at a bracket when the vertical line is over the bracket.  When the cursor is positioned, click the left mouse button; this will highlight the bracket.

2) Choose the “Animate Selected Graphics” command from the “Graph” menu.  The animation will begin; the sequence of plots will appear in rapid sucession at the position of the first full plot at the TOP OF THE WINDOW.

3) A line of “buttons” for controlling the animation with the mouse appear at the bottom of the window.  Make sure the animation is moving forward (the button with a rightward pointing arrow is highlighted), and you may adjust the speed of the animation with the “Up” (faster) and “Down” (slower) buttons.  The button with two rectangles in it can be used to pause/resume the animation.  When you are done with the animation, click the mouse somewhere in the window to stop it.

Part 1:  Secant Lines for a Rational Function

Define the function f[x_] := (3 - x)/(2 x).  We wish to find the limit of the slopes of secant lines intersecting the graph of f(x) at (1/2, 5/2), as the second point of intersection approaches the first.

(a) Modify the definition of the function m(h) from Part 0 so that it will compute difference quotients for secant lines of the graph of f(x) with one point of intersection fixed at (1/2, 5/2).  Write the command you use here:

Use the Table command to generate a list of increments h, and the corresponding difference quotients as we did in Part 0.  Based on your table, what is the limit of the difference quotient as h approaches zero? (If you need more information, make the table larger.)

(b) Now, enter the command below to generate a relevant sequence of plots for this example.  On the last plot, estimate the slope of the secant line.  What is the slope?   Write a brief explanation of how you found the slope, and explain whether your answer supports your guess of the limit of the slopes.  (It may help to know that h = 1/5 in this plot.)

SecantAni[f, 1/2, {x, 1/4, 2}, {y, -3, 3}]

Part 2: Comparing Animations

Animate the output of the SecantAni command you used in Part 1.  We wish to compare the limiting behavior of these secant lines with those of a function we investigated last week:  g(x) = x cos(1/x).  In Lab 3 we discovered that this function had a limit of 0 as x approached 0.  If we use this limit to define the function value g(0) = 0, we have removed the “removeable discontinuity.”  In Mathematica, the definition is:

g[x_] := x Cos[1/x] /; x != 0;
g[0] := 0

The “/;” is Mathematica shorthand for “under the condition that;” “!=” is the Mathematica symbol for “not equal to.”

After entering this definition, create a SecantAni command that will generate secant lines to graph of g(x) based at (0,0).  Try to put the origin at the center of the plots.  Write the comand you use here.

Animate the sequence of plots you have generated.  Compare the animation with that of Part 0, and above.  Write a short essay explaining what is different in the last case, and what it suggests about the limit of the slopes of the secant lines.  If a table of values will help you, or support your assertion, you should create one.