Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics guide, Unit 10, step 30 of 33Previous stepNext step

Step 30: Taylor and Maclaurin Series

SyllabusAP BC 10.11–10.15 · IB HL 5.19
In 30 seconds
  • 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.
Video lesson coming soonA short animated lesson for this step will appear here.

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!} \).

\[ P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(a)}{k!}(x-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 \).

Key termTaylor polynomial: the polynomial \( P_n \) above, of degree at most \( n \), which agrees with \( f \) and its first \( n \) derivatives at \( x = a \). A Maclaurin polynomial is the case \( a = 0 \).
Worked example

Find the third-degree Taylor polynomial for \( f(x) = \ln x \) about \( x = 1 \), and use it to estimate \( \ln 1.2 \).

Step 1Derivatives: \( f'(x) = x^{-1} \), \( f”(x) = -x^{-2} \), \( f”'(x) = 2x^{-3} \).
Step 2At \( x = 1 \): \( f(1) = 0 \), \( f'(1) = 1 \), \( f”(1) = -1 \), \( f”'(1) = 2 \).
Step 3Divide by the factorials: \( P_3(x) = (x-1)-\dfrac{(x-1)^2}{2} + \dfrac{2(x-1)^3}{6} = (x-1)-\dfrac{(x-1)^2}{2} + \dfrac{(x-1)^3}{3} \).
Step 4With \( x-1 = 0.2 \): \( \ln 1.2 \approx 0.2-0.02 + 0.002667 = 0.182667 \).

The true value is \( \ln 1.2 = 0.182322 \) (6 d.p.), so three terms are already right to three decimal places.

ln x and its Taylor polynomials about x = 1
y = ln xP₁(x) = x − 1P₃(x) = (x − 1) − (x − 1)²/2 + (x − 1)³/3
0.511.522.53−2−1.5−1−0.50.511.50xyx = 1.2x = 2: edge of convergence
Figure 1: near x = 1 the cubic P₃ is almost indistinguishable from ln x, so P₃(1.2) is an excellent estimate. Beyond x = 2 the polynomials peel away: the Taylor series of ln x about 1 only converges for 0 < x ≤ 2.

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.

Worked example

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) \).

Step 1\( P_3(x) = 2-3x + \dfrac{5}{2!}x^2 + \dfrac{-12}{3!}x^3 = 2-3x + \dfrac{5}{2}x^2-2x^3 \).
Step 2\( P_3(0.2) = 2-0.6 + \tfrac{5}{2}(0.04)-2(0.008) = 2-0.6 + 0.1-0.016 \).
Step 3So \( f(0.2) \approx 1.484 \).

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.

\[ |f(x)-P_n(x)| \le \frac{M\,|x-a|^{n+1}}{(n + 1)!} \]

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”.

Worked example

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.

Step 1Here \( n = 3 \), so we need \( f^{(4)}(x) = -6x^{-4} \).
Step 2On \( 1 \le z \le 1.2 \), \( |f^{(4)}(z)| = \dfrac{6}{z^4} \) is largest at \( z = 1 \), so take \( M = 6 \).
Step 3Error \( \le \dfrac{6 \times 0.2^4}{4!} = \dfrac{6 \times 0.0016}{24} = 0.0004 \).

The actual error is \( 0.182667-0.182322 = 0.000345 \), which is inside the bound, as it must be.

Exam tip\( M \) must bound the \( (n + 1) \)th derivative over the whole interval from \( a \) to \( x \), not just at \( a \). Say where the maximum occurs and why (for example “\( 6/z^4 \) is decreasing, so its maximum on \( [1, 1.2] \) is at \( z = 1 \)”). If the series you are cutting off alternates, with terms decreasing to 0, the alternating series bound of Step 29 is quicker, unless the question names Lagrange.

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 \).

Key termRadius and interval of convergence: the radius \( R \) is the distance from the centre within which the series converges. The interval of convergence is the full set of \( x \) for which it converges, including any endpoints that work.

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.

Worked example

Find the radius and the interval of convergence of \( \displaystyle\sum_{n=1}^{\infty} \frac{(x-3)^n}{n^2\,4^n} \).

Step 1Ratio test: \( \left|\dfrac{(x-3)^{n+1}}{(n + 1)^2 4^{n+1}} \cdot \dfrac{n^2 4^n}{(x-3)^n}\right| = \left(\dfrac{n}{n + 1}\right)^2 \dfrac{|x-3|}{4} \to \dfrac{|x-3|}{4} \).
Step 2This is less than 1 when \( |x-3| < 4 \). So \( R = 4 \), and the series converges for \( -1 < x < 7 \).
Step 3At \( x = 7 \): the series is \( \sum \dfrac{4^n}{n^2 4^n} = \sum \dfrac{1}{n^2} \), a \( p \)-series with \( p = 2 \). It converges.
Step 4At \( x = -1 \): the series is \( \sum \dfrac{(-4)^n}{n^2 4^n} = \sum \dfrac{(-1)^n}{n^2} \). It converges absolutely, because \( \sum \tfrac{1}{n^2} \) does.
Step 5The interval of convergence is \( -1 \le x \le 7 \), that is \( [-1, 7] \).

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.

Common mistakeStopping at “\( |x-3| < 4 \)”. That is the radius, not the interval. The ratio test is always silent at the endpoints, so an answer that does not test \( x = a-R \) and \( x = a + R \) separately loses marks.

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.

FunctionMaclaurin seriesValid 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).

cos x and its Maclaurin polynomials
y = cos xP₂ = 1 − x²/2P₄ = P₂ + x⁴/24P₆ = P₄ − x⁶/720
−7−6−5−4−3−2−11234567−3−2−11230xy
Figure 2: each extra term keeps the polynomial close to cos x over a wider stretch around 0. Because the cosine series converges for every x, adding enough terms makes the fit as good as you like on any interval.
1/(1 − x) and partial sums of 1 + x + x² + …
y = 1/(1 − x)S₂ = 1 + x + … + x²S₅ = 1 + x + … + x⁵S₁₀ = 1 + x + … + x¹⁰
−1.5−1−0.50.511.5−3−2−11234560xyx = −1x = 1
Figure 3: inside −1 < x < 1 the partial sums close in on 1/(1 − x). Outside that interval they swing further away as terms are added, even though 1/(1 − x) itself is perfectly well defined at, say, x = −1.5.

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 \).

Worked example

(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.

Step 1(a) Replace \( x \) by \( x^2 \) in the cosine series: \( \cos(x^2) = 1-\dfrac{x^4}{2!} + \dfrac{x^8}{4!}-\dfrac{x^{12}}{6!} + \cdots = 1-\dfrac{x^4}{2} + \dfrac{x^8}{24}-\cdots \), valid for all \( x \).
Step 2(b) Integrate term by term: \( \displaystyle\int_0^1 \cos(x^2)\,dx = \Big[x-\frac{x^5}{10} + \frac{x^9}{216}-\frac{x^{13}}{9360} + \cdots\Big]_0^1 \).
Step 3Three terms give \( 1-\tfrac{1}{10} + \tfrac{1}{216} = 0.904630 \) (6 d.p.).
Step 4The series \( 1-\tfrac{1}{10} + \tfrac{1}{216}-\tfrac{1}{9360} + \cdots \) alternates with terms decreasing to 0, so the error is at most the next term, \( \tfrac{1}{9360} \approx 0.000107 \).

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.

Worked example

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 \).

Step 1From the equation, \( y'(0) = 0-1^2 = -1 \).
Step 2Differentiate the equation (implicitly, since \( y \) is a function of \( x \)): \( y” = 1-2yy’ \). So \( y”(0) = 1-2(1)(-1) = 3 \).
Step 3Differentiate again: \( y”’ = -2\big(y’^2 + yy”\big) \). So \( y”'(0) = -2(1 + 3) = -8 \).
Step 4\( y \approx 1-x + \dfrac{3}{2!}x^2 + \dfrac{-8}{3!}x^3 = 1-x + \dfrac{3}{2}x^2-\dfrac{4}{3}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
Replace \( x \) by \( 3x \) in \( e^x = 1 + x + \dfrac{x^2}{2!} + \dfrac{x^3}{3!} + \cdots \).
\( 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
\( P_2(x) = 4-2(x-1) + \dfrac{6}{2!}(x-1)^2 = 4-2(x-1) + 3(x-1)^2 \).
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
Ratio test: \( \left|\dfrac{(n + 1)(2x)^{n+1}}{n(2x)^n}\right| = \dfrac{n + 1}{n}|2x| \to 2|x| \).
\( 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
Replace \( x \) by \( -x^2 \) in \( \dfrac{1}{1-x} = 1 + x + x^2 + \cdots \): \( \dfrac{1}{1 + x^2} = 1-x^2 + x^4-x^6 + \cdots \).
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
\( P_3(0.5) = 1 + 0.5 + \dfrac{0.25}{2} + \dfrac{0.125}{6} = 1.645833 \) (6 d.p.).
\( 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
(a) \( \left|\dfrac{x^{2n+2}}{2n + 3} \cdot \dfrac{2n + 1}{x^{2n}}\right| = \dfrac{2n + 1}{2n + 3}x^2 \to x^2 \), and \( x^2 < 1 \) gives \( -1 < x < 1 \). [M1]
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) \)?

The coefficient is \( \dfrac{f”'(0)}{3!} \), so \( f”'(0) = 4 \times 6 = 24 \).

2. What is the interval of convergence of \( 1 + x + x^2 + x^3 + \cdots \)?

It is geometric with ratio \( x \), so it converges exactly when \( |x| < 1 \). At \( x = \pm 1 \) the terms do not tend to 0.

3. The Maclaurin series for \( \sin x \) contains:

\( \sin x \) is an odd function, and its derivatives at 0 are \( 0, 1, 0, -1, \ldots \), so only odd powers survive: \( x-\tfrac{x^3}{6} + \tfrac{x^5}{120}-\cdots \).

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.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 31 of 33Numerical Methods: Roots and Iteration