SimuVeda/ Mathematics

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.

Class 11–12Class 11 Maths: Limits and Derivatives; Class 12 Maths: Application of Derivatives

Experiments 0 of 0 Challenge not tried

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”.

Related simulators

Worked example

Slope of f(x) = x³ at x = 2 from first principles. The exact answer from the power rule is f′(x) = 3x², so f′(2) = 12.

h = 0.1: (2.1³ − 2³) / 0.1 = (9.261 − 8) / 0.1 = 12.61.

h = 0.01: (2.01³ − 8) / 0.01 = (8.120601 − 8) / 0.01 ≈ 12.06.

The error falls from 0.61 to 0.06: ten times smaller h, about ten times smaller error, as expected for a forward difference.

Chain rule: for sin(x²), the derivative is cos(x²) × 2x, so at x = 1 the slope is 2 cos 1 ≈ 1.08. In the lab, put x = 1 on x² and shrink h from 1 to 0.01 to see the same pattern.

Common questions

What is a derivative?

The instantaneous rate of change of a function: the slope of its tangent line at a point. It is the limit of the secant slope [f(x + h) − f(x)] / h as h shrinks to zero.

What is the difference between a secant and a tangent?

A secant joins two points on the curve and gives an average slope. A tangent touches the curve at one point and gives the exact slope there; it is what the secant becomes as the points merge.

Where is the derivative zero?

At peaks, valleys and flat points of the curve, where the tangent is horizontal. That is why setting f′(x) = 0 finds maximum and minimum values.

Keyboard shortcuts

Space
Play or pause
S
Step
R
Reset
F
Full screen
?
Show this list