AI Glossary / Graphs and symbolic AI / Intermediate
Taylor expansion
Definition
A Taylor expansion represents a function near a chosen point using its value and derivatives at that point. A finite expansion gives a polynomial approximation together with a remainder describing the error. When the corresponding infinite series converges to the function, it is called a Taylor series representation. The expansion provides a systematic way to understand local change, including slope and curvature.
What it means
The central idea is to replace a complicated function locally with a simpler polynomial. A constant term matches the function's value, a linear term matches its slope, and a quadratic term adds curvature. Higher derivatives supply further corrections.
The center of expansion matters. An approximation constructed near one input may perform poorly far away. A finite Taylor polynomial can still be useful even when an infinite-series representation is unavailable. Conversely, having derivatives of every order does not by itself guarantee that the Taylor series equals the original function. The applicable smoothness and convergence conditions must be checked.
How it works
Choose a center a and write the nearby input as a+h. The first terms are f(a+h) = f(a) + f′(a)h + f″(a)h²/2 + further terms and remainder. A term of order k uses the kth derivative divided by k factorial, multiplied by h to the kth power.
Select an order appropriate to the task and estimate the omitted part. Under suitable differentiability conditions, a bound on the next derivative gives a bound on the finite approximation error. A small h helps only in relation to those derivatives and the function's behavior.
For several variables, a first-order expansion uses the gradient and a second-order expansion uses the Hessian matrix. This underlies many local optimization and approximation methods. The expansion describes the mathematical model; it does not eliminate measurement error or establish that the model accurately represents the real system.
Three practical examples
1. Optimization: a training method uses a local linear or quadratic model of a loss function to guide a parameter update, with safeguards when the approximation is poor.
2. Sensitivity analysis: an analyst estimates how a small input perturbation changes a smooth model output, then checks whether neglected curvature matters.
3. Numerical computation: software approximates a function over a controlled neighborhood using a polynomial and an error analysis, rather than assuming a truncated expression is exact everywhere.
Think of it this way
Think of inspecting a curved road near one point. A straight tangent describes its immediate direction, while a curved local sketch captures more of the nearby shape.
The analogy stops when the sketch is treated as a map of the entire journey. A Taylor polynomial is tied to a center and an error regime. More local detail does not automatically justify a prediction far beyond the region where that detail is informative.
Worked example
Approximate f(x) = 1/(1−x) around a = 0. Its first values are f(0)=1, f′(0)=1, and f″(0)=2. The quadratic Taylor polynomial is therefore P2(x)=1+x+x².
At x=0.1, the polynomial gives 1+0.1+0.01=1.11. The exact function value is 1/0.9=1.111111… . The error is 0.001111… . For this particular function, algebra gives the exact remainder f(x)−P2(x)=x³/(1−x), provided x is not 1. Substituting 0.1 confirms the error without relying on rounded subtraction.
At x=0.5, P2 gives 1.75 while the exact value is 2, so the error is 0.25. At x=0.9, P2 gives 2.71 while the exact value is 10, so the error is 7.29. The same polynomial becomes much less useful as the input approaches the singularity at 1.
The infinite geometric series 1+x+x²+... represents this function only for |x|<1. At x=2, the function exists and equals −1, but that series diverges. The existence of a finite function value does not establish convergence of an expansion around a different point.
Illustrative case study
Fictional case: LocalFit builds a fast approximation to a smooth score around a standard operating point. Its developers initially evaluate the approximation over a much wider range than the range used during design.
The review team compares exact and approximate values on representative inputs and finds that the approximation error grows near a boundary. It limits the supported range, uses a different center where appropriate, and retains the original calculation outside the tested region. The case illustrates error-aware deployment, not a reported accuracy or speed improvement.
Common misconceptions and mistakes
A Taylor polynomial and a Taylor series are related but different. A polynomial has finitely many terms; a series involves an infinite limit whose convergence must be justified.
More terms do not remove all practical concerns. Derivative estimation, numerical rounding, and evaluation cost can still matter.
Do not omit factorials or confuse h with the original input when the center is not zero. The displacement is x−a.
An approximation error bound applies under its stated assumptions. It does not cover unrelated modeling error, noisy observations, or non-smooth points where the required derivatives do not exist.
Business use
Taylor expansions help teams reason about local sensitivity and numerical approximations in machine learning and analytics. They can make an optimization step or approximation assumption easier to inspect.
Document the center, retained order, valid range, and error criterion. Compare the approximation with the original function at boundary and representative points. If derivatives come from estimated data or another model, include that uncertainty in the assessment. Avoid translating a mathematically local claim into an unrestricted business forecast: the expansion only supports the behavior warranted by its function and neighborhood.
People also ask
Is a Taylor expansion always centered at zero?
No. An expansion centered at zero is often called a Maclaurin expansion; other centers are equally possible.
Does a smooth function always equal its Taylor series?
No. Infinite differentiability alone is insufficient; analyticity supplies the relevant local equality.
Can a first-order approximation be enough?
Yes, when its error is acceptable over the intended range. The required accuracy determines whether curvature or further terms matter.
Check your understanding
Why is P2(0.9)=2.71 a poor approximation in the worked example?
Answer: The exact value is 10, giving error 7.29. The input is near the function's singularity at 1, where the omitted terms are substantial.
Related terms
- Gradient
- Hessian
- Derivative
- linearisation
- curvature
- remainder
- analytic function
- convergence radius
- Newton's method
Learn next
Study remainder bounds next. For the worked function, use x³/(1−x) to find an interval of nonnegative x where the quadratic error is below 0.01. Then compare the first-order error with the quadratic error at the same inputs.
More in Graphs and symbolic AI
- Table lookup - Table lookup is the retrieval of a stored output using an input as a key or index.
- Tabled logic programming - Tabled logic programming is a way of evaluating logic programs that stores answers to selected subgoals and reuses them when equivalent calls recur.
- Tabu search - Tabu search is an optimization method that guides local search using memory of earlier moves or solution features.
- Technological singularity - The technological singularity is a hypothetical transition in which technological change, often associated with intelligence exceeding human capabilities...
- Template - In information extraction, a template is a structured specification of the information a system should capture about an entity, event, or relationship.
- Temporal-difference - Temporal-difference, usually abbreviated TD, refers to a learning approach that updates a prediction using newly observed information and a later prediction.
Sources
Primary reference: NIST Digital Library of Mathematical Functions, Taylor's theorem, https://dlmf.nist.gov/1.4.vi, and Taylor series examples, https://dlmf.nist.gov/1.10.i. The formulas and conditions were read directly. The rational-function calculations and fictional case are original teaching material, with the remainder verified algebraically.
Previous: Taxonomy Next: TD(lambda)