Math
The derivative under a microscope
Zoom in on a smooth curve with the vertical scale locked to the horizontal one and it straightens: that is what a derivative is, and the secant through two points walks onto the tangent as they close. Then the same lens on a corner, a cusp and a curve whose difference quotient settles on nothing - three different failures, drawn as two tangents, a vertical one and none. And the part nobody is told: in floating point a smaller step stops helping near 1e-8 and then makes the answer worse, because subtracting two nearly equal numbers throws away the digits that carried the answer.

What happens
Magnify a smooth graph enough and it stops looking curved - that is what the derivative says, and this module is the microscope. Zoom in on a point and the graph straightens into its tangent; halve the window and the remaining bend falls by four. Zoom in on a kink and it never straightens: |x| keeps two slopes, x^(2/3) a vertical one, a wiggle stays wiggly at every scale. Then compute the slope numerically and meet the other limit - shrink h too far and rounding error takes over, so there is a best h and it is not zero. Try the functions, zoom, and read where the difference quotient stops improving.
Equations used in the module
Equations f'(x) = lim (f(x+h) − f(x))/h local linearity: max |f(x+s) − f(x) − f'(x)s| ≤ w²|f''|/2 on |s| ≤ w forward difference: error ~ h|f''|/2 + 2ε|f|/h central difference: error ~ h²|f'''|/6 + ε|f|/h, ε = 2.2e−16


