Foundations
Taylor Expansion
Taylor approximation in one and many variables, with the assumptions behind first- and second-order remainder bounds and their role in local optimization models.
Prerequisites
Learning position
Place this page in a reading path.
foundations | layer 0A | tier 1. This page has 2 direct prerequisites and 3 published dependents.
What next
Convex Optimization BasicsThis is the first curated or graph-derived continuation from the current page.
Evidence badge
Claim statusThis page has no public Lean mapping yet. Use the evidence page to inspect how claim status labels work.
Why This Matters
Many local optimization methods are motivated by Taylor models, but the correspondence is not universal.
Gradient descent: approximate (first order). The symbol here is the gradient. The linear model is unbounded below, so choose a step by constraining or regularizing the model. When , minimizing over the trust region gives . The proximal model instead gives , the gradient-descent step. These steps coincide only when (Nocedal and Wright, 2006, Chapters 3-4).
Newton's method: approximate (second order), then solve the model's stationary equation. With a positive-definite Hessian, that stationary point is the unique minimizer; with indefinite curvature, the quadratic may have no minimum.
Quasi-Newton methods such as L-BFGS approximate curvature information. Adam instead rescales first-order gradients using running moment estimates, while natural gradient changes the metric using information geometry. Taylor expansion is central to gradient-based optimization, but these methods are not all obtained by choosing terms from one Taylor series.
Single Variable Taylor Expansion
Taylor Polynomial
The -th order Taylor polynomial of centered at is:
This is the unique polynomial of degree that matches and its first derivatives at .
The cases that matter most:
First order (linear approximation):
Second order (quadratic approximation):
Remainder Terms
The approximation is only useful if you can bound the error.
Lagrange Remainder
If is times continuously differentiable on an interval containing and , the remainder after the -th order Taylor polynomial is:
for some between and .
Integral Form of Remainder
Under the same conditions:
This form is often more useful for bounding because you can estimate the integral directly without locating the unknown point .
Main Theorems
Taylor Theorem with Lagrange Remainder
Statement
If is times continuously differentiable on an interval containing and , then:
for some between and .
Intuition
The Taylor polynomial matches perfectly at . The error depends on how much the -th derivative varies. If is bounded by on , then .
Proof Sketch
Define where is chosen so . Note trivially. By Rolle's theorem applied repeatedly, find between and where . Solving for gives the Lagrange form.
Why It Matters
This is what lets you bound the error of gradient descent. If you use the first-order approximation and has bounded second derivative (), then the approximation error over a step of size is at most . This is exactly why gradient descent with step size converges for -smooth functions.
Failure Mode
The theorem requires sufficient differentiability. If is only once differentiable, you cannot write a second-order expansion with Lagrange remainder. The bound is also only useful when is small; for large deviations the remainder can dominate.
Multivariate Taylor Expansion
For , differentiability at gives the first-order expansion
If is locally -Lipschitz along the segment from to , then the remainder has the stronger bound
and may therefore be written as .
If is twice differentiable at , the second-order expansion is
If the Hessian is locally Lipschitz, or if third derivatives are bounded nearby, the remainder strengthens to . Here is the Hessian matrix with entries (Spivak, 1965, Chapter 2; Nocedal and Wright, 2006, Chapter 2).
If is twice continuously differentiable, the Hessian is symmetric. If additionally is convex, the Hessian is positive semidefinite at every point.
The full -th order expansion generalizes using multi-index notation. For a multi-index with :
where and . In practice, the second-order form is what appears in Newton's method and quasi-Newton approximations; the Hessian quadratic captures all second-order directional information.
Why convex optimization works: When is differentiable and convex, its first-order tangent model is a global lower bound: for all . This supporting-hyperplane property is equivalent to differentiable convexity and underpins many convergence analyses for gradient-based methods (Boyd and Vandenberghe, 2004, Section 3.1).
Worked Examples
Taylor approximation of e^x around zero
Let expanded at . The derivatives are all , so for every .
The -th order Taylor polynomial is:
The Lagrange remainder after terms is:
for some between and . Because , we get the bound .
Concretely, for and :
- True value:
- Error:
- Bound:
The bound is loose but confirms the approximation is accurate to three decimal places.
As increases the remainder for any fixed because factorials grow faster than any exponential; the Taylor series for converges everywhere.
Remainder bound: log(1+x) at x=0.3
Let , , . Derivatives:
- , so
- , so
Taylor polynomial: .
Lagrange remainder: for .
For : the worst case is , giving .
Actual: . Polynomial: . Error: , within the bound.
Gradient descent step size from Taylor
Let be -smooth, meaning everywhere. By second-order Taylor:
Minimizing the right side over gives , yielding:
This is the descent lemma, the workhorse of gradient descent convergence proofs. The step size is precisely the reciprocal of the Hessian's spectral norm bound.
Newton's Method and the Second-Order Taylor Model
Newton's method forms a local second-order model at the current iterate :
Setting gives . If the Hessian is invertible, the Newton step is . When the Hessian is positive definite, is the unique minimizer of the model. When the Hessian is indefinite, it is only a stationary point and the model may be unbounded below; when the Hessian is singular, the equation may not have a unique solution.
If is -smooth and -strongly convex, gradient descent with a suitable fixed step size requires iterations to reach precision . Newton's method has a locally quadratic error bound, , when the Hessian is locally Lipschitz and the iterate starts sufficiently near a point with nonsingular Hessian. Strong-convexity bounds alone do not establish a superlinear or quadratic rate; the rate also depends on Hessian regularity and being in the local convergence region. Far from the solution, or under indefinite curvature, practical methods use line search, trust regions, damping, or cubic regularization.
Once an iterate enters a quadratic-convergence region, Newton's method can reduce the error very rapidly. The size of that region and the number of steps needed are problem-dependent (Nocedal and Wright, 2006, Chapter 3).
The cost: each Newton step requires solving an linear system, in general. This is why quasi-Newton methods (BFGS, L-BFGS) approximate the Hessian inverse without explicit computation.
Common Confusions
Taylor expansion is local, not global
The Taylor polynomial centered at approximates well near . It says nothing about the function far from . The function has a Taylor series that converges everywhere, but near 0 is not well-approximated by any polynomial centered at 0. In optimization, this locality is why step sizes must be small enough.
Second-order methods are not always better
Newton's method uses the Hessian and converges faster per step. But computing and inverting an Hessian costs storage and time. For neural networks with millions of parameters, this is infeasible. First-order methods win by being cheap per step, even if they need more steps.
Exercises
Problem
Compute the second-order Taylor expansion of at . Use the Lagrange remainder to bound the error for .
Problem
Let be twice continuously differentiable with for all . Prove that .
References
Canonical:
- Rudin, Principles of Mathematical Analysis (1976), Chapter 5: Taylor's theorem, remainder forms, and uniform convergence of series
- Apostol, Mathematical Analysis (1974), Chapter 5: single-variable Taylor theorem with Lagrange and integral remainder
- Spivak, Calculus on Manifolds (1965), Chapter 2: multivariate Taylor expansion and the Hessian
Current:
- Boyd & Vandenberghe, Convex Optimization (2004), Sections 3.1 and 9.1: supporting hyperplanes and Taylor models in optimization
- Nesterov, Introductory Lectures on Convex Optimization (2004), Section 1.2: smoothness conditions and gradient descent bounds via Taylor
- Nocedal & Wright, Numerical Optimization (2006), Chapters 2-4: Taylor models, Newton convergence, line search, and trust regions
Last reviewed: August 1, 2026
Canonical graph
Required before and derived from this topic
These links come from prerequisite edges in the curriculum graph. Editorial suggestions are shown here only when the target page also cites this page as a prerequisite.
Required prerequisites
2- Continuity in Rⁿlayer 0A · tier 1
- Differentiation in Rⁿlayer 0A · tier 1
Derived topics
3- Automatic Differentiationlayer 1 · tier 1
- Convex Optimization Basicslayer 1 · tier 1
- Newton's Methodlayer 1 · tier 1
Graph-backed continuations