Math Core

Lesson 6.10 · Infinite Sequences and Series

Taylor polynomials

A tangent line matches a function's value and slope at one point, and it gives good approximations nearby. Taylor polynomials push that idea further: by also matching the second derivative, the third derivative, and so on, you get polynomials that hug the curve much more closely and over a wider range.

From tangent lines to better approximations

The linearization of ff at x=ax = a is P1(x)=f(a)+f′(a)(x−a)P_1(x) = f(a) + f'(a)(x - a). It agrees with ff in value and first derivative at aa. To capture how the curve bends, add a quadratic term chosen so the second derivatives also agree:

P2(x)=f(a)+f′(a)(x−a)+f′′(a)2(x−a)2.P_2(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2}(x - a)^2.

Check: P2′′(x)=f′′(a)P_2''(x) = f''(a), as intended. The 12\frac{1}{2} is needed because differentiating (x−a)2(x-a)^2 twice produces a factor of 22. In the same way, differentiating (x−a)k(x - a)^k kk times produces k!k!, which is why factorials appear in the general formula.

Definition

Taylor polynomial

The nnth-degree Taylor polynomial for ff centered at x=ax = a is

Pn(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+⋯+f(n)(a)n!(x−a)n=∑k=0nf(k)(a)k!(x−a)k.P_n(x) = f(a) + f'(a)(x-a) + \frac{f''(a)}{2!}(x-a)^2 + \cdots + \frac{f^{(n)}(a)}{n!}(x-a)^n = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k.

It is the unique polynomial of degree at most nn whose value and first nn derivatives at aa match those of ff. When a=0a = 0, it is also called a Maclaurin polynomial.

The coefficient formula

The coefficient of (x−a)k(x - a)^k in a Taylor polynomial is f(k)(a)k!\dfrac{f^{(k)}(a)}{k!}. Read in reverse:

f(k)(a)=k!×(coefficient of (x−a)k).f^{(k)}(a) = k! \times \big(\text{coefficient of } (x - a)^k\big).

That reverse direction is a favorite AP question: given a Taylor polynomial, find a derivative value.

Watching the approximations improve

For f(x)=exf(x) = e^x at a=0a = 0, every derivative equals e0=1e^0 = 1, so

P1(x)=1+x,P2(x)=1+x+x22,P3(x)=1+x+x22+x36.P_1(x) = 1 + x, \qquad P_2(x) = 1 + x + \frac{x^2}{2}, \qquad P_3(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}.

Each new term makes the polynomial follow exe^x over a wider interval around 00.

For example, to estimate e0.5≈1.6487e^{0.5} \approx 1.6487: P1(0.5)=1.5P_1(0.5) = 1.5, P2(0.5)=1.625P_2(0.5) = 1.625, and P3(0.5)≈1.6458P_3(0.5) \approx 1.6458. Each added term cuts the error sharply, because the new term involves a higher power of the small number 0.50.5 divided by a larger factorial. How small the error is guaranteed to be is the subject of the next lesson.

y = eˣ with its Taylor polynomials of degree 1, 2 and 3 centered at 0. Higher degree means a closer fit over a wider interval.Open in grapher →

A recipe

  1. Make a table of f,f′,f′′,…,f(n)f, f', f'', \dots, f^{(n)}.
  2. Evaluate each at x=ax = a.
  3. Divide the kkth value by k!k! and attach (x−a)k(x - a)^k.

Keep the terms in powers of (x−a)(x - a); don't expand them. The factored form is easier to read and is what the AP exam expects.

Common mistake

Two classic errors: forgetting the factorials (writing f′′(a)(x−a)2f''(a)(x-a)^2 instead of f′′(a)2(x−a)2\frac{f''(a)}{2}(x-a)^2), and writing powers of xx instead of (x−a)(x - a) when the center is not 00. Also remember that "the third-degree Taylor polynomial" includes every term up through (x−a)3(x-a)^3, even if some coefficients are zero.

Worked examples

Worked example: A Maclaurin polynomial for sine

Find the fifth-degree Maclaurin polynomial for f(x)=sin⁡xf(x) = \sin x.

Solution. The derivatives cycle: sin⁡x,cos⁡x,−sin⁡x,−cos⁡x,sin⁡x,cos⁡x\sin x, \cos x, -\sin x, -\cos x, \sin x, \cos x. At x=0x = 0 they are 0,1,0,−1,0,10, 1, 0, -1, 0, 1. So

P5(x)=0+x+0−x33!+0+x55!=x−x36+x5120.P_5(x) = 0 + x + 0 - \frac{x^3}{3!} + 0 + \frac{x^5}{5!} = x - \frac{x^3}{6} + \frac{x^5}{120}.

Worked example: Centered away from zero

Find the third-degree Taylor polynomial for f(x)=ln⁡xf(x) = \ln x centered at x=1x = 1.

Solution.

kkf(k)(x)f^{(k)}(x)f(k)(1)f^{(k)}(1)f(k)(1)k!\frac{f^{(k)}(1)}{k!}
0ln⁡x\ln x0000
1x−1x^{-1}1111
2−x−2-x^{-2}−1-1−12-\frac12
32x−32x^{-3}2226=13\frac{2}{6} = \frac13
P3(x)=(x−1)−(x−1)22+(x−1)33.P_3(x) = (x - 1) - \frac{(x-1)^2}{2} + \frac{(x-1)^3}{3}.

Worked example: Working from given derivative values

A function ff has f(2)=3f(2) = 3, f′(2)=−1f'(2) = -1, f′′(2)=4f''(2) = 4 and f′′′(2)=12f'''(2) = 12. Write the third-degree Taylor polynomial for ff about x=2x = 2 and use it to approximate f(2.1)f(2.1).

Solution.

P3(x)=3−(x−2)+42(x−2)2+126(x−2)3=3−(x−2)+2(x−2)2+2(x−2)3.P_3(x) = 3 - (x - 2) + \frac{4}{2}(x-2)^2 + \frac{12}{6}(x-2)^3 = 3 - (x-2) + 2(x-2)^2 + 2(x-2)^3.

With x−2=0.1x - 2 = 0.1:   P3(2.1)=3−0.1+2(0.01)+2(0.001)=2.922\; P_3(2.1) = 3 - 0.1 + 2(0.01) + 2(0.001) = 2.922.

Worked example: Reading derivatives off a polynomial

The third-degree Taylor polynomial for gg about x=−1x = -1 is P3(x)=4−5(x+1)+3(x+1)2−23(x+1)3P_3(x) = 4 - 5(x+1) + 3(x+1)^2 - \dfrac{2}{3}(x+1)^3. Find g′′(−1)g''(-1) and g′′′(−1)g'''(-1).

Solution. Multiply each coefficient by the matching factorial:

g′′(−1)=2!⋅3=6,g′′′(−1)=3!⋅(−23)=−4.g''(-1) = 2! \cdot 3 = 6, \qquad g'''(-1) = 3! \cdot \left(-\frac23\right) = -4.

Tip

A Taylor polynomial is most accurate near its center. If you need to approximate f(3.9)f(3.9), center the polynomial at a nearby point where you know the derivatives, such as a=4a = 4, not at a=0a = 0.

Practice

Practice 1

In the third-degree Maclaurin polynomial for f(x)=exf(x) = e^x, what is the coefficient of x3x^3?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 2

Find the second-degree Taylor polynomial for f(x)=ln⁡xf(x) = \ln x centered at x=1x = 1.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 3

Find the second-degree Taylor polynomial for f(x)=xf(x) = \sqrt{x} centered at x=4x = 4.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 4

A function ff has f(2)=3f(2) = 3, f′(2)=−1f'(2) = -1, f′′(2)=4f''(2) = 4 and f′′′(2)=12f'''(2) = 12. Use the third-degree Taylor polynomial about x=2x = 2 to approximate f(2.1)f(2.1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

The third-degree Taylor polynomial for hh about x=1x = 1 is P3(x)=5+2(x−1)−3(x−1)2+43(x−1)3P_3(x) = 5 + 2(x - 1) - 3(x - 1)^2 + \dfrac{4}{3}(x-1)^3. Find h′′(1)h''(1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 6

For the same polynomial, P3(x)=5+2(x−1)−3(x−1)2+43(x−1)3P_3(x) = 5 + 2(x - 1) - 3(x - 1)^2 + \dfrac{4}{3}(x-1)^3, find h′′′(1)h'''(1).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 7

Use the fourth-degree Maclaurin polynomial for cos⁡x\cos x to approximate cos⁡(0.2)\cos(0.2). Round to five decimal places.

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

Which is the third-degree Taylor polynomial for f(x)=1xf(x) = \dfrac{1}{x} centered at x=1x = 1?