Foundations to Frontier
Tests
A. Mathematical Foundations › A6 Optimization › Foundations

Newton's Method

Gradient descent uses only the slope; Newton's method also uses the curvature, fitting a parabola (a quadratic model) at each point and jumping to its bottom. Near a solution it converges quadratically, doubling the correct digits each step, and it's immune to bad scaling. You will derive it, prove quadratic convergence, see its failure modes (divergence, indefinite Hessians, cost per step), fix them with damping and Levenberg–Marquardt, and use Gauss–Newton to localize a robot from beacon ranges.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

Use the curve, not just the slope

Gradient descent feels the slope and takes a cautious step. Newton’s method also feels how the ground curves. It pretends the ground near you is a simple bowl, works out exactly where that bowl’s bottom is, and jumps there. When you’re already close to the real bottom, the bowl is an excellent guess, and you arrive in a few jumps.

Far from the bottom, the bowl guess can be badly wrong, and a jump can land you somewhere worse. So careful implementations check each jump and shorten it if needed.

Newton's method: jump to the bottom of the local parabola
Newton x3 = 0.693578 · |f′| = 8.6e-4 · GD (η = 1/L) after the same steps: 1.1995
Orange dots: Newton iterates. Blue dashed: the quadratic model at the previous iterate; its minimum is the next iterate. Green squares: gradient descent. Near the minimum Newton doubles the correct digits each step (quadratic convergence). Far away it can overshoot (√(1+x²) from |x₀| > 1 gives x ← −x³) or go uphill where f″ < 0. A line search (damping) restores global convergence while keeping the fast local phase.
Why engineers care

Newton-type methods power bundle adjustment in visual SLAM, orbit determination, nonlinear least-squares calibration, interior-point solvers for MPC, and the IRLS fits behind logistic regression. They are the method of choice when you need high accuracy in a few, more expensive steps.

📝 Quick check (Level 0)
0/3 answered
  1. 1. Newton's method uses the slope and…
  2. 2. Near the minimum, Newton's method is…
  3. 3. Far from the minimum, a raw Newton jump can…

Level 1: Beginner

★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.

In one variable

Model ff near xkx_k by its second-order Taylor polynomial:

m(x)=f(xk)+f′(xk)(x−xk)+12f′′(xk)(x−xk)2m(x) = f(x_k) + f'(x_k)(x - x_k) + \tfrac12f''(x_k)(x - x_k)^2

Setting m′(x)=0m'(x) = 0 gives the Newton step

xk+1=xk−f′(xk)f′′(xk)x_{k+1} = x_k - \frac{f'(x_k)}{f''(x_k)}

This is the same as applying Newton’s root-finding method to f′f'. For a root of g(x)=x2−ag(x) = x^2 - a it gives the Babylonian square root x←12(x+a/x)x\leftarrow\frac12(x + a/x): 1, 1.5, 1.41667, 1.4142157, … converging to 2\sqrt2.

In several variables

xk+1=xk−[∇2f(xk)]−1∇f(xk)x_{k+1} = x_k - \big[\nabla^2f(x_k)\big]^{-1}\nabla f(x_k)

In practice, solve the linear system ∇2f d=−∇f\nabla^2f\,d = -\nabla f (Cholesky). Never form the inverse. A quadratic is minimized in one step, whatever its condition number.

📝 Quick check (Level 1)
0/3 answered
  1. 1. The 1-D Newton step for minimization is…
  2. 2. On a quadratic, Newton converges in…
  3. 3. Newton for x² − 2 = 0 from x = 1 gives next…

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.

Strengths

  • Quadratic local convergence: ∥xk+1−x⋆∥≤C∥xk−x⋆∥2\|x_{k+1} - x^\star\|\le C\|x_k - x^\star\|^2.
  • Affine invariance: changing variables x=Syx = Sy doesn’t change the iterates. Scaling and conditioning stop mattering, unlike GD.

Weaknesses and fixes

  • Divergence from far away: minimizing 1+x2\sqrt{1 + x^2} gives x←−x3x\leftarrow-x^3, which explodes for ∣x0∣>1|x_0| > 1. Fix: a line search on the Newton direction (“damped Newton”, A6.1-5).
  • Indefinite Hessian (non-convex ff): the step may point uphill or toward a saddle. Fix: modify the Hessian (add λI\lambda I, or clip eigenvalues), or use trust regions.
  • Cost: forming ∇2f\nabla^2f takes O(n2)O(n^2) memory and solving takes O(n3)O(n^3). That’s impossible for n=108n = 10^8 network weights. Fix: quasi-Newton (BFGS, L-BFGS; A6.3-5), Hessian-free CG, or Gauss–Newton approximations.

Gauss–Newton and Levenberg–Marquardt

For least squares f=12∥r(x)∥2f = \frac12\|r(x)\|^2 with Jacobian JJ, the Hessian is J⊤J+∑iri∇2riJ^\top J + \sum_ir_i\nabla^2r_i. Gauss–Newton drops the second term, because it’s small near a good fit:

(J⊤J) Δ=−J⊤r(J^\top J)\,\Delta = -J^\top r

Levenberg–Marquardt solves (J⊤J+λI)Δ=−J⊤r(J^\top J + \lambda I)\Delta = -J^\top r, sliding between Gauss–Newton (λ→0\lambda\to0) and short gradient steps (λ→∞\lambda\to\infty). It’s the standard for bundle adjustment and calibration.

🐍 Exercise 1: Newton's method, fast and fragile
Implement Newton with optional Armijo damping. Verify one-step solution of a quadratic, quadratic convergence on eˣ − 2x, affine invariance under rescaling, and divergence vs damped convergence on √(1 + x²).
📝 Quick check (Level 2)
0/3 answered
  1. 1. Newton's method is affine invariant, meaning…
  2. 2. Gauss–Newton approximates the Hessian by…
  3. 3. Levenberg–Marquardt with very large λ behaves like…

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

Proof of quadratic convergence

Let ∇f(x⋆)=0\nabla f(x^\star) = 0 and ∇2f(x⋆)≻0\nabla^2f(x^\star)\succ0, with a Lipschitz Hessian (constant MM), and with ∥∇2f(x)−1∥≤1/m\|\nabla^2f(x)^{-1}\|\le1/m near x⋆x^\star. Then

xk+1−x⋆=∇2f(xk)−1[∇2f(xk)(xk−x⋆)−(∇f(xk)−∇f(x⋆))]x_{k+1} - x^\star = \nabla^2f(x_k)^{-1}\Big[\nabla^2f(x_k)(x_k - x^\star) - \big(\nabla f(x_k) - \nabla f(x^\star)\big)\Big]

and ∇f(xk)−∇f(x⋆)=∫01∇2f(x⋆+t(xk−x⋆))(xk−x⋆) dt\nabla f(x_k) - \nabla f(x^\star) = \int_0^1\nabla^2f(x^\star + t(x_k - x^\star))(x_k - x^\star)\,dt. The bracket is bounded by M2∥xk−x⋆∥2\frac M2\|x_k - x^\star\|^2. So ∥xk+1−x⋆∥≤M2m∥xk−x⋆∥2\|x_{k+1} - x^\star\|\le\frac M{2m}\|x_k - x^\star\|^2. ∎ Once the error is below m/Mm/M, the number of correct digits roughly doubles every step.

Affine invariance

Let g(y)=f(Sy)g(y) = f(Sy). Then ∇g=S⊤∇f\nabla g = S^\top\nabla f and ∇2g=S⊤∇2fS\nabla^2g = S^\top\nabla^2fS. The Newton step in yy is −(S⊤HS)−1S⊤∇f=−S−1H−1∇f-(S^\top HS)^{-1}S^\top\nabla f = -S^{-1}H^{-1}\nabla f, which is exactly S−1S^{-1} times the step in xx. ∎

The Newton decrement

λ(x)2=∇f⊤[∇2f]−1∇f\lambda(x)^2 = \nabla f^\top[\nabla^2f]^{-1}\nabla f. For self-concordant functions, λ2/2\lambda^2/2 estimates f(x)−f⋆f(x) - f^\star and gives an affine-invariant stopping rule. Damped Newton has two phases (Nesterov and Nemirovski, 1994): a damped phase with fixed decrease, then pure quadratic convergence. This is the theory behind interior-point methods.

Exercise 3.1: Why does Newton on √(1 + x²) give x ← −x³?

f′=x(1+x2)−1/2f' = x(1 + x^2)^{-1/2} and f′′=(1+x2)−3/2f'' = (1 + x^2)^{-3/2}, so f′/f′′=x(1+x2)f'/f'' = x(1 + x^2). Then x−x−x3=−x3x - x - x^3 = -x^3. It converges only for ∣x0∣<1|x_0| < 1, and cycles for ∣x0∣=1|x_0| = 1.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Newton's local error recursion is…
  2. 2. Under x = Sy, the Newton step in y equals…
  3. 3. The Newton decrement λ² equals…

Level 4: Expert

★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.

Localizing a robot from UWB ranges

Four ultra-wideband anchors sit at the corners of a long, narrow corridor (40 m × 3 m). A robot measures noisy ranges to each one. Fitting its position is a nonlinear least-squares problem. The corridor geometry makes J⊤JJ^\top J ill-conditioned (κ ≈ 130), so gradient descent takes about a thousand iterations. Gauss–Newton reaches the same fix in under ten, because it automatically rescales by the curvature. The same Gauss–Newton/LM machinery is the core of GPS solvers, bundle adjustment (Ceres, g2o) and orbit determination.

🐍 Exercise 2 (research): Gauss–Newton localization
Implement residuals, Jacobian, Gauss–Newton and GD for range-only localization in a corridor. Compare iteration counts and relate them to the conditioning of JᵀJ.

Newton-type methods in AI, robotics and aerospace

  • Bundle adjustment and SLAM back ends: sparse Levenberg–Marquardt / Gauss–Newton on factor graphs (Triggs et al., 2000; Kümmerle et al., 2011, g2o; Agarwal et al., Ceres Solver).
  • Orbit determination: batch least-squares (Gauss–Newton) differential correction has been standard since the early space age (Tapley, Schutz and Born, 2004).
  • Interior-point solvers for MPC and trajectory optimization take damped Newton steps on barrier problems (IPOPT; Wächter and Biegler, 2006).
  • Second-order methods in deep learning: Hessian-free optimization (Martens, 2010), K-FAC and Shampoo approximate curvature cheaply (A6.3-6).

References

  1. J. Nocedal, S. Wright (2006). Numerical Optimization, 2nd ed. Springer. Ch. 3, 6, 10.
  2. S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. §9.5.
  3. Y. Nesterov, A. Nemirovski (1994). Interior-Point Polynomial Algorithms in Convex Programming. SIAM.
  4. K. Levenberg (1944). “A method for the solution of certain non-linear problems in least squares.” Quarterly of Applied Mathematics, 2.
  5. D. Marquardt (1963). “An algorithm for least-squares estimation of nonlinear parameters.” SIAM Journal on Applied Mathematics, 11(2).
  6. B. Triggs, P. McLauchlan, R. Hartley, A. Fitzgibbon (2000). “Bundle adjustment — a modern synthesis.” Vision Algorithms: Theory and Practice, Springer.
  7. R. Kümmerle et al. (2011). “g2o: a general framework for graph optimization.” ICRA.
  8. B. Tapley, B. Schutz, G. Born (2004). Statistical Orbit Determination. Elsevier.
  9. J. Martens (2010). “Deep learning via Hessian-free optimization.” ICML.
  10. A. Wächter, L. Biegler (2006). “On the implementation of an interior-point filter line-search algorithm for large-scale nonlinear programming.” Mathematical Programming, 106.