Taylor and Maclaurin series

Level UniversityDifficulty ★★★★★Concept⌖ Open in the map

What is it?

Let the order go to infinity: f(x)=∑k≥0f(k)(a)k!(x−a)kf(x) = \sum_{k\ge0}\frac{f^{(k)}(a)}{k!}(x - a)^k whenever the remainder tends to 0. Functions equal to their Taylor series are called analytic; exe^x, sin⁡\sin, cos⁡\cos are, on all of ℝ\R.

Why does it exist?

A Taylor series packs a whole function into one sequence of numbers (its coefficients). That turns analysis into algebra: solving differential equations, evaluating integrals with no closed form, defining eAe^A for a matrix AA or eiθe^{i\theta} for a complex number.

Intuition

Knowing everything about ff at a single point — all its derivatives — is, for analytic functions, knowing ff everywhere within the radius of convergence. Not every smooth function is analytic: e−1/x2e^{-1/x^2} (extended by 0) has all derivatives zero at 0, so its Taylor series is 00, yet the function is not.

Formulas

ex=∑k=0∞xkk!,sin⁡x=∑k=0∞(−1)kx2k+1(2k+1)!,cos⁡x=∑k=0∞(−1)kx2k(2k)!e^x = \sum_{k=0}^\infty \frac{x^k}{k!}, \quad \sin x = \sum_{k=0}^\infty \frac{(-1)^k x^{2k+1}}{(2k+1)!}, \quad \cos x = \sum_{k=0}^\infty \frac{(-1)^k x^{2k}}{(2k)!}
ln⁡(1+x)=∑k=1∞(−1)k+1xkk(−1<x≤1)\ln(1 + x) = \sum_{k=1}^{\infty}\frac{(-1)^{k+1}x^k}{k} \quad (-1 < x \le 1)
eiθ=∑k(iθ)kk!=cos⁡θ+isin⁡θe^{i\theta} = \sum_k \frac{(i\theta)^k}{k!} = \cos\theta + i\sin\theta
Euler's formula falls out of the series

Example

∫01e−x2 dx\int_0^1 e^{-x^2}\,\dd x has no elementary antiderivative, but term-by-term integration of e−x2=∑(−1)kx2k/k!e^{-x^2} = \sum (-1)^k x^{2k}/k! gives ∑k(−1)kk!(2k+1)=1−13+110−142+⋯≈0.746824\sum_k \frac{(-1)^k}{k!(2k+1)} = 1 - \frac13 + \frac1{10} - \frac1{42} + \dots \approx 0.746824 — the core of the Gaussian error function erf.

Why does it matter?

Series let a computer evaluate transcendental functions, let a CAS manipulate them, and let physicists and engineers build perturbation methods. The matrix exponential eAte^{At} — the solution of every linear ODE system and of every quantum gate e−iHte^{-iHt} — is defined by its series.

Where it shows up in computing

  • Symbolic computation (CAS)★★★★★frequentScientific computing and algorithms

    CAS compute series expansions (series(f, x, 0, n)) to simplify, take limits and approximate.

  • Scientific computing★★★★★frequentScientific computing and algorithms

    Special functions (erf, Bessel) are evaluated with series near 0 and asymptotic expansions far away.

  • Quantum computing★★★★★advancedQuantum computing and physics

    Gates are e−iHte^{-iHt}, matrix exponentials defined by their power series.

Where is it used?

Computing topics reachable from here, through the chain of ideas that leads to them:

Exercises

1Computation

Derive the Maclaurin series of arctan⁡x\arctan x from 11+x2\frac{1}{1 + x^2} and use it to write a series for π\pi.

Solution

11+x2=∑(−1)kx2k\frac{1}{1+x^2} = \sum (-1)^k x^{2k}; integrate: arctan⁡x=∑(−1)kx2k+12k+1\arctan x = \sum\frac{(-1)^k x^{2k+1}}{2k+1}. At x=1x = 1: π4=1−13+15−…\frac\pi4 = 1 - \frac13 + \frac15 - \dots (Leibniz; very slow).

↑ ↓ to navigate · ↵ · Esc