Taylor Polynomials
A computer can only add, subtract, multiply, and divide—so how does your calculator compute \(\sin(0.5)\) or \(e^1\)? It replaces the curvy function with a polynomial that matches it near a starting point. That's a Taylor polynomial.
By the end you can
- Understand why the \(k!\) appears in the Taylor polynomial formula
- Build an \(n\)th-degree Taylor polynomial \(P_n(x)\) centered at any \(x = a\)
- Construct Taylor polynomials from a table of derivatives (classic AP FRQ!)
- Work backwards: read \(f^{(k)}(a)\) straight off the coefficients of \(P_n(x)\)
- Differentiate or integrate a Taylor polynomial to get the polynomial for \(f'\) or \(\int f\)
From tangent lines to Taylor polynomials
In AB, you already built the degree-1 Taylor polynomial: the tangent line at \(x = a\)!
\[ P_1(x) = f(a) + f'(a)(x - a) \]It matches \(f\) in value and slope at \(x = a\). To hug the curve even tighter, add a quadratic term to match the concavity (\(f''(a)\)), a cubic term to match \(f'''(a)\), and so on:
\[ P_n(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + c_3(x-a)^3 + \dots + c_n(x-a)^n \]Where does \(k!\) come from? Differentiate \((x-a)^3\) three times: first you get \(3(x-a)^2\), then \(3\cdot 2(x-a)\), then \(3\cdot 2\cdot 1 = 3!\). So for \(P'''(a)\) to equal \(f'''(a)\), we need \(c_3 \cdot 3! = f'''(a)\), which forces \(c_3 = \dfrac{f'''(a)}{3!}\). The same thing happens at every power \(k\):
When the center is \(a = 0\), a Taylor polynomial has a special nickname: a Maclaurin polynomial.
Drag the degree \(n\) up and watch \(P_n(x)\) wrap tighter around \(f(x)\). Try \(\ln(1+x)\) and \(\frac{1}{1-x}\) too—notice how the polynomial refuses to match past \(|x| = 1\) (a preview of Radius of Convergence!).
Building Taylor polynomials (4 worked examples)
Make a quick 2-column scratch table of \(f^{(k)}(x)\) and \(f^{(k)}(a)\), then plug into the formula.
Find the 3rd-degree Maclaurin polynomial \(P_3(x)\) for \(f(x) = e^x\).
- Every derivative of \(e^x\) is \(e^x\), so at \(a = 0\): \(f(0) = f'(0) = f''(0) = f'''(0) = e^0 = 1\).
- Plug into the formula with \(a = 0\): \[ P_3(x) = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} \]
Find the 4th-degree Maclaurin polynomial \(P_4(x)\) for \(f(x) = \cos x\).
- List derivatives at \(a = 0\):
- \(f(0) = \cos 0 = 1\)
- \(f'(0) = -\sin 0 = 0\)
- \(f''(0) = -\cos 0 = -1\)
- \(f'''(0) = \sin 0 = 0\)
- \(f^{(4)}(0) = \cos 0 = 1\)
- Plug in (the odd terms vanish!): \[ P_4(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} = 1 - \frac{x^2}{2} + \frac{x^4}{24} \] Notice \(P_4(x)\) has degree 4, even though it only has 3 nonzero terms!
Find the 3rd-degree Taylor polynomial for \(f(x) = \ln x\) centered at \(a = 1\).
- Compute derivatives and evaluate at \(a = 1\):
- \(f(x) = \ln x \Rightarrow f(1) = 0\)
- \(f'(x) = x^{-1} \Rightarrow f'(1) = 1\)
- \(f''(x) = -x^{-2} \Rightarrow f''(1) = -1\)
- \(f'''(x) = 2x^{-3} \Rightarrow f'''(1) = 2\)
- Plug into \(P_3(x)\) with powers of \((x - 1)\): \[ P_3(x) = 0 + 1(x-1) + \frac{-1}{2!}(x-1)^2 + \frac{2}{3!}(x-1)^3 \]
- Simplify \(\frac{2}{6} = \frac{1}{3}\):
Find the 2nd-degree Taylor polynomial for \(f(x) = \sqrt{x}\) centered at \(a = 4\), and use it to approximate \(\sqrt{4.1}\).
- Derivatives at \(a = 4\):
- \(f(4) = \sqrt{4} = 2\)
- \(f'(x) = \frac12 x^{-1/2} \Rightarrow f'(4) = \frac14\)
- \(f''(x) = -\frac14 x^{-3/2} \Rightarrow f''(4) = -\frac{1}{32}\)
- Build \(P_2(x)\) (don't forget to divide \(f''(4)\) by \(2! = 2\)!): \[ P_2(x) = 2 + \frac{1}{4}(x-4) - \frac{1}{64}(x-4)^2 \]
- Plug in \(x = 4.1\) (so \(x - 4 = 0.1\)): \[ P_2(4.1) = 2 + \frac{0.1}{4} - \frac{0.01}{64} = 2 + 0.025 - 0.00015625 \approx 2.02484 \] The exact value is \(\sqrt{4.1} \approx 2.02485\)—accurate to 4 decimal places from just three terms!
Two huge AP skills: tables & working backwards
Skill 1: Building from a table of derivatives
On FRQs, AP rarely asks you to differentiate an ugly formula 4 times—it hands you a table of \(f(a), f'(a), f''(a), \dots\) directly!
A function \(f\) has derivatives of all orders with \(f(2) = -3,\; f'(2) = 5,\; f''(2) = 4,\; f'''(2) = -12\). Write the 3rd-degree Taylor polynomial for \(f\) about \(x = 2\).
- Plug straight into the formula (remember \(x - 2\) and \(k!\)): \[ P_3(x) = -3 + 5(x-2) + \frac{4}{2!}(x-2)^2 + \frac{-12}{3!}(x-2)^3 \]
- Simplify: \(-3 + 5(x-2) + 2(x-2)^2 - 2(x-2)^3\).
Skill 2: Working backwards (reading derivatives from coefficients)
Since the coefficient of \((x - a)^k\) is \(c_k = \dfrac{f^{(k)}(a)}{k!}\), solving for \(f^{(k)}(a)\) gives:
Suppose the 3rd-degree Taylor polynomial for \(g\) about \(x = 5\) is \(P_3(x) = 7 - 4(x-5)^2 + \tfrac12(x-5)^3\). Find \(g(5), g'(5), g''(5), g'''(5)\), and determine if \(g\) has a relative max, min, or neither at \(x = 5\).
- Match each coefficient \(c_k\) and multiply by \(k!\):
- \(g(5) = 0!\cdot 7 = 7\)
- \(g'(5) = 1!\cdot 0 = 0\) (there is no \((x-5)^1\) term!)
- \(g''(5) = 2!\cdot (-4) = -8\)
- \(g'''(5) = 3!\cdot \tfrac12 = 3\)
- Second Derivative Test: since \(g'(5) = 0\) and \(g''(5) = -8 < 0\), \(g\) has a relative maximum at \(x = 5\).
If \(P(x)\) is the Taylor polynomial for \(f(x)\), then \(P'(x)\) is the Taylor polynomial for \(f'(x)\), and \(\int_a^x P(t)\,dt\) is the Taylor polynomial for \(\int_a^x f(t)\,dt\)! For example, differentiating \(P_4(x) = 1 - \frac{x^2}{2} + \frac{x^4}{24}\) for \(\cos x\) gives \(-x + \frac{x^3}{6}\), which is \(P_3(x)\) for \(-\sin x\). We'll use this power tool constantly in Taylor & Maclaurin Series.
If the Taylor polynomial for \(f\) about \(x = 3\) is \(P_3(x) = 2 + 6(x-3) - 5(x-3)^2 + 4(x-3)^3\), what is \(f'''(3)\)?
Careful with wording! What is the difference between "the 3rd-degree Maclaurin polynomial for \(\sin x\)" and "the first 3 nonzero terms of the Maclaurin series for \(\sin x\)"?
Common mistakes
- Forgetting the \(k!\) in the denominator (or forgetting to multiply by \(k!\) when reading \(f^{(k)}(a)\) back out!).
- Writing \(x^k\) instead of \((x - a)^k\) when the center \(a\) is not \(0\).
- Confusing "degree \(n\)" with "\(n\) nonzero terms."
- Writing \(f(x) = P_n(x)\) instead of \(f(x) \approx P_n(x)\) — a finite polynomial is only an approximation (the exact equality holds only for the infinite Taylor series).
Practice problems
Write the 5th-degree Maclaurin polynomial for \(f(x) = \sin x\).
Hint
Derivatives of \(\sin x\) at \(0\) cycle: \(0, 1, 0, -1, 0, 1\).
Solution
Find the 3rd-degree Taylor polynomial for \(f(x) = \dfrac{1}{x}\) centered at \(a = 1\).
Hint
\(f(1)=1,\; f'(1)=-1,\; f''(1)=2,\; f'''(1)=-6\). Notice how the factorials cancel completely!
Solution
Let \(f\) satisfy \(f(3) = 4,\; f'(3) = -2,\; f''(3) = 6,\; f'''(3) = 18\).
(a) Write \(P_3(x)\) centered at \(x = 3\).
(b) Use \(P_3(x)\) to approximate \(f(3.1)\).
Hint
Divide \(6\) by \(2!\) and \(18\) by \(3!\), then plug in \(x - 3 = 0.1\).
Solution
(a) \(P_3(x) = 4 - 2(x-3) + 3(x-3)^2 + 3(x-3)^3\).
(b) \(P_3(3.1) = 4 - 2(0.1) + 3(0.01) + 3(0.001) = 4 - 0.2 + 0.03 + 0.003 = 3.833\).
The 4th-degree Taylor polynomial for \(h(x)\) about \(x = -1\) is \(P_4(x) = 5 + 3(x+1)^2 - \frac14(x+1)^4\). Find \(h'(-1)\), \(h''(-1)\), and \(h^{(4)}(-1)\), and determine whether \(h\) has a relative min, max, or neither at \(x = -1\).
Hint
Use \(h^{(k)}(-1) = k!\cdot c_k\). Look for the missing \((x+1)^1\) term.
Solution
\(h'(-1) = 0\), \(h''(-1) = 2!\cdot 3 = 6\), \(h^{(4)}(-1) = 4!\cdot(-\frac14) = -6\).
Since \(h'(-1) = 0\) and \(h''(-1) = 6 > 0\), \(h\) has a relative minimum at \(x = -1\).
Using \(P_3(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6}\) for \(e^x\), write the 4th-degree Maclaurin polynomial for \(g(x) = \displaystyle\int_0^x e^t\,dt\) and the 2nd-degree Maclaurin polynomial for \(h(x) = e^{2x}\).
Hint
Integrate \(P_3(t)\) term-by-term for \(g\); substitute \(2x\) for \(x\) in \(P_2\) for \(h\).
Solution
For \(g(x)\): \(\int_0^x (1 + t + \frac{t^2}{2} + \frac{t^3}{6})\,dt = x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24}\).
For \(h(x) = e^{2x}\): \(1 + (2x) + \frac{(2x)^2}{2} = 1 + 2x + 2x^2\).