Educerie

Educerie · AP · Calculus AB and BC

Unit 10 Infinite Sequences and Series · 10.14 Finding Taylor or Maclaurin Series for a Function

BC only. This topic is on the AP Calculus BC exam and not on AB.

Big ideas: LIM (Limits). Let the degree of a Taylor polynomial grow without end and you get a series. For the functions the course uses, that series equals the function.

The question this unit answers: When does an endless sum settle on a number, and how do we tell, and how do we use it to approximate?

Where it is examined: Section I multiple choice: choose the Maclaurin series for a function, read a derivative value off a series, or pick the first few terms of a Taylor series. Section II free response (series question 6): list the first few terms of a Taylor series about a given center, skipping any that are zero, and give a formula for the nnth term, often from a table of derivatives or from a pattern.


AP Calculus AB and BC 10.14

Finding Taylor or Maclaurin Series for a Function

When does an endless sum settle on a number, and how do we tell, and how do we use it to approximate?

What you will learn

  • Understand that a Taylor series has a term for every n and a polynomial is a partial sum.
  • Know the Maclaurin series for e^x, sin x, cos x and 1 ÷ 1 - x.
  • Understand that f^(n)(a) = n! cn.

You must be able to

  1. Find a Taylor series from a derivative pattern.
  2. Write the general term and check it against the first terms.
  3. Count first nonzero terms correctly.
  4. Read a derivative from a series coefficient.
  5. Find the radius with the ratio test.

1The formula

The Taylor series for ff centered at x=ax = a 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 + \cdots.

A Taylor polynomial for ff is a partial sum of this series. The polynomial P3P_3 is the first four terms, with n=0,1,2,3n = 0, 1, 2, 3.

The series is a power series (10.13), so it has a radius of convergence. The series equals f(x)f(x) at the points where it converges, for the functions in this course. Where it does not converge, it says nothing about ff.

2The four series to know

These are the Maclaurin series (center 0) that the exam expects from memory. The ratio test (10.8) gives the radius in each case.

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

sin⁡x=∑n=0∞(−1)nx2n+1(2n+1)!=x−x33!+x55!−⋯(R=∞) \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 (R = \infty)

cos⁡x=∑n=0∞(−1)nx2n(2n)!=1−x22!+x44!−⋯(R=∞) \cos x = \sum_{n=0}^{\infty}\frac{(-1)^n x^{2n}}{(2n)!} = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots \qquad (R = \infty)

11−x=∑n=0∞xn=1+x+x2+x3+⋯(R=1) \frac{1}{1-x} = \sum_{n=0}^{\infty} x^n = 1 + x + x^2 + x^3 + \cdots \qquad (R = 1)

The last one is a geometric series (10.2) with first term 1 and ratio xx, so it converges for ∣x∣<1\lvert x\rvert < 1 to 11−x\dfrac{1}{1-x}. It is the starting point for most of 10.15.

Where do they come from? For exe^x, every derivative at 0 is 1, so the coefficient is 1n!\tfrac{1}{n!}. For sin⁡x\sin x, the derivatives at 0 cycle through 0,1,0,−10, 1, 0, -1, so only odd powers survive, with alternating signs. For cos⁡x\cos x the cycle is 1,0,−1,01, 0, -1, 0, so only even powers appear.

3Finding a series from a pattern of derivatives

The method has four steps.

  1. Find the first few derivatives of ff.
  2. Evaluate them at the center aa.
  3. Spot the pattern in f(n)(a)f^{(n)}(a), and write it as a formula in nn.
  4. Divide by n!n! and write the series.

Example: f(x)=1xf(x) = \dfrac1x about a=1a = 1.

f′=−1x2,f′′=2x3,f′′′=−6x4. f' = -\frac{1}{x^2},\quad f'' = \frac{2}{x^3},\quad f''' = -\frac{6}{x^4}.

At x=1x = 1: f(1)=1f(1) = 1, f′(1)=−1f'(1) = -1, f′′(1)=2f''(1) = 2, f′′′(1)=−6f'''(1) = -6. The pattern is f(n)(1)=(−1)n n!f^{(n)}(1) = (-1)^n\,n!. Divide by n!n! and the series is

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

This is geometric with ratio −(x−1)-(x-1), so it converges for ∣x−1∣<1\lvert x-1\rvert < 1, that is, 0<x<20 < x < 2, to 11+(x−1)=1x\dfrac{1}{1+(x-1)} = \dfrac1x. The n!n! canceled, which is why many Taylor series look simple.

Example: f(x)=ln⁡xf(x) = \ln x about a=1a = 1.

From 10.11: f(1)=0f(1) = 0, and f(n)(1)=(−1)n+1(n−1)!f^{(n)}(1) = (-1)^{n+1}(n-1)! for n≥1n \ge 1, for instance f′(1)=1f'(1) = 1, f′′(1)=−1f''(1) = -1, f′′′(1)=2f'''(1) = 2. So the coefficient of (x−1)n(x-1)^n is (−1)n+1(n−1)!n!=(−1)n+1n\dfrac{(-1)^{n+1}(n-1)!}{n!} = \dfrac{(-1)^{n+1}}{n}, and

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

The series starts at n=1n = 1, because the constant term ln⁡1=0\ln 1 = 0 is missing.

Example: f(x)=exf(x) = e^x about a=2a = 2.

Every derivative of exe^x is exe^x, and e2e^2 at the center, so the coefficient of (x−2)n(x-2)^n is e2n!\dfrac{e^2}{n!}:

ex=∑n=0∞e2n!(x−2)n=e2[1+(x−2)+(x−2)22!+⋯ ]. e^x = \sum_{n=0}^{\infty}\frac{e^2}{n!}(x-2)^n = e^2\left[1 + (x-2) + \frac{(x-2)^2}{2!} + \cdots\right].

The center changes the series, not the function. Taking x=2.1x = 2.1 and the first four terms: e2(1+0.1+0.005+0.000167)≈8.1661e^2\left(1 + 0.1 + 0.005 + 0.000167\right) \approx 8.1661, against e2.1≈8.1662e^{2.1} \approx 8.1662.

4The polynomial is part of the series

A Taylor polynomial is the series stopped early. This gives an easy way to move between them.

Example: the Maclaurin series for cos⁡x\cos x is 1−x22!+x44!−x66!+⋯1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!} - \dfrac{x^6}{6!} + \cdots. The degree-4 polynomial is 1−x22+x4241 - \dfrac{x^2}{2} + \dfrac{x^4}{24}, and the degree-6 polynomial adds −x6720-\dfrac{x^6}{720}.

"First four nonzero terms" means count only the terms that are not zero. For sin⁡x\sin x, the first four nonzero terms are x−x33!+x55!−x77!x - \dfrac{x^3}{3!} + \dfrac{x^5}{5!} - \dfrac{x^7}{7!}, up to degree 7.

5Reading derivatives off a series

If f(x)=∑cn(x−a)nf(x) = \sum c_n (x-a)^n, then cn=f(n)(a)n!c_n = \dfrac{f^{(n)}(a)}{n!}, and so

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

Example (invented): ff has Maclaurin series ∑n=0∞(−1)nx2nn+1=1−x22+x43−⋯\displaystyle\sum_{n=0}^{\infty}\frac{(-1)^n x^{2n}}{n+1} = 1 - \frac{x^2}{2} + \frac{x^4}{3} - \cdots. The coefficient of x4x^4 is 13\tfrac13, so f(4)(0)=4!⋅13=8f^{(4)}(0) = 4!\cdot\tfrac13 = 8.

Example: from the series for cos⁡x\cos x, the coefficient of x6x^6 is −1720-\tfrac{1}{720}, so cos⁡(6)(0)=6!(−1720)=−1\cos^{(6)}(0) = 6!\left(-\tfrac{1}{720}\right) = -1.

Notice that the power of xx and the order of the derivative must match. The coefficient of x4x^4 goes with f(4)f^{(4)}, not with f(2)f^{(2)}. A series in x2nx^{2n} has x4x^4 at n=2n = 2, so check which nn gives the power you need.

6Taylor series and the function

For exe^x, sin⁡x\sin x and cos⁡x\cos x, the Maclaurin series converges to the function for every xx. For 11−x\dfrac{1}{1-x}, it converges to the function only for ∣x∣<1\lvert x\rvert < 1. Outside that interval, the series diverges even though the function is perfectly defined (for x=2x = 2, 11−x=−1\tfrac{1}{1-x} = -1, but 1+2+4+⋯1 + 2 + 4 + \cdots diverges).

A convergent power series with R>0R > 0 is the Taylor series of the function it converges to on its open interval (10.13). The series is unique: two different power series about the same center cannot represent the same function on an interval.

7A full answer in exam style

Question (invented): the function ff has derivatives at x=0x = 0 given by f(0)=2f(0) = 2, f′(0)=1f'(0) = 1, f′′(0)=6f''(0) = 6, f′′′(0)=−24f'''(0) = -24. Write the third-degree Maclaurin polynomial, and say what the coefficient of x3x^3 in the Maclaurin series is.

Answer: the polynomial is P3(x)=2+x+62!x2+−243!x3=2+x+3x2−4x3P_3(x) = 2 + x + \dfrac{6}{2!}x^2 + \dfrac{-24}{3!}x^3 = 2 + x + 3x^2 - 4x^3. The coefficient of x3x^3 in the series is the same, −4-4, because the polynomial is the first four terms of the series.

Question (invented): give three terms of the Maclaurin series for cos⁡x\cos x, skipping any zero terms, and a formula for the nnth term. Answer: 1−x22!+x44!1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!}, with general term (−1)nx2n(2n)!\dfrac{(-1)^n x^{2n}}{(2n)!}. Check the general term at n=2n = 2: (+1)x44!\dfrac{(+1)x^4}{4!}, which matches the third term.

Checking the general term against the listed terms, as in the last line, is cheap and catches wrong signs and wrong factorials.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.