AP Calculus BC · Infinite sequences and series
Taylor and Maclaurin polynomials
1Matching a function with a polynomial
A Taylor polynomial approximates $f(x)$ near $x = a$ by matching the value and the first $n$ derivatives at $a$:
$$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$$
- When $a = 0$ it is called a Maclaurin polynomial.
- $P_1$ is the tangent line (linearization). Each extra term bends the polynomial to fit the curve better near $a$.
- The coefficient of $(x - a)^k$ is $\frac{f^{(k)}(a)}{k!}$. So if you know a coefficient you can recover a derivative: $f^{(k)}(a) = k! \times \text{coefficient}$.
Maclaurin polynomials for sin x hug the curve over a wider range as the degree rises
Check yourself
The coefficient of x³ in the Maclaurin polynomial of f is:
Show the answer
f‴(0)/3!
Divide the derivative by k!.
2Building a Taylor polynomial
Maclaurin polynomial of degree 4 for $e^x$.
- Every derivative is $e^x$, so $f^{(k)}(0) = 1$.
- $P_4(x) = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24}$.
- $P_4(1) = 2.7083$, close to $e \approx 2.7183$.
Taylor polynomial of degree 3 for $\ln x$ about $x = 1$.
- $f(1) = 0$; $f' = \frac{1}{x} \to 1$; $f'' = -\frac{1}{x^2} \to -1$; $f''' = \frac{2}{x^3} \to 2$.
- $P_3(x) = (x - 1) - \frac{(x - 1)^2}{2} + \frac{(x - 1)^3}{3}$.
- $P_3(1.1) = 0.1 - 0.005 + 0.000333 = 0.095333$; true $\ln 1.1 = 0.095310$.
Worked example (from a table): $f(2) = 3$, $f'(2) = -1$, $f''(2) = 4$, $f'''(2) = 12$.
- $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$.
Check yourself
If f(0) = 2, f′(0) = 3 and f″(0) = 10, the second-degree Maclaurin polynomial is:
Show the answer
2 + 3x + 5x²
10/2! = 5.
3Series you should know
The polynomials extend to infinite Taylor series. Learn these Maclaurin series:
- $e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots = \sum\frac{x^n}{n!}$, for all $x$.
- $\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots = \sum\frac{(-1)^n x^{2n+1}}{(2n + 1)!}$, for all $x$.
- $\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \cdots = \sum\frac{(-1)^n x^{2n}}{(2n)!}$, for all $x$.
- $\frac{1}{1 - x} = 1 + x + x^2 + x^3 + \cdots$, for $|x| < 1$.
Make new series from old by substituting, multiplying, differentiating or integrating:
- $e^{-x^2} = 1 - x^2 + \frac{x^4}{2!} - \frac{x^6}{3!} + \cdots$ (replace $x$ by $-x^2$).
- $x\cos x = x - \frac{x^3}{2!} + \frac{x^5}{4!} - \cdots$
- $\frac{1}{1 + x^2} = 1 - x^2 + x^4 - \cdots$; integrating gives $\arctan x = x - \frac{x^3}{3} + \frac{x^5}{5} - \cdots$
- Differentiating the $\sin x$ series term by term gives the $\cos x$ series.
Check yourself
The Maclaurin series for e^(2x) begins:
Show the answer
1 + 2x + 2x² + (4/3)x³ + ⋯
Replace x by 2x: (2x)²/2 = 2x².
4The Lagrange error bound
For any Taylor polynomial (alternating or not), the error satisfies
$$|f(x) - P_n(x)| \le \frac{M}{(n + 1)!}|x - a|^{n+1}$$
where $M$ is the maximum of $|f^{(n+1)}|$ between $a$ and $x$.
bound the error when $P_3(x)$ for $e^x$ about 0 is used to estimate $e^{0.5}$.
- $f^{(4)}(x) = e^x$; on $[0, 0.5]$, $|f^{(4)}| \le e^{0.5} < 2$. Take $M = 2$.
- Error $\le \frac{2}{4!}(0.5)^4 = \frac{2}{24}\cdot 0.0625 \approx 0.0052$.
for $\sin x$, every derivative is $\pm\sin x$ or $\pm\cos x$, so $M = 1$ always works.
Check yourself
In the Lagrange error bound for Pₙ, M bounds:
Show the answer
|f^(n+1)| between a and x
The next derivative.
5Going deeper: building polynomials from derivative values, and bounding the error
The Taylor polynomial of degree n for f centered at x = a is
$$P_n(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \dots + \frac{f^{(n)}(a)}{n!}(x - a)^n$$
It matches f and its first n derivatives at a. A Maclaurin polynomial has a = 0.
The coefficient of $(x - a)^k$ is $\frac{f^{(k)}(a)}{k!}$. Read both ways: from derivatives to coefficients, and from coefficients to derivatives.
Worked example (from derivative values): f(2) = 3, f′(2) = −1, f″(2) = 4, f‴(2) = 6.
- $P_3(x) = 3 - (x - 2) + \frac{4}{2}(x - 2)^2 + \frac{6}{6}(x - 2)^3$.
- $= 3 - (x - 2) + 2(x - 2)^2 + (x - 2)^3$.
- $f(2.1) \approx 3 - 0.1 + 0.02 + 0.001 = 2.921$.
Worked example (from a polynomial to a derivative): the Taylor polynomial about x = 0 contains the term $-\frac{5}{6}x^4$. Find $f^{(4)}(0)$.
- $\frac{f^{(4)}(0)}{4!} = -\frac{5}{6}$.
- $f^{(4)}(0) = -\frac{5}{6}(24) = -20$.
Maclaurin series to memorize
- $e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots$
- $\sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots$
- $\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots$
- $\frac{1}{1 - x} = 1 + x + x^2 + x^3 + \dots$ (|x| < 1)
- $\ln(1 + x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \dots$
Building new series from old ones (far quicker than differentiating)
- Substitute: $\sin(x^2) = x^2 - \frac{x^6}{6} + \frac{x^{10}}{120} - \dots$; $e^{-3x} = 1 - 3x + \frac{9x^2}{2} - \dots$
- Multiply: $x\cos x = x - \frac{x^3}{2} + \frac{x^5}{24} - \dots$
- Differentiate or integrate term by term.
Using a polynomial to study f at a: if $P_2(x) = 4 + 0(x - 1) - 3(x - 1)^2$, then f′(1) = 0 and f″(1) = −6 < 0: f has a local maximum at x = 1.
Lagrange error bound: the error in using $P_n$ at x satisfies
$$|f(x) - P_n(x)| \le \frac{M}{(n + 1)!}|x - a|^{n+1}$$
where M is an upper bound for $|f^{(n+1)}|$ between a and x.
approximate sin 0.5 with $P_3(x) = x - \frac{x^3}{6}$.
- $P_3(0.5) = 0.5 - 0.02083 = 0.47917$.
- $P_3$ is also $P_4$ (the $x^4$ term is zero), so use n = 4: the fifth derivative is ±cos x, bounded by M = 1.
- Error ≤ $\frac{(0.5)^5}{5!} = \frac{0.03125}{120} = 0.00026$.
- True value 0.47943: the actual error is 0.00026, within the bound.
Worked example (given a bound on a derivative): $|f^{(4)}(x)| \le 6$ for all x in [1, 1.5], and $P_3$ is centered at 1. Bound the error at x = 1.5.
- $\frac{6}{4!}(0.5)^4 = \frac{6}{24}(0.0625) = 0.0156$.
Alternating series bound as an alternative: when the Taylor series at the given x is alternating with decreasing terms, the error is at most the first omitted term (as in the sine example: $\frac{0.5^5}{120}$).
Common mistakes
- Forgetting the factorials.
- Using $x^k$ in place of $(x - a)^k$ when a ≠ 0.
- Using the n-th derivative, not the (n + 1)-th, in the error bound.
- Confusing the degree of the polynomial with the number of terms.
- Expanding $\sin(x^2)$ by differentiating repeatedly.
Check yourself
The third-degree Taylor polynomial for f about x = 0 is 2 + 5x − 3x² + 4x³. What is f″(0)?
Show the answer
−6
The coefficient of x² equals f″(0) ÷ 2!, so f″(0) = −3 × 2.
6For top marks
- Write each coefficient as $\frac{f^{(k)}(a)}{k!}$ and remember the factorials.
- Use powers of $(x - a)$, not $x$, when the centre is not 0.
- Name the error bound you use: alternating series bound (if the series alternates with decreasing terms) or Lagrange bound (always).
- To find $f^{(k)}(a)$ from a series, multiply the coefficient by $k!$.
"The coefficient of $x^5$ in the series for $f$ is $\frac{1}{20}$, so $f^{(5)}(0) = 5! \times \frac{1}{20} = 6$."
Check yourself
The coefficient of (x − 1)⁴ in a Taylor series about x = 1 is 3/8. Then f⁽⁴⁾(1) =
Show the answer
9
4! × 3/8 = 24 × 3/8.
Now test yourself
This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.
Practise in Impera