Step 30: Taylor and Maclaurin Series
- AP Calculus BC only (AP topics 10.11 to 10.15), plus IB AA HL 5.19, which examines Maclaurin series. It is not in AP Calculus AB, and Cambridge 9709 has no Taylor or Maclaurin series; its nearest topic is the binomial expansion.
- The Taylor polynomial of degree \( n \) about \( x = a \) copies the value and the first \( n \) derivatives of \( f \) at \( a \): \( P_n(x) = \displaystyle\sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-a)^k \). About \( a = 0 \) it is called a Maclaurin polynomial.
- The Lagrange error bound says \( |f(x)-P_n(x)| \le \dfrac{M|x-a|^{n+1}}{(n + 1)!} \), where \( M \) bounds \( |f^{(n+1)}| \) between \( a \) and \( x \). A power series converges on an interval: find the radius with the ratio test, then test both endpoints separately.
- Exam point: learn the series for \( e^x \), \( \sin x \), \( \cos x \), \( \dfrac{1}{1-x} \), \( \ln(1 + x) \) and \( \tan^{-1} x \), and build new ones by substituting, multiplying, differentiating or integrating, rather than by finding many derivatives.
Taylor polynomials: matching derivatives
AP Calculus BC only; IB HL 5.19 for Maclaurin series. Your calculator can only add, subtract, multiply and divide. So how does it find \( \cos 0.3 \)? It uses a polynomial that behaves almost exactly like \( \cos x \) near the point it cares about. This step shows how to build that polynomial and how to guarantee its accuracy.
In Step 16, the tangent line \( L(x) = f(a) + f'(a)(x-a) \) copied the value and the gradient of \( f \) at \( a \). To do better, also copy the concavity, then the third derivative, and so on. Suppose \( P(x) = c_0 + c_1(x-a) + c_2(x-a)^2 + \cdots + c_n(x-a)^n \) and we want \( P^{(k)}(a) = f^{(k)}(a) \). Differentiate \( k \) times and put \( x = a \): lower powers have been differentiated away and higher powers still contain a factor \( (x-a) = 0 \). Only \( k!\,c_k \) is left, so \( c_k = \dfrac{f^{(k)}(a)}{k!} \).
Written out, \( P_n(x) = f(a) + f'(a)(x-a) + \dfrac{f”(a)}{2!}(x-a)^2 + \cdots + \dfrac{f^{(n)}(a)}{n!}(x-a)^n \).
Find the third-degree Taylor polynomial for \( f(x) = \ln x \) about \( x = 1 \), and use it to estimate \( \ln 1.2 \).
The true value is \( \ln 1.2 = 0.182322 \) (6 d.p.), so three terms are already right to three decimal places.
AP questions often give the derivatives as numbers in a table instead of a formula. The method is the same: each derivative is divided by its own factorial.
A function has \( f(0) = 2 \), \( f'(0) = -3 \), \( f”(0) = 5 \) and \( f”'(0) = -12 \). Write the third-degree Maclaurin polynomial for \( f \), and use it to estimate \( f(0.2) \).
A common slip is to forget the factorials and write \( 5x^2-12x^3 \). The coefficient of \( x^k \) is \( \dfrac{f^{(k)}(0)}{k!} \), never \( f^{(k)}(0) \) on its own.
How accurate is it? The Lagrange error bound
AP Calculus BC only. An approximation is only useful if you know how wrong it might be. Lagrange showed that the exact error is \( \dfrac{f^{(n+1)}(c)}{(n + 1)!}(x-a)^{n+1} \) for some unknown \( c \) between \( a \) and \( x \). You do not know \( c \), so replace the derivative by its worst case.
Here \( M \) is any number with \( |f^{(n+1)}(z)| \le M \) for every \( z \) between \( a \) and \( x \).
Read it as “the error is at most the size of the next term, with the unknown derivative replaced by its largest possible value”.
Use the Lagrange error bound to show that the estimate \( \ln 1.2 \approx 0.182667 \) from \( P_3 \) is in error by at most 0.0004.
The actual error is \( 0.182667-0.182322 = 0.000345 \), which is inside the bound, as it must be.
Here is the economics use of a two-term Taylor polynomial. A bank quotes a continuously compounded rate \( r \). After one year, $1 grows to \( e^r \), so the effective annual rate is \( e^r-1 \). The Maclaurin polynomial \( e^r \approx 1 + r + \tfrac{r^2}{2} \) gives \( e^r-1 \approx r + \tfrac{r^2}{2} \). At 5% that is \( 0.05 + 0.00125 = 0.05125 \), against the exact 0.051271. In the other direction, \( \ln(1 + r) \approx r-\tfrac{r^2}{2} \) is why a 3% annual growth rate is a continuous rate of just under 3%, and why, with growth paid once a year, the doubling time is a little longer than \( 69.3 \) divided by the percentage rate: one reason the Rule of 70 rounds 69.3 up.
Power series and the interval of convergence
AP Calculus BC only. Let the Taylor polynomial run on for ever and you get a power series \( \sum c_n(x-a)^n \): an infinite polynomial whose value depends on \( x \). It always converges at its centre \( x = a \). Beyond that, there are only three possibilities: it converges only at \( a \) (radius \( R = 0 \)), for every \( x \) (\( R = \infty \)), or absolutely for \( |x-a| < R \) and not at all for \( |x-a| > R \).
The method has three steps. Apply the ratio test to \( |c_n(x-a)^n| \) and solve \( L < 1 \) to get \( |x-a| < R \). At the two endpoints \( x = a \pm R \) the ratio test gives \( L = 1 \) and says nothing, so test each endpoint with another test. Then state the interval with the correct brackets.
Find the radius and the interval of convergence of \( \displaystyle\sum_{n=1}^{\infty} \frac{(x-3)^n}{n^2\,4^n} \).
Both endpoints are included here. That is not typical: change \( n^2 \) to \( n \) and the right endpoint gives the harmonic series, so it would be excluded.
The standard series, and new series from old
AP Calculus BC only; IB HL 5.19. The Taylor series of \( f \) about \( a \) is the power series \( \sum \dfrac{f^{(n)}(a)}{n!}(x-a)^n \); about \( a = 0 \) it is the Maclaurin series. For the functions in the table it equals \( f(x) \) on the interval shown. For \( e^x \), \( \sin x \) and \( \cos x \) this follows from the Lagrange bound, because \( \dfrac{|x|^{n+1}}{(n + 1)!} \to 0 \) for every \( x \): factorials outgrow powers.
| Function | Maclaurin series | Valid for |
|---|---|---|
| \( e^x \) | \( 1 + x + \dfrac{x^2}{2!} + \dfrac{x^3}{3!} + \cdots = \displaystyle\sum_{n=0}^{\infty} \frac{x^n}{n!} \) | all \( x \) |
| \( \sin x \) | \( x-\dfrac{x^3}{3!} + \dfrac{x^5}{5!}-\cdots = \displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{(2n + 1)!} \) | all \( x \) |
| \( \cos x \) | \( 1-\dfrac{x^2}{2!} + \dfrac{x^4}{4!}-\cdots = \displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!} \) | all \( x \) |
| \( \dfrac{1}{1-x} \) | \( 1 + x + x^2 + x^3 + \cdots = \displaystyle\sum_{n=0}^{\infty} x^n \) | \( -1 < x < 1 \) |
| \( \ln(1 + x) \) | \( x-\dfrac{x^2}{2} + \dfrac{x^3}{3}-\cdots = \displaystyle\sum_{n=1}^{\infty} \frac{(-1)^{n+1} x^n}{n} \) | \( -1 < x \le 1 \) |
| \( \tan^{-1} x \) | \( x-\dfrac{x^3}{3} + \dfrac{x^5}{5}-\cdots = \displaystyle\sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n + 1} \) | \( -1 \le x \le 1 \) |
Notice that \( \sin x \), an odd function, has only odd powers, and \( \cos x \), an even function, only even ones. And \( \dfrac{1}{1-x} \) is just the geometric series, which is why its interval stops at \( |x| < 1 \) (Figure 3).
Finding many derivatives is slow. It is usually quicker to build a new series from one in the table. You may substitute (replace \( x \) by \( 2x \), \( -x^2 \) and so on, and adjust the interval), multiply by a power of \( x \) or by another series, and differentiate or integrate term by term. Differentiating and integrating keep the radius of convergence, although the endpoints can change. For example, differentiating the series for \( \sin x \) term by term gives the series for \( \cos x \), and integrating \( \dfrac{1}{1 + x^2} = 1-x^2 + x^4-\cdots \) gives the series for \( \tan^{-1} x \).
(a) Find the first three non-zero terms of the Maclaurin series for \( \cos(x^2) \). (b) Hence estimate \( \displaystyle\int_0^1 \cos(x^2)\,dx \) and bound the error.
The true value is 0.904524, inside the bound. This integral has no elementary antiderivative, so a series is the natural way to evaluate it.
Series also make some limits easy. Since \( e^x-1-x = \dfrac{x^2}{2} + \dfrac{x^3}{6} + \cdots \), we get \( \dfrac{e^x-1-x}{x^2} = \dfrac{1}{2} + \dfrac{x}{6} + \cdots \), so \( \displaystyle\lim_{x \to 0} \frac{e^x-1-x}{x^2} = \frac{1}{2} \) without using L’Hôpital’s rule twice.
IB HL 5.19 also asks for a Maclaurin series straight from a differential equation. If you know \( y(0) \) and a formula for \( y’ \), you can find \( y'(0) \), then differentiate the equation to get \( y”(0) \), and so on. This works even when the equation cannot be solved.
The function \( y \) satisfies \( \dfrac{dy}{dx} = x-y^2 \) with \( y(0) = 1 \). Find its Maclaurin series up to the term in \( x^3 \).
This equation is not separable and has no simple formula for its solution, yet the series gives good values of \( y \) near \( x = 0 \).
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. Write the first four non-zero terms of the Maclaurin series for \( e^{3x} \). Show worked answer
\( e^{3x} = 1 + 3x + \dfrac{9x^2}{2} + \dfrac{27x^3}{6} + \cdots = 1 + 3x + \dfrac{9}{2}x^2 + \dfrac{9}{2}x^3 + \cdots \), valid for all \( x \).
EasyQ2. A function has \( f(1) = 4 \), \( f'(1) = -2 \) and \( f”(1) = 6 \). Write the second-degree Taylor polynomial about \( x = 1 \) and estimate \( f(1.1) \). Show worked answer
With \( x-1 = 0.1 \): \( P_2(1.1) = 4-0.2 + 0.03 = 3.83 \).
MediumQ3. Find the interval of convergence of \( \displaystyle\sum_{n=1}^{\infty} n(2x)^n \). Show worked answer
\( 2|x| < 1 \) gives \( |x| < \tfrac{1}{2} \), so \( R = \tfrac{1}{2} \).
At \( x = \tfrac{1}{2} \): \( \sum n \), whose terms do not tend to 0. Diverges.
At \( x = -\tfrac{1}{2} \): \( \sum (-1)^n n \), whose terms do not tend to 0. Diverges.
Interval: \( -\tfrac{1}{2} < x < \tfrac{1}{2} \).
MediumQ4. Use a standard series to find the Maclaurin series for \( \dfrac{x}{1 + x^2} \) up to the term in \( x^7 \), and state where it is valid. Show worked answer
Multiply by \( x \): \( \dfrac{x}{1 + x^2} = x-x^3 + x^5-x^7 + \cdots \).
Valid when \( |{-x^2}| < 1 \), that is \( -1 < x < 1 \).
MediumQ5. The third-degree Maclaurin polynomial for \( e^x \) is used to estimate \( e^{0.5} \). Find the estimate, and use the Lagrange error bound (with \( e^{0.5} < 2 \)) to bound the error. Show worked answer
\( f^{(4)}(z) = e^z \le e^{0.5} < 2 \) for \( 0 \le z \le 0.5 \), so take \( M = 2 \).
Error \( \le \dfrac{2 \times 0.5^4}{4!} = \dfrac{0.125}{24} \approx 0.0052 \).
(The true value is 1.648721, an error of about 0.0029.)
ExamQ6. The Maclaurin series for a function \( f \) is \( f(x) = 1-\dfrac{x^2}{3} + \dfrac{x^4}{5}-\dfrac{x^6}{7} + \cdots + \dfrac{(-1)^n x^{2n}}{2n + 1} + \cdots \). (a) Find the interval of convergence of the series. Justify your answer. [3] (b) Write the first three non-zero terms and the general term of the Maclaurin series for \( f'(x) \). [2] (c) Use the first two terms of the series for \( f \) to approximate \( f(0.5) \). Show that this approximation differs from \( f(0.5) \) by less than \( \tfrac{1}{50} \). [3] Show worked answer
At \( x = \pm 1 \) the series is \( \sum \dfrac{(-1)^n}{2n + 1} \). The terms \( \dfrac{1}{2n + 1} \) are positive, decreasing and tend to 0, so it converges by the alternating series test. [M1]
Interval: \( -1 \le x \le 1 \). [A1]
(b) \( f'(x) = -\dfrac{2x}{3} + \dfrac{4x^3}{5}-\dfrac{6x^5}{7} + \cdots + \dfrac{(-1)^n\,2n\,x^{2n-1}}{2n + 1} + \cdots \) [B1 B1]
(c) \( f(0.5) \approx 1-\dfrac{0.25}{3} = \dfrac{11}{12} \approx 0.9167 \). [B1]
At \( x = 0.5 \) the series alternates, and its terms \( \dfrac{0.25^n}{2n + 1} \) decrease to 0, so the error is at most the next term. [M1]
Error \( \le \dfrac{0.5^4}{5} = \dfrac{1}{80} = 0.0125 < \dfrac{1}{50} \). [A1]
Total: 8 marks.
Check yourself
1. The coefficient of \( x^3 \) in the Maclaurin series of \( f \) is 4. What is \( f”'(0) \)?
2. What is the interval of convergence of \( 1 + x + x^2 + x^3 + \cdots \)?
3. The Maclaurin series for \( \sin x \) contains:
Your score: 0 out of 3
The short version
- This step is AP Calculus BC only, and IB HL 5.19 for Maclaurin series. Cambridge 9709 has no Taylor or Maclaurin series.
- \( P_n(x) = \sum_{k=0}^{n} \dfrac{f^{(k)}(a)}{k!}(x-a)^k \): divide each derivative by its factorial. With \( a = 0 \) it is a Maclaurin polynomial.
- Lagrange: \( |f(x)-P_n(x)| \le \dfrac{M|x-a|^{n+1}}{(n + 1)!} \), with \( M \) the largest value of \( |f^{(n+1)}| \) between \( a \) and \( x \). For alternating series, the first omitted term is a quicker bound.
- Find a radius of convergence with the ratio test, then test both endpoints separately and state the interval with the right brackets.
- Learn the six standard series and build others by substitution, multiplication, term-by-term differentiation and integration; IB HL also builds series from a differential equation.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
