Newton’s Method for Systems

Newton’s method for systems solves n nonlinear equations F(x) = 0 in n unknowns. At each step, solve the linear system J(x⁽ᵏ⁾)Δ = −F(x⁽ᵏ⁾), where J is the Jacobian matrix of partial derivatives, and set x⁽ᵏ⁺¹⁾ = x⁽ᵏ⁾ + Δ. Near a solution, the number of correct digits roughly doubles each step.

Before this lesson: Newton’s Method, Partial Derivatives and Power Method

The idea: replace each surface by its tangent plane

For one equation f(x) = 0, Newton’s method replaces the curve by its tangent line and solves the linear equation instead. For a system, each equation fᵢ(x, y) = 0 is a surface, and Newton’s method replaces each surface by its tangent plane at the current point.

The tangent planes form a linear system, which we can solve exactly. Its solution is the next guess. Near a solution the linear model is very accurate, so the error is roughly squared each step, just as in one dimension.

Graph of the circle x squared plus y squared equals 4 and the hyperbola xy = 1 in the first quadrant. They cross at about (1.932, 0.518). Newton iterates start at (2, 1), move to (2, 0.5) and then to (1.933, 0.517), which is almost on the crossing point.
Newton’s method for x² + y² = 4 and xy = 1 jumps from (2, 1) to (2, 0.5) to (1.933, 0.517), next to the solution.

Newton’s method for systems formula

Write the system as F(x) = 0 with F = (f₁, …, fₙ). The Jacobian matrix J holds every first partial derivative:

J(\mathbf{x}) = \begin{bmatrix} \dfrac{\partial f_1}{\partial x_1} & \cdots & \dfrac{\partial f_1}{\partial x_n} \\ \vdots & \ddots & \vdots \\ \dfrac{\partial f_n}{\partial x_1} & \cdots & \dfrac{\partial f_n}{\partial x_n} \end{bmatrix}

Each Newton step is

J(\mathbf{x}^{(k)})\,\boldsymbol{\Delta} = -F(\mathbf{x}^{(k)}),\qquad \mathbf{x}^{(k+1)} = \mathbf{x}^{(k)} + \boldsymbol{\Delta}

This is the formula xₖ₊₁ = xₖ − f(xₖ)/f′(xₖ) with the division by f′ replaced by solving a linear system. Never form J⁻¹; solve for Δ with Gaussian elimination (with partial pivoting) or an LU factorization.

How to use Newton’s method for systems

  1. Write every equation in the form fᵢ(x) = 0.
  2. Find the Jacobian J by taking partial derivatives.
  3. Choose a starting guess x⁽⁰⁾ close to the solution (a graph helps).
  4. Evaluate F and J at x⁽ᵏ⁾, solve JΔ = −F, and update x⁽ᵏ⁺¹⁾ = x⁽ᵏ⁾ + Δ.
  5. Stop when ‖Δ‖ and ‖F‖ are below the tolerance.

Newton’s method for systems examples

Example 1: A circle and a hyperbola

Solve x² + y² = 4 and xy = 1 with Newton’s method, starting at (2, 1). Do two steps by hand.

F(x, y) = \begin{bmatrix} x^2 + y^2 - 4 \\ xy - 1 \end{bmatrix},\quad J = \begin{bmatrix} 2x & 2y \\ y & x \end{bmatrix}

Write the system as F = 0 and take partial derivatives.

F(2, 1) = (4 + 1 - 4,\ 2 - 1) = (1, 1),\quad J = \begin{bmatrix} 4 & 2 \\ 1 & 2 \end{bmatrix}

Evaluate at (2, 1).

4\Delta x + 2\Delta y = -1,\quad \Delta x + 2\Delta y = -1

Write JΔ = −F.

3\Delta x = 0 \Rightarrow \Delta x = 0,\quad 2\Delta y = -1 \Rightarrow \Delta y = -0.5

Subtract the equations, then back-substitute.

\mathbf{x}^{(1)} = (2 + 0,\ 1 - 0.5) = (2, 0.5)

Update.

F(2, 0.5) = (4 + 0.25 - 4,\ 1 - 1) = (0.25, 0),\quad J = \begin{bmatrix} 4 & 1 \\ 0.5 & 2 \end{bmatrix}

Evaluate at (2, 0.5).

0.5\Delta x + 2\Delta y = 0 \Rightarrow \Delta x = -4\Delta y

Second row of JΔ = −F.

4(-4\Delta y) + \Delta y = -0.25 \Rightarrow -15\Delta y = -0.25 \Rightarrow \Delta y = \tfrac{1}{60}

Substitute into the first row.

\Delta x = -\tfrac{4}{60} = -\tfrac{1}{15} \approx -0.066667

Back-substitute.

\mathbf{x}^{(2)} = \left(2 - \tfrac{1}{15},\ 0.5 + \tfrac{1}{60}\right) = \left(\tfrac{29}{15}, \tfrac{31}{60}\right) \approx (1.933333, 0.516667)

Update.

Answer: after two steps, (x, y) ≈ (1.933333, 0.516667). The exact solution near the start is x = √(2 + √3) ≈ 1.931852, y = 1/x ≈ 0.517638, so the error is already about 0.0015.

Example 2: Quadratic convergence

Continue Example 1 and measure the error eₖ, the largest distance from the exact solution (1.931852, 0.517638).

kx⁽ᵏ⁾y⁽ᵏ⁾Error eₖ
0214.82 × 10⁻¹
120.56.81 × 10⁻²
21.9333330.5166671.48 × 10⁻³
31.9318530.5176371.09 × 10⁻⁶
41.9318520.5176388.0 × 10⁻¹³
\dfrac{e_3}{e_2^2} = \dfrac{1.09 \times 10^{-6}}{(1.48 \times 10^{-3})^2} \approx 0.50

Test for quadratic convergence: eₖ₊₁ ≈ C eₖ².

\dfrac{e_4}{e_3^2} = \dfrac{8.0 \times 10^{-13}}{(1.09 \times 10^{-6})^2} \approx 0.67

The ratio stays near a constant.

Answer: the errors go 10⁻³, 10⁻⁶, 10⁻¹²: the number of correct digits roughly doubles each step, which is quadratic convergence.

Example 3: One step for a 3 × 3 system

Do one Newton step from (1, 1, 1) for x² + y − z = 0, xyz = 1 and x + y² + z² = 3.

F = \begin{bmatrix} x^2 + y - z \\ xyz - 1 \\ x + y^2 + z^2 - 3 \end{bmatrix},\quad J = \begin{bmatrix} 2x & 1 & -1 \\ yz & xz & xy \\ 1 & 2y & 2z \end{bmatrix}

Partial derivatives of each equation.

F(1, 1, 1) = (1, 0, 0),\quad J = \begin{bmatrix} 2 & 1 & -1 \\ 1 & 1 & 1 \\ 1 & 2 & 2 \end{bmatrix}

Evaluate at (1, 1, 1).

\Delta y + \Delta z = 0

Row 3 minus row 2 of JΔ = (−1, 0, 0).

\Delta x + \Delta y + \Delta z = 0 \Rightarrow \Delta x = 0

Row 2, using Δy + Δz = 0.

2(0) + \Delta y - \Delta z = -1 \Rightarrow -2\Delta z = -1 \Rightarrow \Delta z = 0.5,\ \Delta y = -0.5

Row 1 with Δy = −Δz.

\mathbf{x}^{(1)} = (1, 0.5, 1.5),\quad F(\mathbf{x}^{(1)}) = (0, -0.25, 0.5)

Update and check the residual.

Answer: x⁽¹⁾ = (1, 0.5, 1.5). The largest residual dropped from 1 to 0.5. From a start this far away, Newton’s method may need many steps or a better guess; the fast doubling of digits only begins near a solution.

Example 4: Locating a phone from two towers (word problem)

A phone is 5 km from tower A at (0, 0) and 4 km from tower B at (6, 0), and it lies north of the line between them. Start at (4, 3) and do two Newton steps on x² + y² = 25 and (x − 6)² + y² = 16.

F = \begin{bmatrix} x^2 + y^2 - 25 \\ (x - 6)^2 + y^2 - 16 \end{bmatrix},\quad J = \begin{bmatrix} 2x & 2y \\ 2(x - 6) & 2y \end{bmatrix}

Set up F = 0 and the Jacobian.

F(4, 3) = (0, -3),\quad J = \begin{bmatrix} 8 & 6 \\ -4 & 6 \end{bmatrix}

Evaluate at (4, 3): 16 + 9 − 25 = 0 and 4 + 9 − 16 = −3.

8\Delta x + 6\Delta y = 0,\quad -4\Delta x + 6\Delta y = 3

Write JΔ = −F.

12\Delta x = -3 \Rightarrow \Delta x = -0.25,\quad 6\Delta y = 2 \Rightarrow \Delta y = \tfrac{1}{3}

Subtract the equations; then 6Δy = −8(−0.25) = 2.

\mathbf{x}^{(1)} = \left(3.75, \tfrac{10}{3}\right) \approx (3.75, 3.333333)

Update.

F\left(3.75, \tfrac{10}{3}\right) = \left(\tfrac{25}{144}, \tfrac{25}{144}\right) \approx (0.173611, 0.173611)

14.0625 + 11.1111 − 25 and 5.0625 + 11.1111 − 16.

12\Delta x = 0,\quad \tfrac{20}{3}\Delta y = -\tfrac{25}{144} \Rightarrow \Delta y = -\tfrac{5}{192} \approx -0.026042

J has rows (7.5, 20/3) and (−4.5, 20/3); subtract, then solve.

\mathbf{x}^{(2)} = \left(3.75, \tfrac{635}{192}\right) \approx (3.75, 3.307292)

Update.

Answer: the phone is at about (3.75, 3.3073) km. The exact location is (3.75, 5√7/4) ≈ (3.75, 3.307189), so two steps give 4 correct digits.

Example 5: A singular Jacobian

Try to start Example 1 at (1, 1).

F(1, 1) = (1 + 1 - 4,\ 1 - 1) = (-2, 0),\quad J = \begin{bmatrix} 2 & 2 \\ 1 & 1 \end{bmatrix}

Evaluate at (1, 1).

\det J = 2(1) - 2(1) = 0

J is singular (see determinant of a matrix).

2\Delta x + 2\Delta y = 2,\quad \Delta x + \Delta y = 0

JΔ = −F: the first says Δx + Δy = 1, the second says 0.

Answer: the linear system has no solution, so Newton’s method cannot take a step. Here det J = 2x² − 2y², which is 0 on the lines y = ±x. Choose a start away from them, such as (2, 1).

Common mistakes

MistakeExample of the errorFix
Solving JΔ = F instead of JΔ = −FGetting Δ = (0, 0.5) in Example 1 and moving to (2, 1.5)Keep the minus sign; the step points toward F = 0.
Mixing up rows and columns of JPutting ∂f₁/∂y in row 2Row i holds the partial derivatives of fᵢ; column j is for variable xⱼ.
Forgetting to re-evaluate JReusing J(2, 1) at (2, 0.5)Update both F and J every step (or accept slower convergence).
Inverting JComputing J⁻¹ for a 1000 × 1000 systemSolve JΔ = −F by elimination or LU; it is about 3 times cheaper and more accurate.
Starting too far awayExpecting fast convergence from any startUse a graph, physical sense or a simpler model to get a good starting guess.

Related methods

Quasi-Newton methods

When partial derivatives are hard to find, approximate each column of J with a difference quotient (see numerical differentiation), or use Broyden’s method, which updates an approximate Jacobian from step to step. These converge superlinearly instead of quadratically.

Damped Newton’s method

Taking only part of the step, x⁽ᵏ⁺¹⁾ = x⁽ᵏ⁾ + tΔ with 0 < t ≤ 1 chosen so that ‖F‖ decreases, makes the method much more reliable from poor starting guesses.

Optimization

Minimizing a function g(x, y) means solving ∇g = 0. Newton’s method applied to ∇g uses the matrix of second partial derivatives (the Hessian) as its Jacobian; compare the second derivative test and extrema of functions of two variables.

Practice problems

  1. Find the Jacobian of F(x, y) = (x²y − 3, x + y³).
  2. Do one Newton step from (3, 2) for x² − y = 1 and x + y = 5. Compare with the exact solution (2, 3).
  3. Evaluate F and J from Problem 1 at (1, 1).
  4. Use your answer to Problem 3 to take one Newton step from (1, 1).
  5. Newton errors are 10⁻² and then 10⁻⁴. About what should the next error be?
  6. For F = (x² + y² − 4, xy − 1), where is the Jacobian singular?
  7. A drone is 10 m from a beacon at (0, 0) and 8 m from a beacon at (12, 0), on the positive-y side. Do one Newton step from (6, 8).
  8. Why should you solve JΔ = −F instead of computing J⁻¹?
  9. Show that with one equation and one unknown, Newton’s method for systems is the usual Newton’s method.
  10. What can you do if the partial derivatives in J are hard to find?
Show answers

1.

\dfrac{\partial}{\partial x}(x^2y - 3) = 2xy,\quad \dfrac{\partial}{\partial y}(x^2y - 3) = x^2

Row 1.

\dfrac{\partial}{\partial x}(x + y^3) = 1,\quad \dfrac{\partial}{\partial y}(x + y^3) = 3y^2

Row 2.

Answer: J = \begin{bmatrix} 2xy & x^2 \\ 1 & 3y^2 \end{bmatrix}

2.

F(3, 2) = (9 - 2 - 1,\ 3 + 2 - 5) = (6, 0),\quad J = \begin{bmatrix} 6 & -1 \\ 1 & 1 \end{bmatrix}

F = (x² − y − 1, x + y − 5).

6\Delta x - \Delta y = -6,\quad \Delta x + \Delta y = 0

JΔ = −F.

7\Delta x = -6 \Rightarrow \Delta x = -\tfrac{6}{7},\quad \Delta y = \tfrac{6}{7}

Add the equations.

Answer: x⁽¹⁾ = (15/7, 20/7) ≈ (2.142857, 2.857143), already within 0.15 of (2, 3)

3.

F(1, 1) = (1 - 3,\ 1 + 1) = (-2, 2),\quad J(1, 1) = \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix}

Substitute x = y = 1.

Answer: F = (−2, 2) and J has rows (2, 1) and (1, 3)

4.

2\Delta x + \Delta y = 2,\quad \Delta x + 3\Delta y = -2

JΔ = −F.

6\Delta x + 3\Delta y = 6 \Rightarrow 5\Delta x = 8

Multiply the first equation by 3, then subtract the second: 6Δx − Δx = 6 − (−2).

\Delta x = 1.6,\quad \Delta y = 2 - 2(1.6) = -1.2

Back-substitute.

Answer: x⁽¹⁾ = (2.6, −0.2)

5.

e_{k+1} \approx C e_k^2,\quad C \approx \dfrac{10^{-4}}{(10^{-2})^2} = 1

Estimate C from the two errors.

Answer: about 1 · (10⁻⁴)² = 10⁻⁸

6.

\det J = 2x \cdot x - 2y \cdot y = 2x^2 - 2y^2

J has rows (2x, 2y) and (y, x).

2x^2 - 2y^2 = 0 \Rightarrow y = \pm x

Set the determinant to 0.

Answer: on the lines y = x and y = −x

7.

F(6, 8) = (36 + 64 - 100,\ 36 + 64 - 64) = (0, 36),\quad J = \begin{bmatrix} 12 & 16 \\ -12 & 16 \end{bmatrix}

F = (x² + y² − 100, (x − 12)² + y² − 64).

12\Delta x + 16\Delta y = 0,\quad -12\Delta x + 16\Delta y = -36

JΔ = −F.

24\Delta x = 36 \Rightarrow \Delta x = 1.5,\quad 16\Delta y = -18 \Rightarrow \Delta y = -1.125

Subtract, then back-substitute.

Answer: x⁽¹⁾ = (7.5, 6.875); the exact position is (7.5, √43.75) ≈ (7.5, 6.614378)

8.

Answer: solving JΔ = −F by elimination costs about n³/3 operations, while forming J⁻¹ costs about n³ and adds more round-off; you only need Δ, not the inverse

9.

J = [f'(x)],\quad f'(x_k)\,\Delta = -f(x_k)

With n = 1, J is the 1 × 1 matrix f′(x).

x_{k+1} = x_k + \Delta = x_k - \dfrac{f(x_k)}{f'(x_k)}

Solve for Δ and update.

Answer: it is exactly Newton’s method for one equation

10.

Answer: approximate J with difference quotients, or use a quasi-Newton method such as Broyden’s method, which needs only values of F

Newton’s method for systems FAQ

How does Newton’s method work for a system of equations?

At the current guess, it replaces each equation by its linear approximation, solves the resulting linear system JΔ = −F for the correction Δ, and adds Δ to the guess. It repeats until the corrections are tiny.

What is the Jacobian matrix in Newton’s method?

It is the n × n matrix whose entry in row i and column j is ∂fᵢ/∂xⱼ. It plays the role of the derivative f′(x) in the one-variable method.

Does Newton’s method for systems always converge?

No. It converges quadratically when the start is close enough to a solution where J is invertible. From a poor start it can wander or diverge, and it fails if J is singular.

How do you choose a starting point?

Graph the equations when possible, use physical meaning or a simpler model, or run a few steps of a slower but safer method first.

Summary

  • Write the system as F(x) = 0 and find the Jacobian J of partial derivatives.
  • Each step solves J(x⁽ᵏ⁾)Δ = −F(x⁽ᵏ⁾) and sets x⁽ᵏ⁺¹⁾ = x⁽ᵏ⁾ + Δ.
  • Near a solution with J invertible, convergence is quadratic.
  • Solve for Δ by elimination or LU; never invert J.
  • A singular J or a poor start can make the method fail; damping and quasi-Newton methods help.

Previous lesson: Power Method

Next lesson: Heun’s Method

Back to the Numerical Methods Index