Taylor Series

Approximate any smooth curve by a polynomial that agrees with it at one point. Add terms and watch the agreement spread.

Taylor Series

This module needs JavaScript: the numbers are computed in the page rather than recorded.

Worth knowing

The series matches the function's value, then its slope, then its curvature, then the rate of change of curvature, and so on.
Each term buys accuracy near the expansion point. None of them buys accuracy far from it.
One term is a constant. Two is the tangent line. Three is the quadratic every optimiser secretly uses.
Move the expansion point and the region of agreement moves with it. It is a local statement, always.

Overview

Build the approximation

Around x = a, the degree-n Taylor polynomial is a sum of derivative terms:

Tₙ(x) = Σₖ₌₀ⁿ f⁽ᵏ⁾(a)(x−a)ᵏ/k!

For eˣ around a = 0, every derivative equals 1, so T₃(x) = 1 + x + x²/2 + x³/6. At x = 0.1 this gives 1.10517, close to e^0.1 ≈ 1.10517. Near the expansion point, higher-degree terms often improve the approximation.

In this guide
  1. Local does not mean universal
  2. Why the expansion point matters
  3. Try this above
  4. Sources and next steps

Taylor Series

A Taylor polynomial approximates a smooth function near a chosen point using its derivatives there.

Local does not mean universal

The error depends on the function, expansion point, and distance from that point. A Taylor series may converge only within a limited interval; a finite polynomial can become inaccurate far away. Use the remainder bound or compare with the original function over the range where the approximation will be used.

Optimisers use first- and second-order Taylor approximations to estimate how a loss changes after a parameter step. Newton's method uses local curvature; see Jacobians and Hessians. The derivative definition is the first-order version; see derivatives and slope.

Why the expansion point matters

A Taylor polynomial matches the function's value and several derivatives at a chosen point a. For eˣ near zero, T₃(x)=1+x+x²/2+x³/6. At x=0.1 the cubic is close to e^0.1; at a point farther from zero, omitted higher-order terms matter more. Expanding around a different point can give a much better approximation near that location. A Taylor polynomial is local information expressed as a polynomial, not automatically an exact identity over the whole real line.

The remainder measures the approximation error. If the next derivative is bounded by M between a and x, the degree-n error is at most M|x−a|ⁿ⁺¹/(n+1)! under the usual Taylor theorem conditions. This bound depends on the interval, not just the degree. Some functions have a Taylor series that converges only within a radius; others have a convergent series that does not equal the function outside its convergence interval. Use the approximation only over a range where error is controlled. Optimisers use first- and second-order expansions as local models, then recompute as the parameters move.

Try this above

Increase the polynomial degree and move x farther from the expansion point. Compare the approximation error near and far from that point.

For sin(x) around zero, the degree-three polynomial is x−x³/6. At x=0.2 it closely approximates sin(0.2), because the neglected terms are small near the expansion point. At x=2, the same low-degree polynomial is much less accurate. The polynomial degree is therefore not a stand-alone accuracy guarantee; the distance from a and the size of higher derivatives both matter. In numerical work, test the approximation over the actual operating range rather than only at the point where derivatives were matched.

A first-order Taylor polynomial is the tangent line; a second-order polynomial adds curvature. For a small parameter update Δ, a loss can be approximated as f(x+Δ)≈f(x)+∇f(x)ᵀΔ+½ΔᵀHΔ. Gradient methods use the linear term, while Newton-style methods use both. The approximation is only local, so an optimiser may need a line search or trust region to avoid taking a step where the polynomial no longer predicts the actual function.

Sources and next steps

Check yourself

0 of 3

Answer without scrolling back up.

  1. What does the second term of a Taylor series give you?

  2. Why does the series for 1/(1+x^2) stop improving beyond x = 1?

  3. A Taylor series is a statement about:

Cheat sheet

Taylor Series

Expand a function into a polynomial term by term. Watch the approximation improve near the centre and fail past the radius of convergence.

MATHS · vizlearn.in/maths/taylor_series.html

About the author

Ashish Jangra builds and maintains VizLearn. Every module here is written and the visualisation behind it hand-built, so the numbers in a readout come from the same code that draws the picture. Corrections are genuinely welcome and get priority over everything else — if a page states something wrong, or an animation misrepresents what the algorithm does, get in touch.

Teaching a course with this? Individual teachers can use it freely; for a whole department or programme, see institutional licences.