MAT1052 · Week 5 · Power Series, Taylor Series

Power series and Taylor series

You learn to find the radius and interval of convergence of a power series (endpoints included), to derive new series from the geometric series, and to write the Taylor/Maclaurin series of a function.

power seriescenterradius of convergenceinterval of convergenceendpointterm-by-term differentiationterm-by-term integrationTaylor seriesMaclaurin seriesTaylor polynomial

So far we dealt with number series. This week we add xx to the terms: a series like ∑cnxn\sum c_nx^n is a separate number series for each value of xx. It converges for some xx and diverges for others. The set of xx where it converges is always an interval, and finding this interval is the most dependable question on the exam. In the second half we do the opposite: we write a given function (exe^x, sin⁡x\sin x, ln⁡(1+x)\ln(1+x)) as an infinite polynomial. This is also the basis of how calculators and programming languages compute Math.sin.

Golden rules:

  1. For the radius, apply the ratio test (sometimes the root test), and keep ∣x−a∣\lvert x-a\rvert outside.
  2. The endpoints are always checked separately. The ratio test gives L=1L=1 there and does not decide.
  3. Derive from a known series: substitute, multiply, differentiate, integrate. Much faster than computing from scratch with derivatives.
  4. The Taylor coefficient is cn=f(n)(a)n!c_n = \dfrac{f^{(n)}(a)}{n!}. You also use it backwards: from the coefficient to the derivative.

Power series and the radius of convergence

Definition. A power series centered at aa:

∑n=0∞cn(x−a)n=c0+c1(x−a)+c2(x−a)2+…\sum_{n=0}^{\infty}c_n(x-a)^n = c_0+c_1(x-a)+c_2(x-a)^2+\dots

Theorem. For every power series one of these three cases holds:

  1. It converges only at x=ax=a (R=0R=0).
  2. It converges for every xx (R=∞R=\infty).
  3. There is an R>0R>0: for ∣x−a∣<R\lvert x-a\rvert<R it converges absolutely, for ∣x−a∣>R\lvert x-a\rvert>R it diverges. For ∣x−a∣=R\lvert x-a\rvert = R (the endpoints) the theorem says nothing.

RR is called the radius of convergence, and the interval of xx where it converges is called the interval of convergence.

Template for finding the interval

1) Ratio test: L(x) = lim |a_(n+1)/a_n|   (a_n is the WHOLE term, x included)
2) Solve L(x) < 1  →  |x - a| < R
3) Plug x = a - R and x = a + R into the series; test the resulting NUMBER series
4) Write the interval: ends with [ or ( as appropriate

Example 1. ∑n=1∞(x−3)nn 2n\displaystyle\sum_{n=1}^\infty\frac{(x-3)^n}{n\,2^n}.

∣an+1an∣=∣x−3∣n+1(n+1)2n+1⋅n 2n∣x−3∣n=∣x−3∣2⋅nn+1→∣x−3∣2.\left\lvert\frac{a_{n+1}}{a_n}\right\rvert = \frac{\lvert x-3\rvert^{n+1}}{(n+1)2^{n+1}}\cdot\frac{n\,2^n}{\lvert x-3\rvert^n} = \frac{\lvert x-3\rvert}{2}\cdot\frac{n}{n+1}\to\frac{\lvert x-3\rvert}{2}.

∣x−3∣<2\lvert x-3\rvert<2, that is, 1<x<51<x<5, R=2R = 2.

  • x=5x=5: ∑2nn2n=∑1n\sum\dfrac{2^n}{n2^n} = \sum\dfrac1n, diverges.
  • x=1x=1: ∑(−2)nn2n=∑(−1)nn\sum\dfrac{(-2)^n}{n2^n} = \sum\dfrac{(-1)^n}{n}, converges by the alternating test.

Interval: [1,5)[1,5).

Example 2. ∑xnn!\sum\dfrac{x^n}{n!}: the ratio is ∣x∣n+1→0\dfrac{\lvert x\rvert}{n+1}\to0, for every xx. R=∞R=\infty.

Example 3. ∑n! xn\sum n!\,x^n: the ratio is (n+1)∣x∣→∞(n+1)\lvert x\rvert\to\infty (x≠0x\neq0). R=0R=0.

Example 4. ∑n=0∞(−1)nx2n4n\displaystyle\sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{4^n}. There are only even powers; apply the ratio test to the whole term: x24<1\dfrac{x^2}{4}<1, that is, ∣x∣<2\lvert x\rvert<2. At the endpoints x2=4x^2 = 4, the terms are (−1)n(-1)^n, diverges. The interval is (−2,2)(-2,2). In fact this is a geometric series with ratio −x2/4-x^2/4, with sum 11+x2/4\dfrac{1}{1+x^2/4}.

PITFALL · xx with a coefficient. If you see (2x+1)n(2x+1)^n or (3x−6)n(3x-6)^n, the center and radius cannot be read off directly. Solve the inequality ∣2x+1∣<1\lvert2x+1\rvert<1 for xx: −1<x<0-1<x<0. The center is −12-\frac12, R=12R = \frac12. Writing "R=1R=1" is a common mistake.

Writing functions as power series

The main source is the geometric series:

11−x=∑n=0∞xn,∣x∣<1.\frac{1}{1-x} = \sum_{n=0}^\infty x^n,\qquad\lvert x\rvert<1.

Substitution. Replace xx with −x2-x^2: 11+x2=∑(−1)nx2n\dfrac{1}{1+x^2} = \sum(-1)^nx^{2n}, ∣x∣<1\lvert x\rvert<1.

Changing the center. Write 1x\dfrac1x around a=2a=2: 1x=12+(x−2)=12⋅11+x−22=∑n=0∞(−1)n(x−2)n2n+1\dfrac1x = \dfrac{1}{2+(x-2)} = \dfrac12\cdot\dfrac{1}{1+\frac{x-2}{2}} = \sum_{n=0}^\infty\dfrac{(-1)^n(x-2)^n}{2^{n+1}}, ∣x−2∣<2\lvert x-2\rvert<2.

Term-by-term differentiation and integration. Inside the interval of convergence, the derivative and integral of a power series can be taken term by term and the radius does not change (the endpoints may).

  • Integrate 11+x\dfrac{1}{1+x}: ln⁡(1+x)=∑n=1∞(−1)n+1xnn\ln(1+x) = \sum_{n=1}^\infty\dfrac{(-1)^{n+1}x^n}{n}, −1<x≤1-1<x\le1.
  • Integrate 11+x2\dfrac{1}{1+x^2}: arctan⁡x=∑n=0∞(−1)nx2n+12n+1\arctan x = \sum_{n=0}^\infty\dfrac{(-1)^nx^{2n+1}}{2n+1}, −1≤x≤1-1\le x\le1.
  • The derivative of 11−x\dfrac{1}{1-x}: 1(1−x)2=∑n=1∞nxn−1\dfrac{1}{(1-x)^2} = \sum_{n=1}^\infty nx^{n-1}.

After integrating, do not forget the constant: determine it by plugging in x=0x=0. Since ln⁡(1+0)=0\ln(1+0) = 0, the constant is 00.

Taylor and Maclaurin series

Definition. If ff is differentiable to every order near aa, the Taylor series of ff centered at aa is:

∑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+\dots

If a=0a=0 it is called the Maclaurin series. The sum of the first n+1n+1 terms is called the Taylor polynomial of degree nn, Pn(x)P_n(x).

Intuition. PnP_n is the unique polynomial of degree nn that shares with ff at the point aa the same value, the same slope, the same curvature (everything up to the nnth derivative). As the degree increases, it hugs ff better near aa.

Maclaurin series to memorize

FunctionSeriesInterval
11−x\dfrac{1}{1-x}∑xn\sum x^n(−1,1)(-1,1)
exe^x∑xnn!\sum\dfrac{x^n}{n!}R\mathbb{R}
sin⁡x\sin x∑(−1)nx2n+1(2n+1)!\sum\dfrac{(-1)^nx^{2n+1}}{(2n+1)!}R\mathbb{R}
cos⁡x\cos x∑(−1)nx2n(2n)!\sum\dfrac{(-1)^nx^{2n}}{(2n)!}R\mathbb{R}
ln⁡(1+x)\ln(1+x)∑n≥1(−1)n+1xnn\sum_{n\ge1}\dfrac{(-1)^{n+1}x^n}{n}(−1,1](-1,1]
arctan⁡x\arctan x∑(−1)nx2n+12n+1\sum\dfrac{(-1)^nx^{2n+1}}{2n+1}[−1,1][-1,1]

sin⁡\sin is an odd function, and its series has only odd powers. cos⁡\cos is even, with only even powers. This is a checking tool.

Example 5 (Taylor from the definition). f(x)=ln⁡xf(x) = \ln x, a=1a=1. f(1)=0f(1) = 0, f′=x−1f' = x^{-1}, f′′=−x−2f'' = -x^{-2}, f′′′=2x−3f''' = 2x^{-3}, and in general f(n)(x)=(−1)n+1(n−1)! x−nf^{(n)}(x) = (-1)^{n+1}(n-1)!\,x^{-n}. At a=1a=1, f(n)(1)=(−1)n+1(n−1)!f^{(n)}(1) = (-1)^{n+1}(n-1)!, and the coefficient is (−1)n+1(n−1)!n!=(−1)n+1n\dfrac{(-1)^{n+1}(n-1)!}{n!} = \dfrac{(-1)^{n+1}}{n}:

ln⁡x=(x−1)−(x−1)22+(x−1)33−…\ln x = (x-1)-\frac{(x-1)^2}{2}+\frac{(x-1)^3}{3}-\dots

Example 6 (from a known series). e−x2e^{-x^2}: in the series of eue^u, put u=−x2u=-x^2: 1−x2+x42!−x63!+…1-x^2+\dfrac{x^4}{2!}-\dfrac{x^6}{3!}+\dots One line instead of taking six derivatives.

Example 7 (approximation with a Taylor polynomial). The polynomial P4P_4 of cos⁡x\cos x is 1−x22+x4241-\dfrac{x^2}{2}+\dfrac{x^4}{24}. For x=0.5x = 0.5 it gives 1−0.125+0.0026042=0.87760421-0.125+0.0026042 = 0.8776042. The true value is cos⁡0.5=0.8775826\cos0.5 = 0.8775826. Four correct digits with only three terms. As you move away from the center (like x=3x=3) the same polynomial gets worse; more terms are needed. Estimating how large the error is is the topic of next week.

Example 8 (product). The first three nonzero terms of the Maclaurin series of exsin⁡xe^x\sin x: multiply the two series like polynomials and add up the terms up to x3x^3.

(1+x+x22+… )(x−x36+… )=x+x2+(12−16)x3+⋯=x+x2+x33+…\left(1+x+\frac{x^2}{2}+\dots\right)\left(x-\frac{x^3}{6}+\dots\right) = x+x^2+\left(\frac12-\frac16\right)x^3+\dots = x+x^2+\frac{x^3}{3}+\dots

When multiplying, add each degree separately: the x3x^3 term comes from 1⋅(−x36)1\cdot(-\frac{x^3}{6}) and x22⋅x\frac{x^2}{2}\cdot x.

Radius with the root test

If the whole term is an nnth power, the root test is cleaner: for ∑(x−1)nnn\displaystyle\sum\frac{(x-1)^n}{n^n}, ∣an∣n=∣x−1∣n→0\sqrt[n]{\lvert a_n\rvert} = \dfrac{\lvert x-1\rvert}{n}\to0, for every xx. R=∞R = \infty. For ∑(n+12n)nxn\displaystyle\sum\left(\frac{n+1}{2n}\right)^nx^n the root is n+12n∣x∣→∣x∣2\dfrac{n+1}{2n}\lvert x\rvert\to\dfrac{\lvert x\rvert}{2}, R=2R = 2.

TIP · from the coefficient to the derivative. f(k)(a)=k!×[coefficient of (x−a)k]f^{(k)}(a) = k!\times[\text{coefficient of }(x-a)^k]. In questions like “find f(20)(0)f^{(20)}(0)”, build the series from a known series, read off the coefficient of x20x^{20}, and multiply by 20!20!.

Common mistakes

WrongCorrect
Not checking the endpointsPlug x=a±Rx = a\pm R into the series and test separately
Giving the same answer for both endsOne may be an alternating series, the other a positive series
R=1R=1 for (2x+1)n(2x+1)^n∣2x+1∣<1⇒R=12\lvert2x+1\rvert<1\Rightarrow R=\frac12
Forgetting xx in the ratio testana_n is the whole term, ∣x−a∣\lvert x-a\rvert included
Deriving a series by integrating and skipping the constantPlug in x=ax=a and find CC
Thinking the radius changes with differentiationRR is the same; only the endpoints may change
Forgetting n!n! in the Taylor coefficientcn=f(n)(a)/n!c_n = f^{(n)}(a)/n!
Writing even powers in the series of sin⁡x\sin xsin⁡\sin: odd powers, cos⁡\cos: even

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1medium

Find the radius and interval of convergence of ∑n=1∞xnn 3n\displaystyle\sum_{n=1}^{\infty}\frac{x^n}{n\,3^n}.

Show answer
R=3R=3, interval [−3,3)[-3,3)

Ratio test: ∣an+1an∣=∣x∣3⋅nn+1→∣x∣3\left\lvert\dfrac{a_{n+1}}{a_n}\right\rvert = \dfrac{\lvert x\rvert}{3}\cdot\dfrac{n}{n+1}\to\dfrac{\lvert x\rvert}{3}. For <1<1 we need ∣x∣<3\lvert x\rvert<3, R=3R=3.x=3x=3: ∑1n\sum\frac1n, harmonic, diverges.x=−3x=-3: ∑(−1)nn\sum\frac{(-1)^n}{n}, alternating harmonic, converges.
The interval is [−3,3)[-3,3).

Question 2easy

Find the radius of convergence of ∑n=0∞n! xn\displaystyle\sum_{n=0}^{\infty} n!\,x^n.

Show answer
R=0R = 0

Ratio: (n+1)!∣x∣n+1n!∣x∣n=(n+1)∣x∣→∞\dfrac{(n+1)!\lvert x\rvert^{n+1}}{n!\lvert x\rvert^n} = (n+1)\lvert x\rvert\to\infty (for every x≠0x\neq0).
The series converges only at the center, x=0x=0. R=0R=0.

Question 3easy

Find the radius of convergence of ∑n=0∞xnn!\displaystyle\sum_{n=0}^{\infty}\frac{x^n}{n!}.

Show answer
R=∞R=\infty

Ratio: ∣x∣n+1→0<1\dfrac{\lvert x\rvert}{n+1}\to0<1, for every xx. The series converges everywhere, R=∞R=\infty, the interval is (−∞,∞)(-\infty,\infty). (The sum of this series is exe^x.)

Question 4medium

Find the interval of convergence of ∑n=1∞(x−2)nn2 5n\displaystyle\sum_{n=1}^{\infty}\frac{(x-2)^n}{n^2\,5^n}.

Show answer
[−3,7][-3, 7]

Ratio: ∣x−2∣5⋅n2(n+1)2→∣x−2∣5\dfrac{\lvert x-2\rvert}{5}\cdot\dfrac{n^2}{(n+1)^2}\to\dfrac{\lvert x-2\rvert}{5}. ∣x−2∣<5\lvert x-2\rvert<5, that is, −3<x<7-3<x<7.x=7x=7: ∑1n2\sum\frac{1}{n^2}, converges. x=−3x=-3: ∑(−1)nn2\sum\frac{(-1)^n}{n^2}, converges absolutely.
Both endpoints included: [−3,7][-3,7].

Question 5hard

Find the interval of convergence of ∑n=1∞(2x+1)nn\displaystyle\sum_{n=1}^{\infty}\frac{(2x+1)^n}{\sqrt n}.

Show answer
[−1,0)[-1, 0)

Ratio: ∣2x+1∣nn+1→∣2x+1∣<1\lvert2x+1\rvert\sqrt{\dfrac{n}{n+1}}\to\lvert2x+1\rvert<1, that is, −1<x<0-1<x<0. The center is −12-\frac12, R=12R=\frac12.x=0x=0: ∑1n\sum\frac{1}{\sqrt n}, p=12p=\frac12, diverges.x=−1x=-1: ∑(−1)nn\sum\frac{(-1)^n}{\sqrt n}, converges by the alternating test.
The interval is [−1,0)[-1,0).

Question 6medium

Find the interval of convergence of ∑n=1∞n xn4n\displaystyle\sum_{n=1}^{\infty}\frac{n\,x^n}{4^n}.

Show answer
(−4,4)(-4,4)

Ratio: ∣x∣4⋅n+1n→∣x∣4\dfrac{\lvert x\rvert}{4}\cdot\dfrac{n+1}{n}\to\dfrac{\lvert x\rvert}{4}, R=4R=4.x=±4x=\pm4: the terms are n(±1)nn(\pm1)^n, they do not go to zero, so it diverges at both ends. The interval is (−4,4)(-4,4).

Question 7easy

Write 11+3x\dfrac{1}{1+3x} as a power series centered at 00 and give its radius of convergence.

Show answer
∑n=0∞(−3)nxn\sum_{n=0}^\infty (-3)^n x^n, R=1/3R = 1/3

In the formula 11−u=∑un\dfrac{1}{1-u} = \sum u^n (∣u∣<1\lvert u\rvert<1), put u=−3xu = -3x.11+3x=∑(−3x)n=∑(−3)nxn\dfrac{1}{1+3x} = \sum(-3x)^n = \sum(-3)^nx^n. The condition is ∣3x∣<1\lvert3x\rvert<1, R=13R = \frac13.

Question 8medium

Using 11−x=∑n=0∞xn\dfrac{1}{1-x} = \sum_{n=0}^\infty x^n, find the sum ∑n=1∞n2n\displaystyle\sum_{n=1}^{\infty}\frac{n}{2^n}.

Show answer
22

Differentiate term by term: 1(1−x)2=∑n=1∞nxn−1\dfrac{1}{(1-x)^2} = \sum_{n=1}^\infty nx^{n-1}. Multiply by xx: x(1−x)2=∑nxn\dfrac{x}{(1-x)^2} = \sum nx^n.x=12x = \frac12 (inside the interval): 1/21/4=2\dfrac{1/2}{1/4} = 2.

Question 9medium

Find the coefficient of (x−2)3(x-2)^3 in the Taylor series of f(x)=exf(x)=e^x centered at a=2a = 2.

Show answer
e2/6e^2/6

The Taylor coefficient is cn=f(n)(a)n!c_n = \dfrac{f^{(n)}(a)}{n!}. All derivatives of exe^x are exe^x, so f′′′(2)=e2f'''(2) = e^2.c3=e23!=e26≈1.2315c_3 = \dfrac{e^2}{3!} = \dfrac{e^2}{6}\approx1.2315.

Question 10medium

Find the coefficient of x4x^4 in the Maclaurin series of x2cos⁡xx^2\cos x.

Show answer
−1/2-1/2

cos⁡x=1−x22+x424−…\cos x = 1-\dfrac{x^2}{2}+\dfrac{x^4}{24}-\dots Multiply this by x2x^2: x2−x42+x624−…x^2-\dfrac{x^4}{2}+\dfrac{x^6}{24}-\dotsThe coefficient of x4x^4 is −12-\frac12. You do not need to differentiate; multiplying the known series is enough.

Question 11hard

Let f(x)=x2exf(x) = x^2e^x. Find f(10)(0)f^{(10)}(0).

Show answer
9090

Maclaurin series: x2ex=∑n=0∞xn+2n!x^2e^x = \sum_{n=0}^\infty\dfrac{x^{n+2}}{n!}. The x10x^{10} term is at n=8n=8: the coefficient is 18!\dfrac{1}{8!}.
On the other hand the coefficient is f(10)(0)10!\dfrac{f^{(10)}(0)}{10!}. Equate them: f(10)(0)=10!8!=10⋅9=90f^{(10)}(0) = \dfrac{10!}{8!} = 10\cdot9 = 90.

Question 12hard

Find the second-degree Taylor polynomial P2(x)P_2(x) of f(x)=xf(x)=\sqrt x at a=4a=4 and use it to approximate 4.1\sqrt{4.1}.

Show answer
P2=2+x−44−(x−4)264P_2 = 2+\frac{x-4}{4}-\frac{(x-4)^2}{64}, 4.1≈2.02484\sqrt{4.1}\approx 2.02484

f(4)=2f(4) = 2. f′(x)=12x−1/2f'(x) = \frac12x^{-1/2}, f′(4)=14f'(4) = \frac14. f′′(x)=−14x−3/2f''(x) = -\frac14x^{-3/2}, f′′(4)=−14⋅18=−132f''(4) = -\frac14\cdot\frac18 = -\frac{1}{32}.P2=2+14(x−4)−132⋅(x−4)22=2+x−44−(x−4)264P_2 = 2+\frac14(x-4)-\frac{1}{32}\cdot\frac{(x-4)^2}{2} = 2+\frac{x-4}{4}-\frac{(x-4)^2}{64}.x=4.1x=4.1: 2+0.025−0.0164=2.024843752+0.025-\frac{0.01}{64} = 2.02484375. (The true value is 2.0248457…2.0248457\ldots)

Verification: Radii were checked at large n using the logarithm of the coefficient ratio, endpoint behaviors and series sums with partial sums, and Taylor coefficients by comparing the series sum with the function value and with Leibniz's rule in node (verify/MAT1052/05.mjs).

Review card

Power series: Σ c_n (x-a)^n, center a R: ratio test |a_(n+1)/a_n| → |x-a|·K < 1 → R = 1/K R=0 (only x=a), R=∞ (every x), otherwise |x-a|<R CHECK THE ENDPOINTS SEPARATELY: plug in x=a±R, p-series / alternating / nth-term Interval: (a-R,a+R), [ ), ( ], [ ] whichever comes out (2x+1)^n → |2x+1|<1 → center -1/2, R=1/2 (separate the coefficient!) 1/(1-x) = Σx^n (|x|<1). substitute u: 1/(1+x^2) = Σ(-1)^n x^(2n) Differentiate/integrate term by term, R DOES NOT CHANGE (endpoints may) Taylor: c_n = f^(n)(a)/n!. a=0 → Maclaurin e^x = Σ x^n/n! sin x = Σ(-1)^n x^(2n+1)/(2n+1)! cos x = Σ(-1)^n x^(2n)/(2n)! ln(1+x) = Σ(-1)^(n+1) x^n/n (-1<x≤1) arctan x = Σ(-1)^n x^(2n+1)/(2n+1) [-1,1] f^(k)(a) = k! · coefficient of (x-a)^k