Rate of change and tangent to a graph
Author: Andreas Bauer

Experiment with the slider to vary the horizontal distance of P and Q. Check "show secant and tangent" to compare the secant through P and Q with the tangent in P. What happens if h tends to zero?

Show secant and tangent

f(x) = 1.0 / 4.0 * (x + 0.05785237656264952)^(2.0)
P = Point(f)
h = 1 (slider from 0 to 1, step 0.01)
Q: (x(P) + h, f(x(P) + h))
b = OrthogonalLine(P, yAxis)
c = OrthogonalLine(Q, b)
C = Intersect(c, b)
d = Segment(P, C)
e = Segment(C, Q)
Text2: "Δf = " + (y(Q) - y(P))
Text3: "m_{P,Q} = \frac{f(x_2) - f(x_1)}{x_2 - x_1} = \frac{" + (y(Q)) + " - " + (y(P)) + "}{" + h + "} = " + ((y(Q) - y(P)) / h)
Text1: "Δx = " + h
a = Tangent(P, f)
g = false
i = Line(P, Q)