Taylor Series

Approximating a function near a chosen center with polynomials built from its derivatives.

Taylor polynomials match a function near the center point
center a = 0sin xTaylor polynomial-3-2-10123
T5(x) = x - x3/3! + x5/5!
At x = 1, error is about 1.96e-4.
degree 5
Definition

A Taylor Series expands a function as an infinite polynomial centred at a point aa:

f(x)=βˆ‘n=0∞f(n)(a)n!(xβˆ’a)n=f(a)+fβ€²(a)(xβˆ’a)+fβ€²β€²(a)2!(xβˆ’a)2+fβ€²β€²β€²(a)3!(xβˆ’a)3+β‹―f(x) = \sum_{n=0}^{\infty} \frac{f^{(n)}(a)}{n!}(x - a)^n = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \frac{f'''(a)}{3!}(x-a)^3 + \cdots

When a=0a = 0, this is called a Maclaurin series.

The key insight: if you know all the derivatives of ff at one point, you know ff everywhere (in its radius of convergence).

Essential Maclaurin series to memorise: ex=βˆ‘n=0∞xnn!=1+x+x22!+x33!+β‹―(allΒ x)e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots \qquad (\text{all } x)

sin⁑x=βˆ‘n=0∞(βˆ’1)nx2n+1(2n+1)!=xβˆ’x33!+x55!βˆ’β‹―(allΒ x)\sin x = \sum_{n=0}^\infty \frac{(-1)^n x^{2n+1}}{(2n+1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots \qquad (\text{all } x)

cos⁑x=βˆ‘n=0∞(βˆ’1)nx2n(2n)!=1βˆ’x22!+x44!βˆ’β‹―(allΒ x)\cos x = \sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots \qquad (\text{all } x)

Maclaurin series for eΛ£

For f(x)=exf(x) = e^x, every derivative f(n)(x)=exf^{(n)}(x) = e^x, so f(n)(0)=1f^{(n)}(0) = 1 for all nn:

ex=βˆ‘n=0∞xnn!=1+x+x22+x36+x424+β‹―e^x = \sum_{n=0}^\infty \frac{x^n}{n!} = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \cdots

At x=1x = 1: e=1+1+12+16+124+β‹―β‰ˆ2.71828…e = 1 + 1 + \frac{1}{2} + \frac{1}{6} + \frac{1}{24} + \cdots \approx 2.71828\ldots

Try it

Write the first four non-zero terms of the Maclaurin series for cos⁑x\cos x. Use it to approximate cos⁑(0.1)\cos(0.1).

Solution

cos⁑x=1βˆ’x22!+x44!βˆ’x66!+β‹―\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots

At x=0.1x = 0.1: cos⁑(0.1)β‰ˆ1βˆ’0.012+0.000124=1βˆ’0.005+0.00000417β‰ˆ0.99500\cos(0.1) \approx 1 - \frac{0.01}{2} + \frac{0.0001}{24} = 1 - 0.005 + 0.00000417 \approx 0.99500

The exact value is cos⁑(0.1)β‰ˆ0.99500\cos(0.1) \approx 0.99500 β€” excellent accuracy with just three terms.

Related concepts