Skip to content
Family Table Math
Auto

Taylor Polynomials

A tangent line matches a function’s value and slope at one point, and it’s a decent approximation nearby. A Taylor polynomial goes further: it also matches the second derivative, the third, and so on. The more derivatives it matches, the longer it hugs the curve. Taylor polynomials are how you turn hard functions like exe^x, sin⁡x\sin x and ln⁡x\ln x into simple polynomials you can evaluate by hand, and they lead straight to Taylor series.

The nnth-degree Taylor polynomial for ff about x=ax = a (also called “centred at aa”) is

Pn(x)=f(a)+f′(a)(x−a)+f′′(a)2!(x−a)2+f′′′(a)3!(x−a)3+⋯+f(n)(a)n!(x−a)nP_n(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \frac{f'''(a)}{3!}(x - a)^3 + \cdots + \frac{f^{(n)}(a)}{n!}(x - a)^n

or, in sigma notation,

Pn(x)=∑k=0nf(k)(a)k!(x−a)kP_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^k

Here f(k)f^{(k)} means the kkth derivative, with f(0)=ff^{(0)} = f, and 0!=10! = 1. When a=0a = 0, it’s called a Maclaurin polynomial: Pn(x)=f(0)+f′(0)x+f′′(0)2!x2+⋯P_n(x) = f(0) + f'(0)x + \dfrac{f''(0)}{2!}x^2 + \cdots

PnP_n is built so that Pn(a)=f(a)P_n(a) = f(a), Pn′(a)=f′(a)P_n'(a) = f'(a), and so on up to the nnth derivative. Differentiating (x−a)k(x - a)^k a total of kk times gives k!k!, so dividing by k!k! cancels it, leaving exactly f(k)(a)f^{(k)}(a).

  • P1(x)=f(a)+f′(a)(x−a)P_1(x) = f(a) + f'(a)(x - a) is the tangent line (the linearization).
  • P2(x)P_2(x) adds f′′(a)2(x−a)2\dfrac{f''(a)}{2}(x - a)^2, which bends the approximation to match the concavity.

The coefficient of (x−a)k(x - a)^k is f(k)(a)k!\dfrac{f^{(k)}(a)}{k!}. Working backwards:

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

AP questions use this a lot: “The third-degree Taylor polynomial for ff about x=2x = 2 is … Find f′′(2)f''(2).”

To approximate f(b)f(b) for bb near aa, evaluate Pn(b)P_n(b). Higher degree and bb closer to aa both usually give a better approximation. The figure shows this for sin⁡x\sin x about x=0x = 0 (radians, as always in calculus):

Three graphs of y = sin x for x from -5 to 5, each with a Maclaurin polynomial. Degree 1, the line y = x, matches sin x only very close to 0. Degree 3 matches from about -1.5 to 1.5. Degree 5 matches from about -2.5 to 2.5 before pulling away. −4 −2 2 4 −2 2 P1(x) = x −4 −2 2 4 −2 2 P3(x) = x - x³/6 −4 −2 2 4 −2 2 P5(x) = x - x³/6 + x⁵/120 y = sin x Taylor polynomial about x = 0
Maclaurin polynomials for sin⁡x\sin x of degree 1, 3 and 5. Each extra matched derivative keeps the polynomial close to the curve over a wider interval.

To find how accurate an approximation is, see the alternating series error bound and the Lagrange error bound.

Example 1: A Maclaurin polynomial for e to the x

Section titled “Example 1: A Maclaurin polynomial for e to the x”

Find the third-degree Maclaurin polynomial for f(x)=exf(x) = e^x, and use it to approximate e0.2e^{0.2}.

Solution. Every derivative of exe^x is exe^x, so f(0)=f′(0)=f′′(0)=f′′′(0)=1f(0) = f'(0) = f''(0) = f'''(0) = 1.

P3(x)=1+x+x22!+x33!=1+x+x22+x36P_3(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} e0.2≈P3(0.2)=1+0.2+0.02+0.0013333≈1.221e^{0.2} \approx P_3(0.2) = 1 + 0.2 + 0.02 + 0.0013333 \approx 1.221

(Check: e0.2≈1.221403e^{0.2} \approx 1.221403.)

Find the second-degree Taylor polynomial for f(x)=xf(x) = \sqrt{x} about x=4x = 4, and use it to approximate 4.2\sqrt{4.2}.

Solution. Find the derivatives and evaluate at 44:

f(x)=x1/2f(4)=2f′(x)=12x−1/2f′(4)=14f′′(x)=−14x−3/2f′′(4)=−14⋅18=−132\begin{aligned} f(x) &= x^{1/2} && f(4) = 2 \\ f'(x) &= \tfrac{1}{2}x^{-1/2} && f'(4) = \tfrac{1}{4} \\ f''(x) &= -\tfrac{1}{4}x^{-3/2} && f''(4) = -\tfrac{1}{4} \cdot \tfrac{1}{8} = -\tfrac{1}{32} \end{aligned} P2(x)=2+14(x−4)−1/322!(x−4)2=2+14(x−4)−164(x−4)2P_2(x) = 2 + \frac{1}{4}(x - 4) - \frac{1/32}{2!}(x - 4)^2 = 2 + \frac{1}{4}(x - 4) - \frac{1}{64}(x - 4)^2

With x−4=0.2x - 4 = 0.2:

4.2≈2+0.05−0.0464=2.049375≈2.049\sqrt{4.2} \approx 2 + 0.05 - \frac{0.04}{64} = 2.049375 \approx 2.049

(Check: 4.2≈2.049390\sqrt{4.2} \approx 2.049390.)

A function ff has derivatives of all orders. Some values are shown.

xxf(x)f(x)f′(x)f'(x)f′′(x)f''(x)f′′′(x)f'''(x)
2233−1-144−12-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+(−1)(x−2)+42!(x−2)2+−123!(x−2)3=3−(x−2)+2(x−2)2−2(x−2)3\begin{aligned} P_3(x) &= 3 + (-1)(x - 2) + \frac{4}{2!}(x - 2)^2 + \frac{-12}{3!}(x - 2)^3 \\ &= 3 - (x - 2) + 2(x - 2)^2 - 2(x - 2)^3 \end{aligned}

With x−2=0.1x - 2 = 0.1:

f(2.1)≈3−0.1+2(0.01)−2(0.001)=2.918f(2.1) \approx 3 - 0.1 + 2(0.01) - 2(0.001) = 2.918

The third-degree Taylor polynomial for gg about x=1x = 1 is

P3(x)=5−2(x−1)+3(x−1)2+12(x−1)3P_3(x) = 5 - 2(x - 1) + 3(x - 1)^2 + \frac{1}{2}(x - 1)^3

Find g′(1)g'(1), g′′(1)g''(1) and g′′′(1)g'''(1). Is the graph of gg concave up or concave down at x=1x = 1?

Solution. Multiply each coefficient by k!k!:

g′(1)=1!⋅(−2)=−2,g′′(1)=2!⋅3=6,g′′′(1)=3!⋅12=3g'(1) = 1! \cdot (-2) = -2, \qquad g''(1) = 2! \cdot 3 = 6, \qquad g'''(1) = 3! \cdot \frac{1}{2} = 3

Since g′′(1)=6>0g''(1) = 6 \gt 0, the graph of gg is concave up at x=1x = 1.

Forgetting the factorials. The coefficient of (x−a)k(x - a)^k is f(k)(a)k!\dfrac{f^{(k)}(a)}{k!}, not f(k)(a)f^{(k)}(a). In Example 3, the (x−2)2(x - 2)^2 coefficient is 42=2\dfrac{4}{2} = 2, not 44.

Writing powers of x instead of powers of (x − a). For a polynomial about x=4x = 4, every term uses (x−4)k(x - 4)^k. Writing xkx^k gives a polynomial about 00, which is a different (and wrong) answer. When you evaluate, plug in x−ax - a, like 0.20.2 in Example 2, not xx itself.

Confusing a derivative value with a coefficient. If a question gives the polynomial and asks for f′′′(a)f'''(a), multiply the coefficient by 3!=63! = 6. If it gives f′′′(a)f'''(a) and asks for the coefficient, divide by 66.

Mixing up degree and number of terms. The degree is the highest power. For sin⁡x\sin x, the third-degree and fourth-degree Maclaurin polynomials are the same, x−x36x - \dfrac{x^3}{6}, because the x4x^4 coefficient is 00.

Sign errors in the derivatives. Derivatives like those of 1x\dfrac{1}{x} or cos⁡x\cos x alternate in sign. Write each derivative on its own line, as in Example 2, before evaluating.

1. (Warm-up) Find the second-degree Maclaurin polynomial for cos⁡x\cos x.

Solution

f(0)=cos⁡0=1f(0) = \cos 0 = 1, f′(0)=−sin⁡0=0f'(0) = -\sin 0 = 0, f′′(0)=−cos⁡0=−1f''(0) = -\cos 0 = -1.

P2(x)=1+0⋅x+−12!x2=1−x22P_2(x) = 1 + 0 \cdot x + \frac{-1}{2!}x^2 = 1 - \frac{x^2}{2}

2. (Warm-up) A function has f(0)=2f(0) = 2, f′(0)=−3f'(0) = -3 and f′′(0)=8f''(0) = 8. Write its second-degree Maclaurin polynomial.

SolutionP2(x)=2−3x+82!x2=2−3x+4x2P_2(x) = 2 - 3x + \frac{8}{2!}x^2 = 2 - 3x + 4x^2

3. (Warm-up) Find the third-degree Maclaurin polynomial for ln⁡(1+x)\ln(1 + x).

Solutionf(x)=ln⁡(1+x)f(0)=0f′(x)=(1+x)−1f′(0)=1f′′(x)=−(1+x)−2f′′(0)=−1f′′′(x)=2(1+x)−3f′′′(0)=2\begin{aligned} f(x) &= \ln(1 + x) && f(0) = 0 \\ f'(x) &= (1 + x)^{-1} && f'(0) = 1 \\ f''(x) &= -(1 + x)^{-2} && f''(0) = -1 \\ f'''(x) &= 2(1 + x)^{-3} && f'''(0) = 2 \end{aligned}P3(x)=x−x22+23!x3=x−x22+x33P_3(x) = x - \frac{x^2}{2} + \frac{2}{3!}x^3 = x - \frac{x^2}{2} + \frac{x^3}{3}

4. (Core) Find the third-degree Taylor polynomial for f(x)=1xf(x) = \dfrac{1}{x} about x=1x = 1, and use it to approximate 11.1\dfrac{1}{1.1}.

Solution

f(x)=x−1f(x) = x^{-1}, f′(x)=−x−2f'(x) = -x^{-2}, f′′(x)=2x−3f''(x) = 2x^{-3}, f′′′(x)=−6x−4f'''(x) = -6x^{-4}, so at x=1x = 1 the values are 1,−1,2,−61, -1, 2, -6.

P3(x)=1−(x−1)+22!(x−1)2−63!(x−1)3=1−(x−1)+(x−1)2−(x−1)3P_3(x) = 1 - (x - 1) + \frac{2}{2!}(x - 1)^2 - \frac{6}{3!}(x - 1)^3 = 1 - (x - 1) + (x - 1)^2 - (x - 1)^3

With x−1=0.1x - 1 = 0.1:

11.1≈1−0.1+0.01−0.001=0.909\frac{1}{1.1} \approx 1 - 0.1 + 0.01 - 0.001 = 0.909

(Check: 11.1≈0.90909\dfrac{1}{1.1} \approx 0.90909.)

5. (Core) Find the third-degree Taylor polynomial for f(x)=sin⁡xf(x) = \sin x about x=π6x = \dfrac{\pi}{6} (radians).

Solutionf(π6)=sin⁡π6=12f′(π6)=cos⁡π6=32f′′(π6)=−sin⁡π6=−12f′′′(π6)=−cos⁡π6=−32\begin{aligned} f\left(\tfrac{\pi}{6}\right) &= \sin\tfrac{\pi}{6} = \tfrac{1}{2} & f'\left(\tfrac{\pi}{6}\right) &= \cos\tfrac{\pi}{6} = \tfrac{\sqrt{3}}{2} \\ f''\left(\tfrac{\pi}{6}\right) &= -\sin\tfrac{\pi}{6} = -\tfrac{1}{2} & f'''\left(\tfrac{\pi}{6}\right) &= -\cos\tfrac{\pi}{6} = -\tfrac{\sqrt{3}}{2} \end{aligned}P3(x)=12+32(x−π6)−14(x−π6)2−312(x−π6)3P_3(x) = \frac{1}{2} + \frac{\sqrt{3}}{2}\left(x - \frac{\pi}{6}\right) - \frac{1}{4}\left(x - \frac{\pi}{6}\right)^2 - \frac{\sqrt{3}}{12}\left(x - \frac{\pi}{6}\right)^3

(The last two coefficients are −1/22!=−14-\dfrac{1/2}{2!} = -\dfrac{1}{4} and −3/23!=−312-\dfrac{\sqrt{3}/2}{3!} = -\dfrac{\sqrt{3}}{12}.)

6. (Core) A function ff has f(−1)=4f(-1) = 4, f′(−1)=0f'(-1) = 0, f′′(−1)=−6f''(-1) = -6 and f′′′(−1)=12f'''(-1) = 12.

  • (a) Write the third-degree Taylor polynomial for ff about x=−1x = -1.
  • (b) Use it to approximate f(−0.8)f(-0.8).
  • (c) Does ff have a relative maximum, a relative minimum, or neither at x=−1x = -1? Justify.
Solution

(a)

P3(x)=4+0(x+1)+−62!(x+1)2+123!(x+1)3=4−3(x+1)2+2(x+1)3P_3(x) = 4 + 0(x + 1) + \frac{-6}{2!}(x + 1)^2 + \frac{12}{3!}(x + 1)^3 = 4 - 3(x + 1)^2 + 2(x + 1)^3

(b) With x+1=0.2x + 1 = 0.2:

f(−0.8)≈4−3(0.04)+2(0.008)=3.896f(-0.8) \approx 4 - 3(0.04) + 2(0.008) = 3.896

(c) f′(−1)=0f'(-1) = 0 and f′′(−1)=−6<0f''(-1) = -6 \lt 0, so by the second derivative test, ff has a relative maximum at x=−1x = -1.

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

Solutiong(2)=7,g′(2)=1!⋅4=4,g′′(2)=2!⋅(−5)=−10,g′′′(2)=3!⋅23=4g(2) = 7, \qquad g'(2) = 1! \cdot 4 = 4, \qquad g''(2) = 2! \cdot (-5) = -10, \qquad g'''(2) = 3! \cdot \frac{2}{3} = 4

8. (Challenge) Find the third-degree Maclaurin polynomial for tan⁡x\tan x, and use it to approximate tan⁡0.1\tan 0.1 (radians).

Solutionf(x)=tan⁡xf(0)=0f′(x)=sec⁡2xf′(0)=1f′′(x)=2sec⁡2xtan⁡xf′′(0)=0f′′′(x)=4sec⁡2xtan⁡2x+2sec⁡4xf′′′(0)=2\begin{aligned} f(x) &= \tan x && f(0) = 0 \\ f'(x) &= \sec^2 x && f'(0) = 1 \\ f''(x) &= 2\sec^2 x \tan x && f''(0) = 0 \\ f'''(x) &= 4\sec^2 x \tan^2 x + 2\sec^4 x && f'''(0) = 2 \end{aligned}

(For f′′′f''', use the product rule on 2sec⁡2x⋅tan⁡x2\sec^2 x \cdot \tan x: the derivative of sec⁡2x\sec^2 x is 2sec⁡2xtan⁡x2\sec^2 x \tan x.)

P3(x)=x+23!x3=x+x33P_3(x) = x + \frac{2}{3!}x^3 = x + \frac{x^3}{3}tan⁡0.1≈0.1+0.0013≈0.100333\tan 0.1 \approx 0.1 + \frac{0.001}{3} \approx 0.100333

(Check: tan⁡0.1≈0.100335\tan 0.1 \approx 0.100335.)

9. (Challenge) Let y=f(x)y = f(x) be the solution of the differential equation dydx=x+y\dfrac{dy}{dx} = x + y with f(0)=1f(0) = 1. Find the third-degree Maclaurin polynomial for ff, and use it to approximate f(0.1)f(0.1).

Solution

You don’t need to solve the differential equation. Find each derivative at x=0x = 0 from the equation itself:

y′=x+yy′(0)=0+1=1y′′=1+y′y′′(0)=1+1=2y′′′=y′′y′′′(0)=2\begin{aligned} y' &= x + y && y'(0) = 0 + 1 = 1 \\ y'' &= 1 + y' && y''(0) = 1 + 1 = 2 \\ y''' &= y'' && y'''(0) = 2 \end{aligned}P3(x)=1+x+22!x2+23!x3=1+x+x2+x33P_3(x) = 1 + x + \frac{2}{2!}x^2 + \frac{2}{3!}x^3 = 1 + x + x^2 + \frac{x^3}{3}f(0.1)≈1+0.1+0.01+0.000333≈1.110f(0.1) \approx 1 + 0.1 + 0.01 + 0.000333 \approx 1.110

(Check: the exact solution is y=2ex−x−1y = 2e^x - x - 1, and f(0.1)≈1.110342f(0.1) \approx 1.110342.)