Taylor Polynomials
A Taylor polynomial approximates a function near a point x = a with a polynomial that matches the function’s value and its first n derivatives at a. The nth-degree Taylor polynomial is 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.
Before this lesson: Linear Approximation, Higher-Order Derivatives, Permutations and Combinations (for factorials) and Sigma Notation
The idea: match more derivatives
The tangent line at x = a matches a function’s value and slope there. That is the linear approximation, and it is the Taylor polynomial of degree 1.
A degree-2 polynomial can also match the second derivative, so it bends the same way the function bends. A degree-3 polynomial matches the third derivative too. Each new term makes the polynomial hug the function over a wider stretch near a.
The Taylor polynomial formula
P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^kWritten out, the first few terms are:
P_n(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \frac{f'''(a)}{3!}(x - a)^3 + \cdots- The point a is the center. The approximation is best near a.
- The coefficient of (x - a)^k is \frac{f^{(k)}(a)}{k!}. Remember that 0! = 1, 1! = 1, 2! = 2, 3! = 6 and 4! = 24.
- When a = 0, the polynomial is also called a Maclaurin polynomial.
- The degree is the highest power, not the number of terms. Some terms can be 0.
How to find a Taylor polynomial
- Find the derivatives of f up to order n.
- Evaluate each one at x = a.
- Divide the kth derivative value by k! to get each coefficient.
- Write the terms with powers of (x − a), not powers of x.
Taylor polynomial examples
Example 1: Maclaurin polynomial for eˣ
Find the third-degree Taylor polynomial of f(x) = e^x centered at a = 0, and use it to estimate e^{0.2}.
f(x) = e^x, \; f'(x) = e^x, \; f''(x) = e^x, \; f'''(x) = e^x
Every derivative of eˣ is eˣ (see derivatives of exponential functions).
f(0) = f'(0) = f''(0) = f'''(0) = e^0 = 1
Evaluate each one at a = 0.
P_3(x) = 1 + 1 \cdot x + \dfrac{1}{2!}x^2 + \dfrac{1}{3!}x^3Put the values into the formula.
P_3(x) = 1 + x + \dfrac{x^2}{2} + \dfrac{x^3}{6}2! = 2 and 3! = 6.
P_3(0.2) = 1 + 0.2 + \dfrac{0.04}{2} + \dfrac{0.008}{6}Substitute x = 0.2.
1 + 0.2 + 0.02 + 0.0013333 \approx 1.2213333
Divide, then add.
Answer: P_3(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}, and e^{0.2} \approx 1.22133. The true value is 1.22140 to five decimal places, so the error is less than 0.0001.
Example 2: Maclaurin polynomial for sin x
Find the fifth-degree Taylor polynomial of f(x) = \sin x centered at a = 0, and estimate sin 0.5 (in radians).
f(0) = \sin 0 = 0, \; f'(0) = \cos 0 = 1
The derivatives of sin x cycle: sin, cos, −sin, −cos (see derivatives of trig functions).
f''(0) = -\sin 0 = 0, \; f'''(0) = -\cos 0 = -1
Continue the cycle.
f^{(4)}(0) = \sin 0 = 0, \; f^{(5)}(0) = \cos 0 = 1The cycle repeats every four derivatives.
P_5(x) = 0 + 1 \cdot x + 0 - \dfrac{1}{3!}x^3 + 0 + \dfrac{1}{5!}x^5Put the values into the formula.
P_5(x) = x - \dfrac{x^3}{6} + \dfrac{x^5}{120}3! = 6 and 5! = 120.
P_5(0.5) = 0.5 - \dfrac{0.125}{6} + \dfrac{0.03125}{120}Substitute x = 0.5.
0.5 - 0.0208333 + 0.0002604 \approx 0.4794271
Divide, then combine.
Answer: P_5(x) = x - \frac{x^3}{6} + \frac{x^5}{120}, and sin 0.5 ≈ 0.479427. The true value is 0.479426 to six decimal places. Only odd powers appear, because sin x is an odd function.
Example 3: Centered at a = 1
Find the third-degree Taylor polynomial of f(x) = \ln x centered at a = 1, and estimate ln 1.1.
f(x) = \ln x, \; f'(x) = \dfrac{1}{x}The derivative of ln x is 1/x (see derivatives of logarithmic functions).
f''(x) = -\dfrac{1}{x^2}, \; f'''(x) = \dfrac{2}{x^3}Use the power rule on x⁻¹ and then on −x⁻².
f(1) = 0, \; f'(1) = 1, \; f''(1) = -1, \; f'''(1) = 2
Evaluate each one at a = 1.
P_3(x) = 0 + 1(x - 1) - \dfrac{1}{2!}(x - 1)^2 + \dfrac{2}{3!}(x - 1)^3Put the values into the formula, with powers of (x − 1).
P_3(x) = (x - 1) - \dfrac{(x - 1)^2}{2} + \dfrac{(x - 1)^3}{3}2/3! = 2/6 = 1/3.
P_3(1.1) = 0.1 - \dfrac{0.01}{2} + \dfrac{0.001}{3}Substitute x = 1.1, so x − 1 = 0.1.
0.1 - 0.005 + 0.0003333 \approx 0.0953333
Divide, then combine.
Answer: P_3(x) = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3}, and ln 1.1 ≈ 0.09533. The true value is 0.09531 to five decimal places.
Example 4: A square root centered at a = 4
Find the second-degree Taylor polynomial of f(x) = \sqrt{x} centered at a = 4, and estimate \sqrt{4.2}.
f(x) = x^{1/2}, \; f'(x) = \dfrac{1}{2}x^{-1/2}, \; f''(x) = -\dfrac{1}{4}x^{-3/2}Use the power rule twice.
f(4) = 2, \; f'(4) = \dfrac{1}{2} \cdot \dfrac{1}{2} = \dfrac{1}{4}4 to the 1/2 is 2, and 4 to the −1/2 is 1/2 (see rational exponents).
f''(4) = -\dfrac{1}{4} \cdot \dfrac{1}{8} = -\dfrac{1}{32}4 to the 3/2 is 8, so 4 to the −3/2 is 1/8.
P_2(x) = 2 + \dfrac{1}{4}(x - 4) - \dfrac{1}{32 \cdot 2!}(x - 4)^2Put the values into the formula.
P_2(x) = 2 + \dfrac{x - 4}{4} - \dfrac{(x - 4)^2}{64}32 · 2 = 64.
P_2(4.2) = 2 + \dfrac{0.2}{4} - \dfrac{0.04}{64}Substitute x = 4.2, so x − 4 = 0.2.
2 + 0.05 - 0.000625 = 2.049375
Divide, then combine.
Answer: \sqrt{4.2} \approx 2.049375. The true value is 2.049390 to six decimal places, so the error is about 0.000015.
Example 5: Height of a drone (word problem)
At t = 2 seconds, a drone is 50 m high, rising at 4 m/s. Its acceleration is −1.2 m/s², and the third derivative of its height is 0.3 m/s³. Use a third-degree Taylor polynomial to estimate its height at t = 2.5 s.
P_3(t) = h(2) + h'(2)(t - 2) + \dfrac{h''(2)}{2!}(t - 2)^2 + \dfrac{h'''(2)}{3!}(t - 2)^3Write the formula with center a = 2.
P_3(t) = 50 + 4(t - 2) - \dfrac{1.2}{2}(t - 2)^2 + \dfrac{0.3}{6}(t - 2)^3Put in the given values; 2! = 2 and 3! = 6.
P_3(t) = 50 + 4(t - 2) - 0.6(t - 2)^2 + 0.05(t - 2)^3
Divide to simplify the coefficients.
P_3(2.5) = 50 + 4(0.5) - 0.6(0.25) + 0.05(0.125)
t − 2 = 0.5, (0.5)² = 0.25 and (0.5)³ = 0.125.
50 + 2 - 0.15 + 0.00625 = 51.85625
Multiply, then combine.
Answer: the drone is about 51.86 m high at t = 2.5 s.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Leaving out the factorials | P_2(x) = 1 + x + x^2 for eˣ | Divide by k!: the x² term is \frac{x^2}{2!} = \frac{x^2}{2}. |
| Using powers of x when a ≠ 0 | For ln x at a = 1, writing x - \frac{x^2}{2} | Use powers of (x − a): (x - 1) - \frac{(x - 1)^2}{2}. |
| Keeping x in the coefficients | Writing \frac{1}{x}(x - 1) as a term | Evaluate each derivative at a: f′(1) = 1, so the term is (x − 1). |
| Counting terms instead of the degree | Stopping sin x at x - \frac{x^3}{6} + \frac{x^5}{120} - \frac{x^7}{5040} for “degree 5” | Degree 5 means powers up to x⁵, even though some terms are 0. |
| Treating 0! as 0 | Dividing f(a) by 0! = 0 | By definition 0! = 1, so the first term is just f(a). |
| Trusting it far from the center | Using the eˣ polynomial at 0 to estimate e⁵ | The approximation is good near a. Far away, use a new center or a higher degree. |
Related methods
Linear approximation is the degree-1 case
P_1(x) = f(a) + f'(a)(x - a) is the tangent line, the same linearization from Calculus 1. A Taylor polynomial just keeps adding terms.
From Taylor polynomials to Taylor series
If you keep adding terms forever, you get a Taylor series, an infinite series that can equal the function exactly on some interval. Later lessons in this unit cover how far off a Taylor polynomial can be and when the series converges.
Practice problems
- Find the second-degree Maclaurin polynomial of \cos x.
- Find the third-degree Maclaurin polynomial of e^{2x}.
- Find the third-degree Taylor polynomial of f(x) = \dfrac{1}{x} centered at a = 1.
- Find the second-degree Taylor polynomial of \sqrt{x} centered at a = 9, and use it to estimate \sqrt{9.3}.
- Use the fourth-degree Maclaurin polynomial of \cos x to estimate cos 0.3.
- Find the third-degree Maclaurin polynomial of \ln(1 + x), and use it to estimate ln 1.2.
- A function has f(2) = 3, f′(2) = −1, f″(2) = 4 and f‴(2) = 12. Write its third-degree Taylor polynomial at a = 2 and estimate f(2.1).
- The second-degree Taylor polynomial of f at a = 1 is 5 - 3(x - 1) + 6(x - 1)^2. Find f(1), f′(1) and f″(1).
- Find the third-degree Taylor polynomial of \sin x centered at a = \frac{\pi}{2}.
- A cup of coffee is 90°C at t = 0 min. Its temperature is falling 6°C per minute, and the second derivative of its temperature is 0.4°C/min². Use a second-degree Taylor polynomial to estimate its temperature at t = 1.5 min.
Show answers
1.
f(0) = \cos 0 = 1, \; f'(0) = -\sin 0 = 0, \; f''(0) = -\cos 0 = -1
Find and evaluate the derivatives at 0.
P_2(x) = 1 + 0 \cdot x - \dfrac{1}{2!}x^2Put the values into the formula.
Answer: P_2(x) = 1 - \dfrac{x^2}{2}
2.
f^{(k)}(x) = 2^k e^{2x}Each derivative brings out another factor of 2 (see chain rule).
f(0) = 1, \; f'(0) = 2, \; f''(0) = 4, \; f'''(0) = 8
Evaluate at 0: e⁰ = 1.
P_3(x) = 1 + 2x + \dfrac{4}{2!}x^2 + \dfrac{8}{3!}x^3Put the values into the formula.
Answer: P_3(x) = 1 + 2x + 2x^2 + \dfrac{4}{3}x^3
3.
f' = -x^{-2}, \; f'' = 2x^{-3}, \; f''' = -6x^{-4}Write 1/x as x⁻¹ and use the power rule.
f(1) = 1, \; f'(1) = -1, \; f''(1) = 2, \; f'''(1) = -6
Evaluate at a = 1.
P_3(x) = 1 - (x - 1) + \dfrac{2}{2!}(x - 1)^2 - \dfrac{6}{3!}(x - 1)^3Put the values into the formula.
Answer: P_3(x) = 1 - (x - 1) + (x - 1)^2 - (x - 1)^3
4.
f(9) = 3, \; f'(9) = \dfrac{1}{2 \cdot 3} = \dfrac{1}{6}f′(x) = 1/(2√x).
f''(9) = -\dfrac{1}{4 \cdot 27} = -\dfrac{1}{108}f″(x) = −1/(4x³ᐟ²), and 9 to the 3/2 is 27.
P_2(x) = 3 + \dfrac{x - 9}{6} - \dfrac{(x - 9)^2}{216}Divide f″(9) by 2!: 108 · 2 = 216.
P_2(9.3) = 3 + \dfrac{0.3}{6} - \dfrac{0.09}{216}x − 9 = 0.3.
3 + 0.05 - 0.0004167 \approx 3.0495833
Divide, then combine.
Answer: \sqrt{9.3} \approx 3.04958 (true value 3.04959)
5.
P_4(x) = 1 - \dfrac{x^2}{2!} + \dfrac{x^4}{4!} = 1 - \dfrac{x^2}{2} + \dfrac{x^4}{24}The derivatives at 0 are 1, 0, −1, 0, 1.
P_4(0.3) = 1 - \dfrac{0.09}{2} + \dfrac{0.0081}{24}Substitute x = 0.3.
1 - 0.045 + 0.0003375 = 0.9553375
Divide, then combine.
Answer: cos 0.3 ≈ 0.9553375 (true value 0.9553365)
6.
f' = \dfrac{1}{1 + x}, \; f'' = -\dfrac{1}{(1 + x)^2}, \; f''' = \dfrac{2}{(1 + x)^3}Differentiate ln(1 + x) three times.
f(0) = 0, \; f'(0) = 1, \; f''(0) = -1, \; f'''(0) = 2
Evaluate at 0.
P_3(x) = x - \dfrac{x^2}{2} + \dfrac{x^3}{3}Divide by 1!, 2! and 3!: 2/6 = 1/3.
P_3(0.2) = 0.2 - 0.02 + 0.0026667 \approx 0.1826667
0.04/2 = 0.02 and 0.008/3 ≈ 0.0026667.
Answer: ln 1.2 ≈ 0.18267 (true value 0.18232)
7.
P_3(x) = 3 - (x - 2) + \dfrac{4}{2!}(x - 2)^2 + \dfrac{12}{3!}(x - 2)^3Put the values into the formula.
P_3(x) = 3 - (x - 2) + 2(x - 2)^2 + 2(x - 2)^3
4/2 = 2 and 12/6 = 2.
P_3(2.1) = 3 - 0.1 + 2(0.01) + 2(0.001)
x − 2 = 0.1.
3 - 0.1 + 0.02 + 0.002 = 2.922
Multiply, then combine.
Answer: P_3(x) = 3 - (x - 2) + 2(x - 2)^2 + 2(x - 2)^3, and f(2.1) ≈ 2.922
8.
f(1) = 5, \; f'(1) = -3
The constant term is f(1); the (x − 1) coefficient is f′(1).
\dfrac{f''(1)}{2!} = 6The (x − 1)² coefficient is f″(1)/2!.
f''(1) = 6 \cdot 2 = 12
Multiply both sides by 2.
Answer: f(1) = 5, f′(1) = −3, f″(1) = 12
9.
f\left(\tfrac{\pi}{2}\right) = 1, \; f'\left(\tfrac{\pi}{2}\right) = \cos \tfrac{\pi}{2} = 0sin(π/2) = 1 (see unit circle).
f''\left(\tfrac{\pi}{2}\right) = -\sin \tfrac{\pi}{2} = -1, \; f'''\left(\tfrac{\pi}{2}\right) = -\cos \tfrac{\pi}{2} = 0Continue the derivative cycle.
P_3(x) = 1 + 0 - \dfrac{1}{2!}\left(x - \dfrac{\pi}{2}\right)^2 + 0Put the values into the formula.
Answer: P_3(x) = 1 - \dfrac{1}{2}\left(x - \dfrac{\pi}{2}\right)^2 (the cubic term is 0)
10.
P_2(t) = 90 - 6t + \dfrac{0.4}{2!}t^2 = 90 - 6t + 0.2t^2Center a = 0; “falling 6°C per minute” means T′(0) = −6.
P_2(1.5) = 90 - 6(1.5) + 0.2(2.25)
Substitute t = 1.5; 1.5² = 2.25.
90 - 9 + 0.45 = 81.45
Multiply, then combine.
Answer: about 81.45°C
Taylor polynomial FAQ
What is a Taylor polynomial?
It is a polynomial that matches a function’s value and first n derivatives at one point, x = a. Near that point, it is a good approximation of the function.
What is the difference between a Taylor polynomial and a Taylor series?
A Taylor polynomial stops at a finite degree n. A Taylor series keeps going forever, and on its interval of convergence it can equal the function exactly.
What is a Maclaurin polynomial?
It is a Taylor polynomial centered at a = 0. For example, 1 + x + \frac{x^2}{2} is the second-degree Maclaurin polynomial of e^x.
How do you find the coefficient of (x − a)ᵏ?
Take the kth derivative, evaluate it at a, and divide by k!. So the coefficient is \frac{f^{(k)}(a)}{k!}.
Summary
- P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x - a)^k matches f and its first n derivatives at x = a.
- Find the derivatives, evaluate them at a, and divide by k!.
- Use powers of (x − a). A center of a = 0 gives a Maclaurin polynomial.
- Degree 1 is the tangent line. Higher degrees stay accurate over a wider interval.
- Approximations are best near the center.
Previous lesson: Choosing a Convergence Test
Next lesson: Alternating Series Error Bound
Back to the Calculus 2 Index