Von der Sekante zur Tangente

f = If(x > -1, 5 x^(2), 5 x^(2) + 10)
xp = 3 (slider from -10 to 10, step 0.1)
h = 3 (slider from -10 to 10, step 0.1)
T2: "Stelle xp= " + xp
m: (f(xp + h) - f(xp)) / h
T3: "Steigung m= " + m
Q: (xp + h, f(xp + h))
P: (xp, f(xp))
s(x) = m * (x - xp) + f(xp)
R: (xp + h, f(xp))
poly1, q, p, r = Polygon(P, R, Q)
T4: "Differenzenquotient  
( f(" + xp + "+" + h + ") - f(" + xp + ") ) / " + h + "
= ( " + (f(xp + h)) + " - " + (f(xp)) + " ) / " + h + "
= " + m