calculus

Taylor Series Explained: Approximating Any Function With Polynomials

How Taylor and Maclaurin series turn complicated functions into polynomials — the formula, classic expansions of e^x, sin x, cos x, and how to compute them.

本文中文版本即将上线。下方暂以英文原文展示。

AI-Math Editorial Team

作者: AI-Math Editorial Team

发布于 2026-05-01

If derivatives capture the slope of a function at a point, Taylor series capture the entire function at a point — by stacking up an infinite number of derivatives. They are the bridge between calculus and numerical computing: every time your calculator computes sin(0.4)\sin(0.4), it is summing a Taylor series under the hood.

The Taylor series formula

The Taylor series of a function ff centered at x=ax = a is:

f(x)=n=0f(n)(a)n!(xa)nf(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!} (x - a)^n

That is: evaluate ff, ff', ff'', ff''', … at the point aa, then build a polynomial whose nn-th term is f(n)(a)n!(xa)n\frac{f^{(n)}(a)}{n!}(x-a)^n.

When a=0a = 0, the series is called a Maclaurin series — the most common case.

Why does this work?

Around the point aa, a function looks like its tangent line (n=1n=1 term), then like a parabola including curvature (n=2n=2), then a cubic, and so on. Each higher derivative captures finer-grained shape information. Add infinitely many and (for "nice" functions) you recover ff exactly.

Three classic Maclaurin expansions

Memorise these three — they show up constantly:

ex=n=0xnn!=1+x+x22!+x33!+e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots

sinx=n=0(1)nx2n+1(2n+1)!=xx33!+x55!\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots

cosx=n=0(1)nx2n(2n)!=1x22!+x44!\cos x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots

The exponential's series has all powers; sine has odd powers only; cosine has even powers only. That symmetry is a direct consequence of which derivatives are zero at 00.

Worked example: building sinx\sin x from scratch

Let f(x)=sinxf(x) = \sin x. At a=0a = 0:

  • f(0)=0f(0) = 0
  • f(0)=cos(0)=1f'(0) = \cos(0) = 1
  • f(0)=sin(0)=0f''(0) = -\sin(0) = 0
  • f(0)=cos(0)=1f'''(0) = -\cos(0) = -1
  • f(4)(0)=sin(0)=0f^{(4)}(0) = \sin(0) = 0
  • The pattern repeats every 4 derivatives.

Plug into the Taylor formula:
sinx0+1x+0x22!+(1)x33!+0+x55!\sin x \approx 0 + 1 \cdot x + 0 \cdot \frac{x^2}{2!} + (-1)\frac{x^3}{3!} + 0 + \frac{x^5}{5!} - \dots
which simplifies to xx3/6+x5/120x - x^3/6 + x^5/120 - \dots. Same as the formula above.

Approximation in practice

For small xx near 0, even the first few terms are extremely accurate:

  • sin(0.1)0.10.001/60.09983\sin(0.1) \approx 0.1 - 0.001/6 \approx 0.09983 (true value: 0.09983340.0998334\dots).

This is why small-angle approximation sinxx\sin x \approx x is valid: the next term is tiny when xx is small.

Convergence — when does it actually equal ff?

Taylor series have a radius of convergence RR. For xa<R|x - a| < R the series equals f(x)f(x); outside it, the series diverges. Some functions (exe^x, sinx\sin x, cosx\cos x) have R=R = \infty. Others, like 1/(1x)1/(1-x) centred at 0, have R=1R = 1.

Common mistakes

  • Forgetting the factorial denominators n!n!.
  • Mixing up series expansions — sin has odd, cos has even, exe^x has all.
  • Assuming convergence without checking the radius.

Try with the AI Series Solver

Use the Series Calculator to compute Taylor expansions for any function — it shows the derivative steps, the resulting polynomial, and a numerical sanity check.

Related links:

AI-Math Editorial Team

作者: AI-Math Editorial Team

发布于 2026-05-01

A small team of engineers, mathematicians, and educators behind AI-Math, focused on making step-by-step math help accessible to every student.