Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 68 · Derivatives

Linearization and Newton's Method

Approximate functions with tangent lines, estimate errors with differentials, and solve equations with Newton's method, including when it fails to converge.

Zoom in far enough on a smooth curve and it looks like a straight line. That simple observation is one of the most productive ideas in applied mathematics. If you replace a complicated function by its tangent line near a point, you can estimate values by hand, study small errors, and turn hard nonlinear equations into easy linear ones. Engineers call this linearization, and it underlies small-signal circuit analysis, pendulum approximations and stability tests.

This lesson develops the tangent-line approximation, relates it to differentials and error estimates, and then uses it to build Newton's method, a fast way to solve f(x) = 0 on a computer. It also shows honestly when Newton's method breaks. You need the definition of the derivative and the differentiation rules.

The tangent-line approximation

The tangent line to y = f(x) at x = a passes through (a, f(a)) with slope f'(a). Its equation is called the linearization of f at a:

TEXT
L(x) = f(a) + f'(a) (x - a)

For x near a, f(x) ≈ L(x). Example: estimate sqrt(4.1) without a calculator. Let f(x) = sqrt(x), choose a = 4 (an easy square root nearby), so f(4) = 2 and f'(x) = 1 / (2 sqrt(x)), giving f'(4) = 1/4. Then L(4.1) = 2 + (1/4)(0.1) = 2.025. The true value is 2.02485, so we are within about 0.00015.

Another classic: for small angles in radians, sin x ≈ x. This is the linearization at a = 0, because sin 0 = 0 and cos 0 = 1. The pendulum equation becomes solvable when you make this swap.

Python Linearization of sqrt and sin

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that the error is zero at x = a and grows as you move away, roughly with the square of the distance. Linearization is a local tool; use it close to a.

Differentials and error estimates

Write Δx = x - a for a small change in input and Δy = f(a + Δx) - f(a) for the resulting change in output. The linearization says Δy ≈ f'(a) Δx. The right-hand side is the differential, written dy = f'(x) dx. It is the change along the tangent line, while Δy is the change along the curve itself.

Differentials give quick estimates of how measurement errors propagate. Suppose a sphere's radius is measured as 10 cm with an error of at most 0.1 cm. The volume is V = (4/3)πr³, so dV = 4πr² dr = 4π(100)(0.1) ≈ 125.7 cm³. The volume itself is about 4189 cm³, so the relative error is dV / V = 3 dr / r = 3%. A 1% error in radius gives roughly a 3% error in volume, a fact worth remembering.

flowchart LR
    M["Measured value x<br/>with small error dx"] --> F["Formula y = f(x)"]
    F --> D["Error in y ≈ f'(x) * dx"]
    D --> R["Relative error ≈ (x f'(x) / f(x)) * (dx / x)"]

The derivative tells you how much any input error is amplified.

From tangent lines to Newton's method

Now flip the question: given a function, where does it cross zero? Take a guess x₀. Replace f by its tangent line at x₀ and solve the linear equation L(x) = 0:

TEXT
0 = f(x₀) + f'(x₀)(x - x₀)   =>   x₁ = x₀ - f(x₀) / f'(x₀)

Repeat with x₁ to get x₂, and so on:

TEXT
x_{n+1} = x_n - f(x_n) / f'(x_n)

This is Newton's method (Newton-Raphson). Each step slides along the tangent line down to the x-axis.

flowchart TD
    A["Start with a guess x0"] --> B["Compute f(x) and f'(x)"]
    B --> C["x_new = x - f(x) / f'(x)"]
    C --> D{"|f(x_new)| small<br/>or step small?"}
    D -->|"no"| B
    D -->|"yes"| E["Report x_new as the root"]

Newton's iteration repeats until the result stops changing.

Example: computing sqrt(2). Solve f(x) = x² - 2 = 0, with f'(x) = 2x. The update is x_new = x - (x² - 2)/(2x) = (x + 2/x)/2, which is the ancient Babylonian averaging method for square roots. Starting at 1: 1.5, 1.41667, 1.414215686, 1.41421356237... Notice the number of correct digits roughly doubles each step. This is quadratic convergence, the reason Newton's method is so popular.

Python Newton's method for sqrt(2)

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Watch the error column: each error is roughly the square of the previous one, so it drops from about 1e-1 to 1e-3, 1e-6, 1e-12 and finally to machine precision.

When Newton's method fails

Newton's method is powerful but not guaranteed. Be ready for these cases:

  • A zero derivative. If f'(x_n) = 0 the tangent is horizontal and never meets the axis: division by zero.
  • A bad starting guess. Far from the root, tangent lines can send you somewhere unhelpful or to a different root.
  • Cycling. For f(x) = x³ - 2x + 2 starting at 0, the iteration bounces between 0 and 1 forever, never settling.
  • Slow convergence at repeated roots. For f(x) = (x - 1)² the derivative also vanishes at the root, and the error only halves each step (linear convergence).
  • Divergence. For f(x) = x^(1/3), each step doubles the distance from the root at 0.
Python Newton's method going wrong

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

In practice, engineers combine Newton's method with a safeguard: bracket the root first (see Continuity and bisection), and fall back to bisection if a Newton step lands outside the bracket. You will see this in Root Finding and Interpolation. When no formula for f' is handy, replace it with a finite difference, which gives the secant method.

Check your understanding

Quick check · 5 questions

of 5 answered You scored / 5 · perfect!

  1. 1. What is the linearization of f(x) = x^2 at a = 3?

    L(x) = f(a) + f'(a)(x - a) = 9 + 6(x - 3), since f(3) = 9 and f'(3) = 6.
  2. 2. A cube has side 5 cm measured with an error of 0.05 cm. Using differentials, what is the approximate error in the volume?

    V = s^3, so dV = 3s^2 ds = 3(25)(0.05) = 3.75 cm^3.
  3. 3. Which formula is Newton's update for solving f(x) = 0?

    Solving the tangent line equation 0 = f(x) + f'(x)(x_new - x) gives x_new = x - f(x)/f'(x).
  4. 4. What does quadratic convergence mean for Newton's method?

    Near a simple root the new error is about proportional to the square of the old error, so correct digits roughly double.
  5. 5. Which situation can make Newton's method fail?

    If f'(x) = 0 the tangent line is horizontal, so the update divides by zero and no next guess exists.

Summary

  • The linearization L(x) = f(a) + f'(a)(x - a) approximates f near a; the error grows roughly with the square of the distance.
  • Differentials, dy = f'(x) dx, estimate how small input errors change an output.
  • Newton's method iterates x_new = x - f(x)/f'(x), sliding down tangent lines to a root, with quadratic convergence near simple roots.
  • It can fail with flat tangents, cycles, bad starts or repeated roots, so safeguard it with a bracket.

Next, push the idea further with higher-order approximations in Taylor and Maclaurin Series.