Skip to content
Tactiverge

Textbooks/Applied Engineering Mathematics/Chapter 3Lite (plain text) version

3Linearisation, Jacobians and Newton's method

Version 1 · Technically checked (automated checks only) · 4 source lessons · 8 practice items

Text
All chapters and search
  1. 1. Linear systems in practice
  2. 2. Least squares and model fitting
  3. 3. Linearisation, Jacobians and Newton's method
  4. 4. Differential equations and stability
  5. 5. Fourier and transform thinking
  6. 6. Numerical methods and their errors
  7. 7. Statistics for engineering evidence
  8. 8. Estimation and error budgets

Introduction

Most real systems are nonlinear, but near any operating point they behave almost linearly. This chapter turns that idea into tools: a matrix as a linear map, the Jacobian as the best linear map at a point, linearised models whose eigenvalues reveal local behaviour, and Newton's method, which solves nonlinear equations by repeatedly solving the linear approximation.

xf(x) = x² − 2x0 = 2x1 = 1.5x2 = 1.41667x3 = 1.41422 (√2 = 1.41421)
Figure 3.1. Riding the tangent to √2. The curve f(x) = x² − 2 with tangent lines. Starting at x0 = 2, the first tangent meets the axis at x1 = 1.5, the next at x2 = 1.41667 and then x3 = 1.41422, already within 0.00002 of √2 = 1.41421. The number of correct digits roughly doubles each step.

Explanation

This chapter is built from 4 School lessons. Each part below is the lesson's own explanation; open the lesson for its predict-and-discover activities.

3.1 Rotation, shear, stretch and projection

Every 2×2 matrix is a picture. Can you guess what [[1, 1], [0, 1]] does to a square before you calculate anything?

Columns are images of the basis

A·(x, y) = x·A(î) + y·A(ĵ). So column 1 is A(î) and column 2 is A(ĵ). Linear maps keep the origin fixed, keep lines straight and keep evenly spaced grid lines evenly spaced.

A catalogue

Rotation by θ: [[cos θ, −sin θ], [sin θ, cos θ]], det 1. Shear: [[1, k], [0, 1]], det 1. Stretch: [[s₁, 0], [0, s₂]], det s₁s₂. Reflection in the x-axis: [[1, 0], [0, −1]], det −1. Projection onto the x-axis: [[1, 0], [0, 0]], det 0.

Projections

A projection P drops each vector onto a subspace. Doing it twice changes nothing more, so P² = P. It squashes a direction to zero, so det P = 0 and there is no inverse: from the shadow you cannot recover the object. Projection onto a unit vector u is P = uuᵀ, which reappears in least squares.

Common mix-ups

  • Translation (shifting by a constant) is a linear map.
    ✓ Linear maps fix the origin. Translations need homogeneous coordinates (a 3×3 matrix in 2D).
  • The images of the basis vectors go in the rows.
    ✓ They go in the columns.

Open the full lesson: Rotation, shear, stretch and projection →

3.2 Module check: the Jacobian as a linear map

Near any pose, a robot arm behaves like a matrix. What can that matrix tell you about where the arm can and cannot move?

Question → method → evidence

Question: at a given pose, which hand motions are possible and how much joint motion do they need? Method: linearise to J, then treat Δp = J·Δθ as a linear system. Evidence: solve for Δθ, compare the predicted hand motion with the exact forward kinematics, and examine det J and the columns of J.

Columns tell the story

Column 1 of J is the hand velocity from turning joint 1 alone; column 2 from joint 2 alone. Their span is the set of achievable hand velocities. If the columns become parallel, the span collapses to a line, exactly as in week 1's column picture.

Near-singular is already bad

Close to a singularity, det J is small and J⁻¹ has huge entries: a modest hand step demands enormous joint speeds, and sensor noise in θ is amplified. Controllers use damped least squares or avoid such poses. This links straight to conditioning in week 5.

Derivation: The two-link Jacobian
  1. Hand position: x = L₁cos θ₁ + L₂cos(θ₁ + θ₂), y = L₁sin θ₁ + L₂sin(θ₁ + θ₂).

  2. Small changes: Δx ≈ (∂x/∂θ₁)Δθ₁ + (∂x/∂θ₂)Δθ₂, and the same for y. In matrix form Δp ≈ J·Δθ.

  3. J = [[−L₁sin θ₁ − L₂sin(θ₁ + θ₂), −L₂sin(θ₁ + θ₂)], [L₁cos θ₁ + L₂cos(θ₁ + θ₂), L₂cos(θ₁ + θ₂)]].

  4. det J = L₁L₂[sin(θ₁ + θ₂)cos θ₁ − cos(θ₁ + θ₂)sin θ₁] = L₁L₂ sin θ₂.

  5. Where det J ≠ 0, Δθ = J⁻¹Δp gives the joint step for a desired hand step. Where det J = 0, J has rank 1 and some Δp cannot be produced.

Common mix-ups

  • If det J is not exactly zero, the arm is fine.
    ✓ Near-singular poses already amplify errors and speeds badly.
  • The Jacobian is the same everywhere.
    ✓ It depends on the pose; it is a local linear model.

Open the full lesson: Module check: the Jacobian as a linear map →

3.3 Linearising nonlinear models

A pendulum hanging down is stable; balanced upright it falls. One Jacobian matrix explains both. How?

The method

  1. Find equilibria by solving f(x*) = 0. 2. Compute the Jacobian J = ∂f/∂x. 3. Evaluate it at each equilibrium. 4. Classify with the eigenvalues (week 6). If no eigenvalue has zero real part, the nonlinear system behaves like its linearisation close to that point (the Hartman–Grobman theorem).

Validity

The linear model is accurate only for small deviations. For the pendulum, sin θ ≈ θ is within 1% for |θ| below about 14°. A centre in the linearisation (zero real parts) is inconclusive: the nonlinear terms decide. Always state the range over which you trust the linear model.

Why controllers love it

Linearise a balancing robot about upright, design a controller that moves the saddle's unstable eigenvalue into the left half-plane, then test the controller on the full nonlinear model to see how big a push it survives.

Derivation: Linearising the pendulum
  1. States θ and ω = θ′: θ′ = ω, ω′ = −(g/L) sin θ − bω. This is x′ = f(x), nonlinear because of sin θ.

  2. Equilibria: f = 0 needs ω = 0 and sin θ = 0, so θ = 0 (hanging) or θ = π (upright).

  3. Near an equilibrium x, write x = x + δ. Taylor: δ′ ≈ J(x*)·δ with J the Jacobian, Jᵢⱼ = ∂fᵢ/∂xⱼ.

  4. Here J = [[0, 1], [−(g/L) cos θ, −b]].

  5. θ = 0: J = [[0, 1], [−g/L, −b]], tr = −b < 0, det = g/L > 0: a stable spiral (for small b). θ = π: J = [[0, 1], [g/L, −b]], det = −g/L < 0: a saddle, unstable.

Common mix-ups

  • A linear model is wrong for a nonlinear system.
    ✓ It is accurate near the operating point; the skill is knowing how near.
  • Linear stability guarantees stability for any disturbance.
    ✓ Only for small disturbances. A large push can leave the region where the linear model holds.

Open the full lesson: Linearising nonlinear models →

3.4 Newton's method: ride the tangent

Bisection needs about 20 steps for six decimal places. Newton's method often needs four. What's the catch?

Fast when close

From a good starting guess, Newton's method converges quadratically: the number of correct digits roughly doubles each step. For x² − 2 from 1, four steps give about 12 correct digits, where bisection on [0, 2] would need about 40.

It needs the derivative

You must supply f′(x), worked out by hand or estimated numerically. If f′(x_k) = 0 the tangent is flat and never crosses zero: the method can't continue. Guard against it and cap the number of steps.

It can run away

If the start is far from the root, or the function flattens out, the tangent can throw the next guess further away. arctan x from x₀ = 1.5 diverges. Engineers often bracket first with bisection, then switch to Newton once close, or reject any Newton step that leaves the bracket.

Derivation: Where the Newton update comes from
  1. Near a guess x_k, replace the curve by its tangent line: y ≈ f(x_k) + f′(x_k)·(x − x_k).

  2. Find where that line crosses zero: 0 = f(x_k) + f′(x_k)·(x − x_k).

  3. Solve for x: x_{k+1} = x_k − f(x_k)/f′(x_k). This needs f′(x_k) ≠ 0.

  4. For f(x) = x² − c, f′(x) = 2x, so x_{k+1} = x_k − (x_k² − c)/(2x_k) = (x_k + c/x_k)/2: average the guess with c divided by the guess.

  5. Near a simple root the error obeys e_{k+1} ≈ C·e_k², so an error of 10⁻³ becomes about 10⁻⁶, then 10⁻¹². That's quadratic convergence.

Common mix-ups

  • Newton's method always finds the nearest root.
    ✓ It can jump to a different root, or diverge, depending on the starting guess.
  • If a few steps look like they are settling, the answer is right.
    ✓ Check |f(x)| is small and the change between steps is below tolerance, and cap the steps.

Open the full lesson: Newton's method: ride the tangent →

Worked examples

Rotation, shear, stretch and projection: example 1

Write the matrix that rotates by 90° anticlockwise and check it sends (1, 0) to (0, 1).

Solution

θ = 90°: [[0, −1], [1, 0]]. First column (0, 1) is where î lands. ✓ Second column (−1, 0): ĵ goes to −î, also correct.

Rotation, shear, stretch and projection: example 2

Find the matrix projecting onto the line through u = (1, 1)/√2.

Solution

P = uuᵀ = ½[[1, 1], [1, 1]]. Check P² = ¼[[2, 2], [2, 2]] = P. ✓ P(1, 0) = (0.5, 0.5), the foot of the perpendicular.

Module check: the Jacobian as a linear map: example 1

L₁ = L₂ = 1, θ₁ = 0, θ₂ = 90°. Find J and the joint step for Δp = (0, 0.01).

Solution

sin(θ₁ + θ₂) = 1, cos(θ₁ + θ₂) = 0, sin θ₁ = 0, cos θ₁ = 1. J = [[−1, −1], [1, 0]], det J = 1. J⁻¹ = [[0, 1], [−1, −1]]. Δθ = J⁻¹(0, 0.01) = (0.01, −0.01) rad.

Linearising nonlinear models: example 1

Find and classify the equilibria of x′ = y, y′ = x − x³.

Solution

Equilibria: y = 0 and x(1 − x²) = 0, so x = 0, ±1. J = [[0, 1], [1 − 3x², 0]]. At x = 0: det = −1, a saddle. At x = ±1: J = [[0, 1], [−2, 0]], tr = 0, det = 2: a linear centre, inconclusive in general; here energy conservation shows they are genuine centres.

Newton's method: ride the tangent: example 1

Newton's method with a step limit and a flat-slope guard, compared with the true root.

Solution

import math


def newton(f, df, x, tol=1e-12, max_steps=20):
    """Return (estimate, steps). Raises ValueError on a flat tangent or no convergence."""
    for step in range(1, max_steps + 1):
        slope = df(x)
        if slope == 0:
            raise ValueError(f"flat tangent at x = {x}")
        x_new = x - f(x) / slope
        if abs(x_new - x) < tol:
            return x_new, step
        x = x_new
    raise ValueError("did not converge")


root, steps = newton(lambda x: x * x - 2, lambda x: 2 * x, 1.0)
print(root, steps, abs(root - math.sqrt(2)) < 1e-15)   # 1.414213562373095 6 True

try:
    newton(math.atan, lambda x: 1 / (1 + x * x), 1.5)
except (ValueError, OverflowError) as err:
    print("arctan from 1.5:", type(err).__name__)

Interactive figures

Figure 3.2 from Linearising nonlinear modelsIn 'Any 2×2 matrix' mode, enter the hanging-down linearisation [[0, 1], [−4, −0.5]], then the upright one [[0, 1], [4, −0.5]] (g/L = 4, b = 0.5). Compare the portraits and the classification.
Can't use the interactive? Read a description instead

In general mode the phase portrait is set to the pendulum's linearised matrices. Text reports trace, determinant, eigenvalues and the equilibrium type: stable spiral for hanging, saddle for upright.

Interactive figure (online). Description: In general mode the phase portrait is set to the pendulum's linearised matrices. Text reports trace, determinant, eigenvalues and the equilibrium type: stable spiral for hanging, saddle for upright.

Figure 3.3 from Newton's method: ride the tangentChoose x² − 2 and Newton. Step four times and compare the error column with bisection's. Then choose arctan x (Newton trap): start at 1.0, then at 1.5. What does the tangent do from 1.5?
Can't use the interactive? Read a description instead

The stepper shows Newton's method on x² − 2 from 1: the orange tangent at each guess meets the axis at the next guess, 1.5, 1.41667, 1.4142157, with the error column shrinking from 10⁻¹ to 10⁻³ to 10⁻⁶ to 10⁻¹². For arctan x from 1.5, each tangent lands further away and the readout reports divergence.

Interactive figure (online). Description: The stepper shows Newton's method on x² − 2 from 1: the orange tangent at each guess meets the axis at the next guess, 1.5, 1.41667, 1.4142157, with the error column shrinking from 10⁻¹ to 10⁻³ to 10⁻⁶ to 10⁻¹². For arctan x from 1.5, each tangent lands further away and the readout reports divergence.

Laboratory

Everything runs in your browser. No kit, nothing mains-powered. Simulations are simplified educational models.

  • Equation Lab exploration

    Equation Lab: Roots

    Run Newton's method and bisection on the same equation and count how many steps each needs for six correct digits.

    Open Equation Lab: Roots →
  • Playground lab

    Playground: Robotic kinematics

    Fold the two-link arm towards straight and note where small joint changes stop moving the tip: the Jacobian is losing rank.

    Open Playground: Robotic kinematics →

Guided practice

Answers are checked on the server; wrong answers get a hint and another try. Signed in, solved items also count towards the source lesson.

Practice 1

A sends î to (2, 0) and ĵ to (0, 3). What is A?

Practice 2

P projects onto a line. What is P³?

Practice 3

At θ₂ = 180° (folded back), the rank of J is…

Practice 4

Why do controllers avoid poses where det J is small but not zero?

Practice 5

Hanging pendulum, linearised: J = [[0, 1], [−9, −0.6]]. Classify.

Practice 6

For which angle is sin θ ≈ θ least trustworthy?

Practice 7

Newton's method on f(x) = x² − 4 starts at x₀ = 0. What happens?

Practice 8

Which statement compares bisection and Newton fairly?

  1. A sends î to (2, 0) and ĵ to (0, 3). What is A?
    • [[2, 0], [0, 3]]
    • [[2, 3], [0, 0]]
    • [[0, 2], [3, 0]]
  2. P projects onto a line. What is P³?
    • 0
    • P
    • I
  3. At θ₂ = 180° (folded back), the rank of J is…
    • 2
    • 1
    • 0
  4. Why do controllers avoid poses where det J is small but not zero?
    • The arm becomes heavier
    • J⁻¹ has huge entries, so small hand moves need huge joint speeds
    • The forward kinematics stops working
  5. Hanging pendulum, linearised: J = [[0, 1], [−9, −0.6]]. Classify.
    • Stable spiral
    • Saddle
    • Unstable node
  6. For which angle is sin θ ≈ θ least trustworthy?
    • 5°
    • 10°
    • 45°
  7. Newton's method on f(x) = x² − 4 starts at x₀ = 0. What happens?
    • It converges to 2
    • It converges to −2
    • It fails: f′(0) = 0, so the update divides by zero
    • It converges slowly
  8. Which statement compares bisection and Newton fairly?
    • Newton is always better
    • Bisection is guaranteed given a sign change but slow; Newton is much faster near a root but can fail from a poor start
    • Bisection needs the derivative
    • They converge at the same rate

Engineering applications

  • Robot arm control

    The Jacobian maps small joint movements to small tip movements. Controllers invert it to steer the tip, and avoid poses where its determinant is near zero because joint speeds would blow up.

  • Circuit operating points

    Simulators find the operating point of circuits with diodes and transistors by Newton's method: linearise each device, solve the linear network, repeat until the voltages stop changing.

Watch

Optional verified videos. Nothing loads from YouTube until you press play.

Shows a matrix as a description of where the basis vectors land, so you can read a transformation straight off its columns.

10 min 58 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

Starts with Newton's method as a practical root finder, then shows beautifully how sensitive it is to the starting guess.

Length: see YouTube · captions on YouTube · source

Nothing loads from YouTube until you press play.

Approximating functions with polynomials, the idea behind linearising a model around an operating point.

22 min 19 s · captions on YouTube · source

Nothing loads from YouTube until you press play.

  • Linear transformations and matrices | Chapter 3, Essence of linear algebra (3Blue1Brown)
  • Newton’s fractal (which Newton knew nothing about) (3Blue1Brown)
  • Taylor series | Chapter 11, Essence of calculus (3Blue1Brown)

Chapter summary

  • A matrix's columns show where the basis vectors land; that is the whole map.
  • The Jacobian is the matrix of partial derivatives: the best linear approximation near a point.
  • Linearising at an equilibrium and finding eigenvalues classifies the local behaviour, if no eigenvalue has zero real part.
  • Newton's method converges very fast near a simple root but can fail where the tangent is flat.

Glossary

Derivative (rate of change)
The derivative of a quantity is its instantaneous rate of change: the gradient of its graph at a point.
2D rotation matrix
A 2D rotation by angle θ anticlockwise maps (x, y) to (x cos θ − y sin θ, x sin θ + y cos θ), written as a 2×2 matrix.
Forward kinematics (two-link arm)
Forward kinematics computes where the end-effector is from the joint angles and link lengths.
Inverse kinematics
Inverse kinematics finds joint angles that place the end-effector at a desired position. There may be several solutions, one, or none.

Definitions from the Field Guide.

Project: A Newton solver with guard rails

Write a Newton solver for one nonlinear engineering equation (a diode in series with a resistor works well). Add a fall-back to bisection when the step leaves a safe bracket. Show the convergence table and one start where plain Newton fails.

Deliverables

  • The equation, its derivative and the bracket
  • A table of iterates for a good start and a bad start
  • A note on when the fall-back triggers

Keep your work in your Engineering Journal; it stays private unless you choose to share it.

References

  • Erwin Kreyszig (2011). Advanced Engineering Mathematics, 10th edition. Wiley.
  • William H. Press et al. (2007). Numerical Recipes: The Art of Scientific Computing, 3rd edition. Cambridge University Press.

Publication record

Version
1
Status
Technically checked (automated checks only)
Technical review
Automated checks only, last run 2026-11-29. No human, educator or mentor review is claimed.src/content/textbooks/textbooks.test.ts: schema, every lesson, diagram, practice item, video, Field Guide entry, lab and reference resolves; figure numbers recomputed; no practice answers in client payloads.
Written by
Compiled and written by the Tactiverge team with AI assistance, from Tactiverge School lessons that were themselves written with AI assistance.
Licence
All rights reserved by the founders unless a licence is approved.
Corrections
None recorded yet.Spotted a mistake? Use “Report a problem” on any chapter, or see the corrections page.