SimuVeda

Mathematics · Simulator 041

Derivative Explorer

Pick a function and drag a point along its curve. A secant line joins it to a second point h away. Shrink h and the secant turns into the tangent: its slope becomes the derivative. Watch the derivative graph build up underneath.

How the model works

The slope of the secant through (x, f(x)) and (x + h, f(x + h)) is the difference quotient

[f(x + h) − f(x)] / h

As h → 0 this approaches the derivative f′(x), the slope of the tangent line and the instantaneous rate of change. The simulator shows both, with the exact derivative from the standard rules (power, chain, trigonometric and exponential derivatives).

The lower graph plots f′(x). Where f has a peak or valley, f′ crosses zero. Where f is steepest, f′ is extreme. The secant error shrinks roughly in proportion to h, which you can check in the readout.

Very small h (below about 10⁻⁸) gives rounding error in floating-point arithmetic, so the minimum h is limited.

Guided experiments

  1. x² at x = 1. Shrink h from 1 to 0.01. Prediction: secant slopes 3, 2.5, 2.1, 2.01 approach the derivative 2x = 2. The error equals h exactly for this function.
  2. sin x at its peak. x = π/2. Prediction: the tangent is horizontal, so f′ = cos(π/2) = 0. The derivative graph is cos x.
  3. A corner. f(x) = |x| at x = 0. Prediction: from the right the secant slope is +1, from the left −1. No single tangent exists, so the derivative is undefined at the corner.

Challenge

For f(x) = x³, at which x values is the tangent line parallel to y = 3x?

Reveal the explanation

Need f′(x) = 3x² = 3, so x = ±1. Drag the point to x = 1 and x = −1 and check that the slope reads 3.

References

  • OpenStax, Calculus Volume 1, §3.1 “Defining the Derivative”.