Unit 7, lesson 109

Applications of Taylor and Maclaurin Series

How Taylor series approximate values, settle indeterminate limits, compute integrals with no elementary antiderivative, estimate their own error and justify the small angle approximations used in physics.

  • Theory part 217
  • Practice part 218
  • Taylor and Maclaurin Series

Nobody can write the integral

∫00.5e−t2 dt\int_0^{0.5} e^{-t^2} \, dt

in terms of familiar functions, yet a handful of terms of a series give it to five decimal places. The same series explain why sin⁡θ≈θ\sin \theta \approx \theta is good enough for a swinging pendulum, and they turn many hard limits into one line of algebra. In each case the method replaces a function by a polynomial and keeps track of what was thrown away.

Key terms

Polynomial approximation

Definition If ff is of class Cn+1C^{n+1} on an open interval containing aa, then near aa we approximate f(x)≈Tn(x)f(x) \approx T_n(x), the Taylor polynomial of degree nn. By Taylor’s theorem there are C>0C > 0 and δ>0\delta > 0 with

∣f(x)−Tn(x)∣≤C∣x−a∣n+1for ∣x−a∣<δ.\lvert f(x) - T_n(x) \rvert \le C \lvert x - a \rvert^{n+1} \qquad \text{for } \lvert x - a \rvert < \delta.

In plain words Close to the center, a Taylor polynomial is an excellent stand-in for the function, and its error shrinks like a power of the distance.

Example Use cos⁡x≈1−x22+x424\cos x \approx 1 - \frac{x^2}{2} + \frac{x^4}{24} at x=0.2x = 0.2. It gives

1−0.02+0.0000667=0.9800667,1 - 0.02 + 0.0000667 = 0.9800667,

while cos⁡0.2=0.9800666…\cos 0.2 = 0.9800666\ldots.

Scale of neglected terms

Definition Write g(x)=O(h(x))g(x) = O\bigl(h(x)\bigr) as x→ax \to a if there are constants C>0C > 0 and δ>0\delta > 0 with ∣g(x)∣≤C∣h(x)∣\lvert g(x) \rvert \le C \lvert h(x) \rvert for 0<∣x−a∣<δ0 < \lvert x - a \rvert < \delta. With this notation the polynomial approximation above reads

f(x)=Tn(x)+O((x−a)n+1)as x→a.f(x) = T_n(x) + O\bigl((x - a)^{n+1}\bigr) \quad \text{as } x \to a.

For a convergent power series the tail after the term in (x−a)n(x - a)^n is O((x−a)n+1)O\bigl((x - a)^{n+1}\bigr) as x→ax \to a.

In plain words The part you drop has roughly the size of the first term you dropped. Halving xx cuts an O(x3)O(x^3) error by about a factor of 88.

Example As x→0x \to 0,

sin⁡x=x−x36+O(x5),\sin x = x - \frac{x^3}{6} + O(x^5),

so the error of sin⁡x≈x\sin x \approx x is close to −x36-\frac{x^3}{6}.

xxsin⁡x−x\sin x - x−x36-\frac{x^3}{6}
0.40.4−0.010582-0.010582−0.010667-0.010667
0.20.2−0.001331-0.001331−0.001333-0.001333
0.10.1−0.000167-0.000167−0.000167-0.000167

Limits of indeterminate forms

Definition Suppose that as x→ax \to a,

f(x)=c (x−a)m+O((x−a)m+1),g(x)=d (x−a)m+O((x−a)m+1),f(x) = c\,(x - a)^m + O\bigl((x - a)^{m+1}\bigr), \qquad g(x) = d\,(x - a)^m + O\bigl((x - a)^{m+1}\bigr),

with d≠0d \neq 0. Then

lim⁡x→af(x)g(x)=cd.\lim_{x \to a} \frac{f(x)}{g(x)} = \frac{c}{d}.

To use this, expand numerator and denominator until the first nonzero terms appear, divide by the common power, and let x→ax \to a.

In plain words Expand both top and bottom, cancel what cancels, and the leading terms decide the limit.

Example Since sin⁡x−x=−x36+O(x5)\sin x - x = -\frac{x^3}{6} + O(x^5),

lim⁡x→0sin⁡x−xx3=lim⁡x→0(−16+O(x2))=−16.\lim_{x \to 0} \frac{\sin x - x}{x^3} = \lim_{x \to 0} \left(-\frac{1}{6} + O(x^2)\right) = -\frac{1}{6}.

Applying l’Hôpital’s rule would take three rounds of differentiation.

Functions defined by integrals

Definition If f(t)=∑cn(t−a)nf(t) = \sum c_n (t - a)^n for ∣t−a∣<R\lvert t - a \rvert < R, then for every xx with ∣x−a∣<R\lvert x - a \rvert < R

∫axf(t) dt=∑n=0∞cn(x−a)n+1n+1,\int_a^x f(t) \, dt = \sum_{n=0}^{\infty} c_n \frac{(x - a)^{n+1}}{n + 1},

by term-by-term integration. This gives power series for functions defined as integrals whose integrands have no elementary antiderivative.

In plain words Expand the integrand, integrate each power, and you have a series for the integral.

Example From e−t2=∑(−1)nt2nn!e^{-t^2} = \sum \frac{(-1)^n t^{2n}}{n!}, valid for all tt,

∫0xe−t2 dt=∑n=0∞(−1)nx2n+1(2n+1) n!=x−x33+x510−x742+⋯\int_0^x e^{-t^2} \, dt = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n + 1) \, n!} = x - \frac{x^3}{3} + \frac{x^5}{10} - \frac{x^7}{42} + \cdots

for every real xx. At x=0.5x = 0.5 these four terms give

0.5−0.0416667+0.003125−0.0001860=0.4612723.0.5 - 0.0416667 + 0.003125 - 0.0001860 = 0.4612723.

Error estimates

Definition Two standard bounds control the error of a truncated series. If the series is alternating, with terms whose absolute values decrease to 00, the error is at most the absolute value of the first omitted term and has its sign. In general, when ff is n+1n + 1 times differentiable and ∣f(n+1)∣≤M\lvert f^{(n+1)} \rvert \le M on the closed interval between aa and xx, Taylor’s inequality bounds the error of Tn(x)T_n(x) by

∣f(x)−Tn(x)∣≤M(n+1)!∣x−a∣n+1.\lvert f(x) - T_n(x) \rvert \le \frac{M}{(n + 1)!} \lvert x - a \rvert^{n+1}.

In plain words Always pair an approximation with a guaranteed bound on how wrong it can be.

Example The series for the integral of e−t2e^{-t^2} from 00 to 0.50.5 is alternating, with terms that decrease to 00. The first omitted term is

0.599⋅4!≈9.04×10−6,\frac{0.5^9}{9 \cdot 4!} \approx 9.04 \times 10^{-6},

so

0.4612723<∫00.5e−t2 dt<0.4612723+0.0000091.0.4612723 < \int_0^{0.5} e^{-t^2} \, dt < 0.4612723 + 0.0000091.

The true value is 0.4612810…0.4612810\ldots, an error of 8.7×10−68.7 \times 10^{-6}.

Asymptotic expansions

Definition A sequence of coefficients c0,c1,c2,…c_0, c_1, c_2, \ldots gives an asymptotic expansion of ff as x→ax \to a, written f(x)∼∑ck(x−a)kf(x) \sim \sum c_k (x - a)^k, if for every N≥0N \ge 0

f(x)−∑k=0Nck(x−a)k=O((x−a)N+1)as x→a.f(x) - \sum_{k=0}^{N} c_k (x - a)^k = O\bigl((x - a)^{N+1}\bigr) \quad \text{as } x \to a.

Expansions as x→∞x \to \infty are defined in the same way with powers of 1x\frac{1}{x}. The series need not converge, and even when it converges it need not equal ff. What matters is that each truncation is accurate to the stated order.

In plain words An asymptotic expansion promises that each extra term makes the approximation better as you get close to the limit point, not that the full series adds up to ff.

Example For large x>0x > 0, writing x2+1=x1+x−2\sqrt{x^2 + 1} = x \sqrt{1 + x^{-2}} and expanding gives

x2+1=x+12x−18x3+O(1x5)as x→∞.\sqrt{x^2 + 1} = x + \frac{1}{2x} - \frac{1}{8x^3} + O\left(\frac{1}{x^5}\right) \quad \text{as } x \to \infty.

At x=10x = 10 the two leading correction terms give

120−18000=0.049875,\frac{1}{20} - \frac{1}{8000} = 0.049875,

while 101−10=0.0498756…\sqrt{101} - 10 = 0.0498756\ldots.

Applications to physics

Definition Physical formulas are often replaced by the leading terms of their Taylor series when a variable is small. For an ideal pendulum of length LL, with the angle θ\theta in radians and gg the acceleration due to gravity, the motion obeys

θ′′=−gLsin⁡θ.\theta'' = -\frac{g}{L} \sin \theta.

Using sin⁡θ=θ+O(θ3)\sin \theta = \theta + O(\theta^3) gives the small angle model

θ′′=−gLθ.\theta'' = -\frac{g}{L} \theta.

For 0<θ≤π20 < \theta \le \frac{\pi}{2} the Lagrange remainder of T2(θ)=θT_2(\theta) = \theta gives

θ−sin⁡θ=cos⁡z6θ3\theta - \sin \theta = \frac{\cos z}{6} \theta^3

for some zz between 00 and θ\theta, and 0<cos⁡z<10 < \cos z < 1 there, so

0≤θ−sin⁡θ≤θ36,0 \le \theta - \sin \theta \le \frac{\theta^3}{6},

and the error of replacing sin⁡θ\sin \theta by θ\theta, as a fraction of θ\theta, is at most θ26\frac{\theta^2}{6}.

In plain words For small swings the restoring force is almost exactly proportional to the angle, and the series says how small is small enough.

Example At θ=0.2\theta = 0.2 radians, about 11.511.5 degrees, sin⁡0.2=0.198669\sin 0.2 = 0.198669. As a fraction of θ\theta the error is

0.2−0.1986690.2≈0.00665,\frac{0.2 - 0.198669}{0.2} \approx 0.00665,

just within the bound 0.046≈0.00667\frac{0.04}{6} \approx 0.00667. That is under one percent, which is why the small angle model works so well for gentle swings.

Check yourself

  1. Use series to find lim⁡x→0ex−1−xx2\lim_{x \to 0} \frac{e^x - 1 - x}{x^2}.
Show the answer

The exponential series gives

ex−1−x=x22+O(x3),e^x - 1 - x = \frac{x^2}{2} + O(x^3),

so the quotient is 12+O(x)\frac{1}{2} + O(x) and the limit is 12\frac{1}{2}.

  1. Estimate ∫01sin⁡(x2) dx\int_0^1 \sin(x^2) \, dx with two terms of a series and bound the error.
Show the answer

Substituting x2x^2 into the sine series gives

sin⁡(x2)=x2−x66+x10120−⋯ ,\sin(x^2) = x^2 - \frac{x^6}{6} + \frac{x^{10}}{120} - \cdots,

so the integral is

∫01sin⁡(x2) dx=13−142+11320−⋯ .\int_0^1 \sin(x^2) \, dx = \frac{1}{3} - \frac{1}{42} + \frac{1}{1320} - \cdots.

Two terms give 0.3095240.309524. The series alternates with decreasing terms, so the error is at most 11320≈0.00076\frac{1}{1320} \approx 0.00076. The true value is 0.3102680.310268.

  1. For which x≥0x \ge 0 does sin⁡x≈x\sin x \approx x have error less than 0.0010.001, according to the alternating series bound?
Show the answer

The error is at most x36\frac{x^3}{6}, and x36<0.001\frac{x^3}{6} < 0.001 when x3<0.006x^3 < 0.006, that is x<0.1817x < 0.1817 approximately.

How this lesson connects

It also uses approximation error.

Resources for this lesson