Kim’s Math NotesCourse index

Finding Taylor or Maclaurin Series for a Function

How do I write the Taylor series of a function?

Write the Taylor series of a function, its first terms and its general term, and recognize the series to know.

The missing factorial

Common mistake (n+1)!3n(x−2)n (no n!)

Correction (n+1)!3nn!(x−2)n=(n+1)(x−2)n3n

Idea 1: never stop

Idea one: never stop. Keep the same coefficient as before: the n-th derivative of f at A, over n factorial. But now, never stop adding terms. The sum from n equals zero to infinity of the n-th derivative of f at A, over n factorial, times x minus A to the n, is called the Taylor series of f about A. Read the first term carefully.

When n equals zero, the zeroth derivative is f itself, zero factorial is one, and x minus A to the zero is one. So the series starts with f of A. Stop the series at the term with x minus A to the n, and you get the Taylor polynomial, P sub n.

Watch this part of the concept lesson

Read the rest of this scene

So the Taylor polynomials are exactly the partial sums of the series. And when the center A is zero, it has its own name: a Maclaurin series. Take f equals one over one minus x. Write it as one minus x, to the negative one. The power rule brings down a negative one, and the chain rule multiplies by the derivative of the inside, which is negative one again.

So f prime is one over one minus x, squared. Two minus signs made a plus. The same thing happens each time. f double prime is two over one minus x, cubed. And f triple prime is six over one minus x, to the fourth.

Near zero, every derivative stays positive. At zero, the function and those derivatives are one, one, two, six. Those are the factorials: the n-th derivative of f at zero is n factorial. So every coefficient is n factorial over n factorial, which is one. The Maclaurin series is one, plus x, plus x squared, plus x cubed, and so on.

Written with sigma, that's the sum from n equals zero to infinity of x to the n. It's the geometric series, with ratio x. The Taylor recipe gave us a series we already knew.

Idea 2: the series to know

Idea two: the series you must know. Start with e to the x. Every derivative of e to the x is e to the x again, so at zero, every derivative is one. So e to the x is one, plus x, plus x squared over two factorial, plus x cubed over three factorial, and so on. In sigma form, it's the sum from n equals zero to infinity of x to the n, over n factorial.

For sine x, the function and its derivatives are sine x, cosine x, negative sine x, negative cosine x.

Watch this part of the concept lesson

Read the rest of this scene

At zero, those are zero, one, zero, negative one, and then they repeat. A zero removes its term, so only the odd powers survive, with alternating signs. To write that with sigma, we need the odd numbers and the signs. Two n plus one gives one, three, five, when n is zero, one, two. And negative one to the n gives plus, minus, plus.

Sine of x is x, minus x cubed over three factorial, plus x to the fifth over five factorial, and so on. In sigma form, it's the sum from n equals zero to infinity of negative one to the n, times x to the two n plus one, over the quantity two n plus one, factorial. For cosine x, the value and the derivatives at zero are one, zero, negative one, zero, and then they repeat. So only the even powers survive. Cosine x equals one, minus x squared over two factorial, plus x to the fourth over four factorial, and so on.

In sigma form, it's the sum from n equals zero to infinity of negative one to the n, times x to the two n, over two n factorial. Always check a general term. Put in n equals zero, one, and two, and you must get back the terms you started with.

Idea 3: where the series equals the function

Idea three: where the series equals the function. So far, we skipped a question. Does f of x always equal its Taylor series? No. It can be equal only where the series converges. Outside that interval, the series has no sum at all.

Take our example. One over one minus x equals the sum of x to the n, only when negative one is less than x, and x is less than one.

Watch this part of the concept lesson

Read the rest of this scene

Inside, the partial sums close in on the curve. Outside, it's different. At x equals negative two, the function is fine: f of negative two is one third. But the series is one, minus two, plus four, minus eight, and so on. It diverges.

For e to the x, sine x, and cosine x, the ratio test gives a radius of infinity, and each series equals its function for every x. The proof uses the error bound, and we skip it. You may use that fact without proof. So whenever you write that a function equals its series, write the interval where that's true, right next to it.

Example 1: terms and the general term

Example one is a free response question. A function f has derivatives of all orders at x equals two. The n-th derivative of f at two is the quantity n plus one, factorial, over three to the n, for n at least zero. Write the first four terms and the general term of the Taylor series for f about x equals two. The plan: each coefficient is the n-th derivative of f at two, over n factorial.

Simplify it, write the terms, and then the general term. The n-th derivative of f at two, over n factorial is the quantity n plus one, factorial, over the product of three to the n and n factorial. The quantity n plus one, factorial is n plus one, times n factorial. The n factorials divide out, leaving n plus one, so the coefficient is n plus one, over three to the n. Put in n equals zero, one, two, and three.

Watch this part of the concept lesson

Read the rest of this scene

The coefficients are one, two thirds, three ninths, and four over twenty-seven. This line earns the point. The series starts: one, plus two thirds times x minus two, plus three ninths times x minus two, squared, plus four over twenty-seven times x minus two, cubed. And the general term is n plus one, times the quantity x minus two, raised to the n-th power, over three to the n. Put a value of n back in to check it.

Common mistake: the missing factorial

Stay with the general term for a moment. The problem hands you a formula for the derivatives, and that leads to a very common wrong answer. This is where people lose points. The quantity n plus one, factorial, over three to the n, goes straight in front of the quantity x minus two, raised to the n-th power. That's the derivative, not the coefficient: the division by n factorial is missing.

Divide by n factorial first.

Watch this part of the concept lesson

Read the rest of this scene

The quantity n plus one, factorial, over the product of three to the n and n factorial, times the quantity x minus two, raised to the n-th power, simplifies to n plus one, times the quantity x minus two, raised to the n-th power, over three to the n.

Example 2: recognize the series

Example two is multiple choice. What is the sum of the series, from n equals zero to infinity, of negative one to the n, times three to the two n plus one, over the quantity two n plus one, factorial? The plan: don't add up terms. Match the pattern with a series we know. Read the pattern. The powers are all odd.

The factorials are of those same odd numbers.

Watch this part of the concept lesson

Read the rest of this scene

And the signs alternate. Among the series we know, that's the sine series. Write that series down. Sine x is the sum from n equals zero to infinity of negative one to the n, times x to the two n plus one, over the quantity two n plus one, factorial. Now plug in three for x.

Every odd power of x becomes the same odd power of three. The signs and factorials already match, so this is the sine series evaluated at three. Its sum is sine of three. So the answer is A. Choice B, cosine, would need even powers, and two n factorial.

Worked examples

Example 1

A function f has derivatives of all orders at x=2, with f(n)(2)=(n+1)!3n for n≥0. Write the first four terms and the general term of the Taylor series for f about x=2.
Hint

Divide by n!: (n+1)!n!=n+1.

Answer and solution

Answer 1+23(x−2)+39(x−2)2+427(x−2)3; general term (n+1)(x−2)n3n

  1. f(n)(2)n!=n+13n:1,23,39,427
  2. 1+23(x−2)+39(x−2)2+427(x−2)3+⋯,(n+1)(x−2)n3n

Example 2

What is the sum of ∑n=0∞(−1)n32n+1(2n+1)!?
  1. sin3
  2. cos3
  3. e3
  4. e−3
Hint

Odd powers, odd factorials, alternating signs.

Answer and solution

Answer A. sin3

  1. sinx=∑(−1)nx2n+1(2n+1)!,x=3
  2. sin3.Answer A.

Workbook

Problem 1

(a) Write the first four nonzero terms and the general term of the Maclaurin series for sinx. (b) Write the third-degree Maclaurin polynomial P3(x) for sinx.
Hint

The derivatives of sine at 0 are 0,1,0,−1, repeating.

Answer and solution

Answer (a) x−x33!+x55!−x77!; (−1)nx2n+1(2n+1)! (b) x−x36

  1. sinx=x−x33!+x55!−x77!+⋯=∑n=0∞(−1)nx2n+1(2n+1)!,P3(x)=x−x36

Common mistake A general term that does not give back the terms.

Watch the worked solution to Problem 1

Problem 2

What is the sum of the series ∑n=0∞(−1)nπ2n(2n)!?
  1. −1
  2. 0
  3. 1
  4. π
Hint

Even powers, even factorials, alternating signs.

Answer and solution

Answer A. −1

  1. cosx=∑n=0∞(−1)nx2n(2n)!,x=π:cosπ=−1.Answer A.

Common mistake Taking x=π2.

Watch the worked solution to Problem 2

Problem 3

Write the first three terms and the general term of the Taylor series for f(x)=ex about x=1.
Hint

Every derivative of ex is ex.

Answer and solution

Answer e+e(x−1)+e2(x−1)2; e(x−1)nn!

  1. f(n)(1)=e⇒∑n=0∞e(x−1)nn!=e+e(x−1)+e2(x−1)2+⋯

Common mistake Writing the Maclaurin series instead.

Watch the worked solution to Problem 3

Problem 4

A function f has derivatives of all orders at x=0, with f(n)(0)=(−1)nn!2n for n≥0. (a) Write the first four terms and the general term of the Maclaurin series for f. (b) Find the radius of convergence of the series.
Hint

Divide the derivative by n!.

Answer and solution

Answer (a) 1−12x+14x2−18x3; (−1)nxn2n (b) R=2

  1. f(n)(0)n!=(−1)n2n⇒1−12x+14x2−18x3+⋯
  2. |an+1an|=|x|2<1⇒R=2

Common mistake Leaving n! in the general term.

Watch the worked solution to Problem 4

Problem 5

Let f(x)=ln(1+x). (a) Find f(0) and the values of the first four derivatives of f at x=0. (b) Write the first four nonzero terms of the Maclaurin series for f. (c) Write the general term of the series.
Hint

Divide each derivative by its factorial, then look for the pattern.

Answer and solution

Answer (a) 0; 1,−1,2,−6 (b) x−x22+x33−x44 (c) (−1)n+1xnn, n≥1

  1. f′=11+x,f′′=−1(1+x)2,f′′′=2(1+x)3,f(4)=−6(1+x)4⇒1,−1,2,−6 at 0
  2. x−x22+x33−x44+⋯=∑n=1∞(−1)n+1xnn

Common mistake The sign: the n=1 term is positive.

Watch the worked solution to Problem 5

Problem 6

Find the sum of the series ∑n=1∞2nn!.
Hint

Match the series for ex.

Answer and solution

Answer e2−1

  1. ∑n=0∞2nn!=e2;the n=0 term is 1⇒e2−1

Common mistake Answering e2: this series starts at n=1.

Watch the worked solution to Problem 6