Unit 7, lesson 107

Definition of Taylor and Maclaurin Series

What the Taylor series of a function is, what makes a function analytic, why a smooth function can fail to equal its series, and the standard exponential, trigonometric, logarithmic and geometric series.

  • Theory part 213
  • Practice part 214
  • Taylor and Maclaurin Series

Taylor polynomials get better as their degree grows, so it is natural to let the degree run forever. The result is a power series built entirely from the derivatives of ff at one point. For exe^x, sin⁡x\sin x and cos⁡x\cos x that series reproduces the function everywhere. For other functions it works only nearby, and for a few strange ones it fails everywhere except the center.

Key terms

Taylor and Maclaurin series

Definition Let ff have derivatives of all orders at aa. The Taylor series of ff at aa is the power series

∑n=0∞f(n)(a)n!(x−a)n=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯ .\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 + \cdots.

The Taylor series at a=0a = 0 is called the Maclaurin series. Its partial sums are the Taylor polynomials Tn(x)T_n(x). Writing down the series says nothing yet about where it converges, or whether its sum equals f(x)f(x).

In plain words It is the Taylor polynomial with no last term. Each coefficient comes from one derivative of ff at the center.

Example Take f(x)=1xf(x) = \frac{1}{x} at a=1a = 1. Its derivatives are f(n)(x)=(−1)nn! x−n−1f^{(n)}(x) = (-1)^n n! \, x^{-n-1}, so

f(n)(1)n!=(−1)n\frac{f^{(n)}(1)}{n!} = (-1)^n

and the Taylor series is

∑n=0∞(−1)n(x−1)n=1−(x−1)+(x−1)2−⋯ .\sum_{n=0}^{\infty} (-1)^n (x - 1)^n = 1 - (x - 1) + (x - 1)^2 - \cdots.

It is geometric with ratio −(x−1)-(x - 1), so it converges for ∣x−1∣<1\lvert x - 1 \rvert < 1, and there its sum is

11+(x−1)=1x.\frac{1}{1 + (x - 1)} = \frac{1}{x}.

Analytic function

Definition A function ff defined on an open interval II is analytic at a point a∈Ia \in I if there are a number r>0r > 0 with (a−r,a+r)⊆I(a - r, a + r) \subseteq I and real coefficients cnc_n such that

f(x)=∑n=0∞cn(x−a)nfor all x with ∣x−a∣<r.f(x) = \sum_{n=0}^{\infty} c_n (x - a)^n \qquad \text{for all } x \text{ with } \lvert x - a \rvert < r.

It is analytic on II if it is analytic at every point of II. When this happens ff has derivatives of all orders at aa and the coefficients are forced to be

cn=f(n)(a)n!,c_n = \frac{f^{(n)}(a)}{n!},

so the series is the Taylor series of ff at aa. For the exponential and trigonometric expansions below, equality with the function is proved with the remainder estimates of Taylor’s theorem. The geometric expansion follows from the geometric series, and the logarithmic one by integrating it.

In plain words A function is analytic at aa when its Taylor series at aa actually adds up to the function on some interval around aa.

Example Polynomials, exe^x, sin⁡x\sin x and cos⁡x\cos x are analytic on all of R\mathbb{R}. The function 1x\frac{1}{x} is analytic at 11 with r=1r = 1, as shown above, and in fact at every a≠0a \neq 0.

Smooth does not imply analytic

Definition A function is smooth, or of class C∞C^\infty, on an interval if it has derivatives of all orders there. Every analytic function is smooth, but not every smooth function is analytic. The standard example is

f(x)={e−1/x2,x≠0,0,x=0.f(x) = \begin{cases} e^{-1/x^2}, & x \neq 0, \\ 0, & x = 0. \end{cases}

This ff is smooth on R\mathbb{R} and f(n)(0)=0f^{(n)}(0) = 0 for every nn. Its Maclaurin series is therefore the zero series, which converges for every xx but equals f(x)f(x) only at x=0x = 0, since f(x)>0f(x) > 0 for x≠0x \neq 0.

In plain words A function can be so flat at a point that every derivative there is zero, and still not be the zero function. Its Taylor series then sees nothing.

Example The values near 00 are tiny, which is why all derivatives vanish there.

xxe−1/x2e^{-1/x^2}
0.50.50.01830.0183
0.20.21.4×10−111.4 \times 10^{-11}
0.10.13.7×10−443.7 \times 10^{-44}

Yet f(0.5)≠0f(0.5) \neq 0, while the Maclaurin series gives 00 at x=0.5x = 0.5.

Exponential expansion

Definition For every real xx,

ex=∑n=0∞xnn!=1+x+x22!+x33!+⋯ ,e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots,

and the radius of convergence is R=∞R = \infty.

In plain words All derivatives of exe^x at 00 equal 11, so the coefficients are 1n!\frac{1}{n!}, and the factorials shrink the terms fast enough to converge for any xx.

Example At x=1x = 1 the partial sums 11, 22, 2.52.5, 2.66672.6667, 2.70832.7083, 2.71672.7167 approach e=2.71828…e = 2.71828\ldots.

Trigonometric expansions

Definition For every real xx, with xx in radians,

sin⁡x=∑n=0∞(−1)nx2n+1(2n+1)!=x−x33!+x55!−⋯ ,\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n + 1)!} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots,cos⁡x=∑n=0∞(−1)nx2n(2n)!=1−x22!+x44!−⋯ .\cos x = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots.

Both have R=∞R = \infty.

In plain words The derivatives of sin⁡\sin at 00 cycle through 0,1,0,−10, 1, 0, -1. So sin⁡x\sin x keeps only the odd powers with alternating signs, and cos⁡x\cos x keeps only the even ones.

Example Two terms already give

sin⁡0.1≈0.1−0.0016=0.0998333,\sin 0.1 \approx 0.1 - \frac{0.001}{6} = 0.0998333,

and the true value is sin⁡0.1=0.0998334…\sin 0.1 = 0.0998334\ldots.

Logarithmic expansion

Definition For −1<x≤1-1 < x \le 1,

ln⁡(1+x)=∑n=1∞(−1)n−1xnn=x−x22+x33−⋯ .\ln(1 + x) = \sum_{n=1}^{\infty} \frac{(-1)^{n-1} x^n}{n} = x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots.

The radius is R=1R = 1. The series converges at x=1x = 1 and diverges at x=−1x = -1. There is no Maclaurin series of ln⁡x\ln x itself, since ln⁡x\ln x is not defined at 00.

In plain words Shift the logarithm so the center sits at a point where it is defined. The series only reaches as far as x=1x = 1.

Example Four terms give

ln⁡1.2≈0.2−0.02+0.0026667−0.0004=0.1822667,\ln 1.2 \approx 0.2 - 0.02 + 0.0026667 - 0.0004 = 0.1822667,

compared with ln⁡1.2=0.1823216…\ln 1.2 = 0.1823216\ldots. The Taylor polynomial explorer shows the same comparison for ln⁡(1+x)\ln(1 + x) with degree 44 and x=0.2x = 0.2. At x=1.5x = 1.5, outside the interval of convergence, the polynomials pull away from the curve as the degree grows.

Geometric expansion

Definition For ∣x∣<1\lvert x \rvert < 1,

11−x=∑n=0∞xn=1+x+x2+⋯ ,\frac{1}{1 - x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + \cdots,

and the series diverges for ∣x∣≥1\lvert x \rvert \ge 1. This is the Maclaurin series of 11−x\frac{1}{1 - x}, since its nnth derivative at 00 is n!n!.

In plain words The geometric series is a Taylor series too, and many other expansions come from it by substitution, differentiation or integration.

Example At x=0.1x = 0.1 the series gives 1.1111…=109=10.91.1111\ldots = \frac{10}{9} = \frac{1}{0.9}. At x=2x = 2 the function equals −1-1, but the series diverges. The function exists where the series does not converge.

Check yourself

  1. Write the Taylor series of exe^x at a=2a = 2.
Show the answer

Every derivative at 22 is e2e^2, so the series is

∑n=0∞e2n!(x−2)n.\sum_{n=0}^{\infty} \frac{e^2}{n!} (x - 2)^n.

It converges to exe^x for every real xx.

  1. Use three terms of the logarithmic series to estimate ln⁡1.1\ln 1.1.
Show the answer

Three terms give

0.1−0.012+0.0013=0.0953333,0.1 - \frac{0.01}{2} + \frac{0.001}{3} = 0.0953333,

while ln⁡1.1=0.0953102…\ln 1.1 = 0.0953102\ldots.

  1. Why is the Maclaurin series of e−1/x2e^{-1/x^2} (with value 00 at 00) not useful for computing the function?
Show the answer

All its coefficients are 00, so it sums to 00 for every xx, while the function is positive for every x≠0x \neq 0. The function is smooth but not analytic at 00.

How this lesson connects

Resources for this lesson