Skip to content

Applications of Taylor Series

In this lesson you’ll see Taylor series in action: approximating function values, estimating errors, and understanding why these approximations work so well in practice.

The nth-degree Taylor polynomial centered at a is the first n + 1 terms of the Taylor series

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

This is your approximation. The more terms you keep, the better it matches f(x) near the center.

The error when using the polynomial instead of the actual function is bounded by the Lagrange remainder

Rn(x)=f(n+1)(c)(n+1)!(xa)n+1R_n(x) = \frac{f^{(n+1)}(c)}{(n+1)!}(x - a)^{n+1}

for some c between a and x. You don’t know exactly what c is, but you can bound the (n+1)th derivative on the interval to get a worst-case error estimate.

The key insight: the (n+1) factorial in the denominator grows extremely fast, which is why Taylor approximations get accurate so quickly with just a few terms.

Example 1: Approximating e

Use the Maclaurin series for e to the x to approximate e (that is, evaluate at x = 1) using terms up to degree 4.

eP4(1)=1+1+12!+13!+14!e \approx P_4(1) = 1 + 1 + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} =1+1+0.5+0.16667+0.04167=2.70833= 1 + 1 + 0.5 + 0.16667 + 0.04167 = 2.70833

The actual value is e = 2.71828…, so the error is about 0.01. Not bad for just 5 terms.

We can bound the error using the remainder. The 5th derivative of e to the x is still e to the x, and on [0, 1] the maximum is e itself (less than 3)

R4(1)35!15=3120=0.025|R_4(1)| \leq \frac{3}{5!} \cdot 1^5 = \frac{3}{120} = 0.025

The actual error (0.00995) is well within this bound.

Each curve shows how the error grows as you move away from x = 0. Higher-degree polynomials (green, blue) keep the error tiny over a much wider range. Near x = 0, all approximations are excellent.

Example 2: Approximating sin(0.1)

Use the Maclaurin series for sin x with the first two nonzero terms

sinxxx33!=xx36\sin x \approx x - \frac{x^3}{3!} = x - \frac{x^3}{6}

At x = 0.1

sin(0.1)0.1(0.1)36=0.10.0016=0.10.000167=0.099833\sin(0.1) \approx 0.1 - \frac{(0.1)^3}{6} = 0.1 - \frac{0.001}{6} = 0.1 - 0.000167 = 0.099833

The actual value is 0.0998334…, so the error is less than 0.0000004. For small x, even two terms give extraordinary accuracy because the next term involves x to the 5th, which is (0.1)⁵ = 0.00001, divided by 120.

Example 3: Approximating square root of 1.1

Use the Taylor polynomial for f(x) = sqrt(x) centered at x = 1, degree 2.

The derivatives at x = 1

f(1)=1f(1)=12f(1)=14f(1) = 1 \qquad f'(1) = \frac{1}{2} \qquad f''(1) = -\frac{1}{4}

The degree-2 polynomial is

P2(x)=1+12(x1)+1/42!(x1)2=1+12(x1)18(x1)2P_2(x) = 1 + \frac{1}{2}(x - 1) + \frac{-1/4}{2!}(x - 1)^2 = 1 + \frac{1}{2}(x - 1) - \frac{1}{8}(x - 1)^2

At x = 1.1

P2(1.1)=1+12(0.1)18(0.01)=1+0.050.00125=1.04875P_2(1.1) = 1 + \frac{1}{2}(0.1) - \frac{1}{8}(0.01) = 1 + 0.05 - 0.00125 = 1.04875

The actual value is sqrt(1.1) = 1.04881…, so the error is about 0.00006. The third derivative of sqrt(x) is 3/(8x^(5/2)), which at x = 1 gives 3/8. The remainder bound is

R23/83!(0.1)3=0.3756(0.001)=0.0000625|R_2| \leq \frac{3/8}{3!}(0.1)^3 = \frac{0.375}{6}(0.001) = 0.0000625

The actual error fits within this bound.

Taylor approximations are used constantly in computing:

  • Game engines approximate sin, cos, and exp with degree-3 or degree-5 polynomials for speed
  • Physics simulations linearize equations near equilibrium using degree-1 Taylor polynomials
  • Machine learning uses Taylor expansions to analyze how loss functions behave near optima
  • Financial models approximate option pricing formulas with polynomial expansions
  • Scientific computing uses error bounds to determine how many terms are needed for a given precision
Using 5 terms of the Maclaurin series for $e^x$ at $x = 1$ gives approximately
The Lagrange remainder helps you
For small x, the approximation $\sin x \approx x$ is accurate because
Adding more terms to a Taylor polynomial
The factorial in the remainder denominator means the error