Calculus · Linear approximation

Linear approximation

The linear approximation of a function f at a point a is its tangent line, L(x) = f(a) + f′(a)(x − a). Where f is differentiable, the error f(x) − L(x) shrinks faster than x − a, so zooming in makes the curve look straight.

01

Linear approximation in this visualization

The linear approximation of a function ff at a point aa, also called the tangent line approximation or local linearization, is the tangent line L(x)=f(a)+f′(a)(x−a)L(x) = f(a) + f'(a)(x - a). It exists where ff is differentiable at aa. Also written f(x0+Δx)≈f(x0)+f′(x0) Δxf(x_0 + \Delta x) \approx f(x_0) + f'(x_0)\,\Delta x, with x0x_0 for aa. This page shows it on seven functions: four smooth ones, and three that are not differentiable at 0.

The graph is centred horizontally on the blue point P =(a,f(a))= (a, f(a)), with equal scales on both axes. The red step Δx also sets the zoom: the view shrinks with it, stretching as needed to keep P, the tangent's rise and Q in sight. Over the step the tangent line rises by the blue differential dy=f′(a) Δxdy = f'(a)\,\Delta x, while the curve rises by Δy=f(a+Δx)−f(a)\Delta y = f(a + \Delta x) - f(a). The yellow arrow is the error:

Error of the linear approximation
E=Δy−dy=f(a+Δx)−f(a)−f′(a) Δx.E = \Delta y - dy = f(a + \Delta x) - f(a) - f'(a)\,\Delta x.

A function is differentiable at aa exactly when there is a finite number mm with f(a+h)−f(a)−mh=o(∣h∣)f(a + h) - f(a) - m h = o(|h|), that is, the error divided by hh tends to 0 as h→0h \to 0 from both sides; then m=f′(a)m = f'(a). The page draws the step to the right only (h=Δx>0h = \Delta x > 0), so the picture illustrates this rather than proves it; where a tangent exists is read from each function's formula. Because the view shrinks together with Δx\Delta x, ∣E∣/Δx|E|/\Delta x says roughly how far, in view sizes, the curve has strayed from the line at Q, which is why a differentiable curve looks straighter the further you zoom in. If f′′(a)≠0f''(a) \ne 0, then E≈12f′′(a) Δx2E \approx \tfrac12 f''(a)\,\Delta x^2 for small Δx\Delta x, so once Δx\Delta x is small each tenfold zoom makes the error about a hundred times smaller. Where f′′(a)=0f''(a) = 0, as for sin⁡x\sin x at 0, it shrinks faster still.

02

What not to misread

  • "It looks straight" is a picture, not a proof. A curve can look straight at every zoom you try and still bend at a smaller scale. The verdicts on this page (tangent line or none) come from each function's formula, not from the screen.
  • At a corner, as for ∣x∣|x| at 0, the picture is the same V at every zoom. No single line fits, so there is no linear approximation. The one-sided slopes are −1 and 1.
  • x3\sqrt[3]{x} at 0 does straighten, but into the vertical line x=0x = 0. A vertical line has no slope, so there is no approximation of the form y≈L(x)y \approx L(x). At the cusp of x2/3x^{2/3} both sides turn straight up.
  • The approximation is local. For a fixed step it can be poor: at Δx=1\Delta x = 1 the line through exe^x at 0 gives 2 instead of 2.718.
03

Where it is used

  • Estimates by hand: 4.1≈2+0.1/4=2.025\sqrt{4.1} \approx 2 + 0.1/4 = 2.025 (the true value is about 2.02485), or sin⁡θ≈θ\sin\theta \approx \theta for small angles, as in the simple pendulum.
  • Newton's method finds a zero of ff by solving L(x)=0L(x) = 0 again and again. In measurement, the differential dydy estimates how an error in xx carries over to yy.
04

Controls

  • Drag the graph sideways to slide the curve under P (a changes); scroll with the graph focused, or pinch, to zoom (Δx changes). Zoom in makes Δx ten times smaller at each step; Overview shows where the view sits on the whole curve, and a press or a drag in it moves P there.
  • Presentation mode opens a full-screen view for projectors (Space zooms, ← → change Δx tenfold, H hides the answers).
05

Related