foundation20 min studyLesson 8 in Mathematics

Derivatives and local change: the best nearby straight line

Build the derivative from a difference quotient and interpret its sign, units, and local approximation.

On this page

What you’ll understand

  • Derive the derivative of a quadratic using a limit.
  • Interpret derivative units and distinguish slope from function height.
  • Use a tangent approximation and identify where it can fail.

Average speed compares two positions over a nonzero interval. Instantaneous velocity asks how position changes locally at one time. Rather than dividing by an interval of zero, calculus studies what average rates approach as the interval shrinks. The same idea measures the sensitivity of a prediction to an input or a loss to a model parameter. A derivative is local information, so knowing it at one point does not describe an entire journey.

Start with a change you can actually divide

For a nonzero input step hh, subtract the initial output from the final output and divide by the input change. This difference quotient is the slope of a secant line through two graph points. The derivative is its limit as hh tends to zero, if a finite common limit exists from allowed directions. A small step estimates the derivative; the limiting process defines it.

The units follow directly from this construction. A position in meters differentiated with respect to time in seconds gives meters per second. Differentiating velocity again gives acceleration in meters per second squared. A negative derivative means the output decreases when the input increases locally; it does not mean the output itself is negative. A vehicle can have positive position and negative velocity simultaneously.

f′(a)=lim⁡h→0f(a+h)−f(a)hf'(a)=\lim_{h\to0}\frac{f(a+h)-f(a)}{h}
h is nonzero inside the quotient. The derivative exists when the limiting slope exists as a finite value; at a boundary one may instead discuss a one-sided derivative.↔ Scroll wide equations horizontally.

Derive a rule instead of memorizing it

For f(x)=x2f(x)=x^2, expand (a+h)2(a+h)^2 before simplifying. Subtracting a2a^2 leaves 2ah+h22ah+h^2, and division by nonzero hh gives 2a+h2a+h. The final limit is 2a2a. This example exposes the role of algebra: it removes the apparently problematic denominator while preserving the quotient for every nearby nonzero step, just as with a removable hole.

The tangent slope therefore varies with the input even though the function has one fixed formula. At zero it is zero; at positive inputs it is positive; at negative inputs it is negative. A horizontal tangent is not the same as a constant function. The quadratic changes on either side of zero even though its first-order change vanishes exactly at that point.

(a+h)2−a2h=2a+h(h≠0),ddxx2=2x\frac{(a+h)^2-a^2}{h}=2a+h\quad(h\neq0),\qquad \frac{d}{dx}x^2=2x
Expansion and cancellation give the exact finite-step quotient. Taking the limit h → 0 yields the derivative of the quadratic at any real input.↔ Scroll wide equations horizontally.

A tangent is a local prediction

A differentiable function is approximated near aa by its value there plus slope times input change. The approximation error, divided by the size of that change, tends to zero. For f(x)=x2f(x)=x^2, the omitted term is exactly the square of the step. This gives a concrete reason to prefer smaller steps when using the tangent for prediction, provided numerical measurement error does not dominate.

Not every continuous function has a derivative. The absolute-value graph has a corner at zero: slopes approach minus one from the left and plus one from the right. A single tangent slope cannot represent both. In machine learning, derivatives guide optimization where the model is differentiable; nonsmooth points require additional conventions or tools. A derivative also describes sensitivity, not a causal effect unless the model supports that interpretation.

f(a+h)≈f(a)+f′(a)h,(a+h)2=a2+2ah+h2f(a+h)\approx f(a)+f'(a)h,\qquad (a+h)^2=a^2+2ah+h^2
The first relation is a local linear approximation for a differentiable function. The second is exact and identifies h² as the approximation error for x².↔ Scroll wide equations horizontally.

Predict a nearby square

Use the derivative of f(x) = x² at x = 3 to approximate f(3.1), then compare with the exact value.

  1. At x = 3 the function value is 9 and its derivative is 2 × 3 = 6. The input step to 3.1 is 0.1.

  2. The tangent predicts output change 6 × 0.1 = 0.6, giving an approximate new value of 9.6.

  3. Compute the exact square: 3.1² = 9.61. The difference is 0.01, equal to the omitted step-squared term 0.1².

The result

The local approximation is 9.6, with exact error +0.01 in the true output. It is accurate nearby, not exact.

Explore the model

Interactive lab

Interactive lab · function

Compare a quadratic with its tangent

Choose coefficient a and position x for y=ax2y=ax^2. The lab displays the tangent slope 2ax2ax at the selected point. Pause at negative, zero, and positive x and compare slope with height. The derivative is computed analytically; this is not a finite-difference error simulator.

Compare a quadratic with its tangentThis lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Current readings: y at chosen x: 0.608; Tangent slope · 2ax: 1.35; Signed area · ax³/3: 0.182. All parameters are adjustable with the labeled controls below.−2.4−1.201.22.4−9−4.504.59xy(x, ax²)
y = ax²TangentSigned integral
y at chosen x
0.608
Tangent slope · 2ax
1.35
Signed area · ax³/3
0.182
t = 0 s

This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forTangent slope measures local change, which can be zero even when the function is not constant.

Check your understanding

For f(x) = x², what does f′(0) = 0 mean?

Try it yourself

Let g(x) = 3x². Find g′(2), approximate g(2.05), and compute the exact error of that approximation.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The constant factor multiplies both the derivative and the quadratic remainder.

Compare with the solution

The derivative is g′(x)=6xg'(x)=6x, so g′(2)=12g'(2)=12. Since g(2) = 12 and h = 0.05, the tangent predicts 12.6. Exact expansion gives an additional 3h2=0.00753h^2=0.0075, so g(2.05) = 12.6075. The tangent underestimates by 0.0075.

Take it with you

  • A derivative is a limit of finite-step rates, not division by zero.
  • Slope has output units per input unit and differs from output height.
  • Differentiability supplies a local straight-line model with controlled small-step meaning.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.