First, let's define our curve:
Our point of tangency:
So, for a given Δx, the slope of the secant line is:
This works great until , at which time bad things happen... So, a way to avoid this is to use the following trick:
Thus, the equation of the secant line is:
This gets the basic idea across, but it jumps around a lot. The way to fix this is to use the PlotRange option:
Let's spice it up a little more with different colors:
Another cool trick is to plot all of these together on the same axes: