Part IV · Calculus Chapter 30 of 60
Series
An infinite sum can be added up, but it has to be handled with care: one converges, another runs off to infinity, a third changes its answer if you rearrange the terms. Let’s walk through a cabinet of curiosities of infinite sums, from a stack of books over an abyss to a polynomial that passes itself off as the sine.
Builds on: 29 · The number e and the exponential
You will learn
- understand what the sum of a series is and test convergence with the comparison, ratio and alternating series tests
- expand functions in Taylor series and estimate the error of a Taylor polynomial
- explain why the harmonic series diverges and why rearranging the terms changes the sum of a conditionally convergent series
The last chapter ended with a question: can any function be written as an “infinite polynomial”, a sum $c_0 + c_1x + c_2x^2 + \dots$ with no last term? For the number $e$ we’ve already met such a sum: $e = 1 + 1 + \frac12 + \frac16 + \frac1{24} + \dots$ Before expanding functions, we’ll have to deal with a simpler question: what does it even mean to add up infinitely many numbers?
Infinite sums are no joke. Add up $1 - 1 + 1 - 1 + \dots$ and you get $0$, $1$ or $\frac12$, depending on how you count. Add up $1 + \frac12 + \frac13 + \dots$: the terms melt away, and yet the sum is infinite. Rearrange the terms of $1 - \frac12 + \frac13 - \dots$ and the sum becomes different. There are enough such oddities for a whole museum. Let’s set one up: we’ll walk through the rooms of a cabinet of curiosities of infinite sums and, for each exhibit, find out how it works. The old name for such a cabinet, Kunstkamera, is no accident here: in the eighteenth century the Academy of Sciences, where Leonhard Euler worked, met in the building of the Kunstkamera in St Petersburg, and Euler is the hero of the fourth room.
Room one: a sum that doesn’t exist
Exhibit no. 1 · Grandi’s series · Italy, 1703
The label reads: $1 - 1 + 1 - 1 + 1 - \dots$ How much is that? If you group the terms in pairs, you get $(1 - 1) + (1 - 1) + \dots = 0 + 0 + \dots = 0$. If you set the first one aside and start the pairs from the second term, you get $1 - (1 - 1) - (1 - 1) - \dots = 1$. And if you call the sum $S$ and notice that after the first one comes the same sum with the opposite sign, then $S = 1 - S$, so $S = \frac12$.
The answer $\frac12$ was defended by the Italian monk and mathematician Guido Grandi, and even Leibniz agreed with him. Three arguments, three answers, and not one arithmetical mistake in any of them. The mistake lies deeper: all three treat the infinite sum as if it already existed and obeyed the usual laws. With finite sums you can do that, but for an infinite one we first have to agree on what it means.
The agreement is this: add one term at a time and see what the running totals are closing in on.
An expression $a_1 + a_2 + a_3 + \dots$ made up of the terms of a sequence is called a series and written $\sum_{n=1}^{\infty} a_n$. The sum of the first $n$ terms, $S_n = a_1 + \dots + a_n$, is called the $n$th partial sum. If the sequence of partial sums has a limit $S$, the series is called convergent, and the number $S$ is its sum. If there’s no limit, the series is called divergent.
Now we can see where all three arguments stumbled. The pairs $(1 - 1)$ pick out only the even partial sums, $S_2, S_4, \dots$, and those are zero; the second grouping picks out the odd ones, equal to one. For a convergent series that’s harmless: all the partial sums head for one limit, and so does any selection of them. And the equation $S = 1 - S$ silently assumes that $S$ exists. There’s also a simple sign that Grandi’s series is doomed.
If the series $\sum a_n$ converges, then $a_n \to 0$.
The idea: each term is the difference of two neighbouring partial sums, and both approach the same number. Let $S_n \to S$. Then $S_{n-1} \to S$ too: it’s the same sequence, only with the indices shifted by one. By the rule for the limit of a difference, $a_n = S_n - S_{n-1} \to S - S = 0$.
In Grandi’s series the terms are $\pm1$ and don’t tend to zero, so it diverges. The converse is false: the terms can tend to zero while the series diverges. The most famous example is waiting in the next room.
This room also holds an exhibit we see every day: an infinite decimal. The notation $0.d_1d_2d_3\dots$ means the series $\frac{d_1}{10} + \frac{d_2}{100} + \dots$, and the chapter on fractions promised to explain why such notation always has a value. The partial sums grow and don’t reach one: even for all nines they’re less than $\frac{9}{10} + \frac{9}{100} + \dots = 1$ (chapter 13). Where can a growing sequence that has hit a ceiling go? The answer is a property on which the whole of calculus rests.
If a sequence doesn’t decrease and is bounded above, it has a limit.
For fractions this is false. The sequence $1$, $1.4$, $1.41$, $1.414$, … grows and never exceeds $2$, but it closes in on $\sqrt2$, and there’s no such fraction (chapter 6): the rational line has holes. The completeness axiom says that the real line has none. We’ll accept it as a basic property of $\mathbb R$; in chapter 53 the real numbers will be built from fractions, and completeness will become a theorem.
A series with non-negative terms converges if and only if its partial sums are bounded. If they aren’t bounded, then $S_n \to +\infty$.
Since $a_n \ge 0$, the partial sums don’t decrease: $S_{n+1} = S_n + a_{n+1} \ge S_n$. If they’re bounded above, they have a limit by the completeness axiom. If they aren’t bounded, then for any number $M$ there’s a sum $S_N > M$, and all the following ones are greater than $M$ too, because the sums don’t decrease; that’s exactly what $S_n \to +\infty$ means. Conversely, a convergent series has bounded partial sums: from some index on they differ from the sum of the series by less than $1$, and before that index there are only finitely many of them.
So every infinite decimal has a value. The equation $0.(9) = 1$, that is, $0.999\ldots = 1$, from chapter 13 is a special case where the sum was found explicitly.
Room two: the terms melt, the sum grows
Exhibit no. 2 · The harmonic series · Paris, around 1350
The series $1 + \frac12 + \frac13 + \frac14 + \dots$ is called the harmonic series: a string vibrating in halves, thirds, quarters sounds overtones with wavelengths $\frac12, \frac13, \frac14$ of the fundamental. The partial sums $H_n = 1 + \frac12 + \dots + \frac1n$ are called harmonic numbers. The necessary condition holds, and the sums grow ever more slowly: $H_{10} \approx 2.93$, $H_{100} \approx 5.19$, $H_{1000} \approx 7.49$. It looks as if they’re about to hit a ceiling. They won’t.
The partial sums $H_n$ of the harmonic series grow without limit: $1 + \frac12 + \frac13 + \dots = +\infty$.
Nicole Oresme’s trick: gather the terms into groups, each of which is at least a half.
The sum grows, but how slowly! To get past $10$ takes $12{,}367$ terms. The rate of growth is given away by the area under the hyperbola $y = \frac1x$: from $1$ to $n$ it equals $\ln n$ (chapter 29).
For every natural $n$, $\ln(n + 1) < H_n \le 1 + \ln n$, and the difference $H_n - \ln n$ tends to some number $\gamma$ as $n \to \infty$, with $0 < \gamma < 1$.
The idea: compare the bars $\frac1k$ with the area under the curve $y = \frac1x$, once putting them on top of the curve and once hiding them under it.
Room three: a stack of books over the abyss
Exhibit no. 3 · A stack of books · Try this at home
Stack identical books at the edge of a table so that each one sticks out beyond the one below. How far past the edge can the top book go? Intuition says no further than the length of one book. Try it yourself.
Four are enough: the top book sticks out beyond the edge by $\frac{25}{24}$ of its length. And with more books the overhang can be as large as you like.
From $n$ identical uniform books of length $1$, laid one on top of another at the edge of a table, you can build a stack whose top book sticks out beyond the edge by $\frac12 H_n = \frac12\left(1 + \frac12 + \dots + \frac1n\right)$, and no more.
We’ll build the stack from the top down and keep track of the centres of mass. The stack stands as long as the centre of mass of every top part of it is over the book that part rests on, and the centre of mass of the whole stack is over the table. Let the table edge be the point $0$, $r_k$ the right edge of the $k$th book from the top, and $c_k$ the centre of mass of the top $k$ books.
Arbitrarily large, but at what cost! An overhang of two book lengths needs $31$ books, three needs $227$, and ten needs those same $272{,}400{,}600$ books that the harmonic series needs to reach twenty. With books $3$ cm thick, such a stack would rise eight thousand kilometres.
How many books are needed for the top one to stick out beyond the table edge by two of its lengths?
We need $\frac12 H_n \ge 2$, that is, $H_n \ge 4$. The harmonic numbers first pass four at $n = 31$: $H_{30} \approx 3.995$, $H_{31} \approx 4.027$.
The restoration workshop: convergence tests
The museum has a workshop where new arrivals are checked: does the series converge or not? A formula for the partial sums is rarely available, so the workshop’s tools compare an unfamiliar series with a familiar one.
Let $0 \le a_n \le b_n$ for all $n$. If the series $\sum b_n$ converges, then $\sum a_n$ converges too, and $\sum a_n \le \sum b_n$. If $\sum a_n$ diverges, then $\sum b_n$ diverges too.
The idea: you can’t build a taller tower from smaller blocks than from bigger ones.
For example, the series $\sum \frac1{n^2}$ converges. For $n \ge 2$ we have $\frac1{n^2} < \frac{1}{n(n - 1)} = \frac{1}{n - 1} - \frac1n$, and the series of right-hand sides has partial sums that collapse like a telescope: $\left(1 - \frac12\right) + \left(\frac12 - \frac13\right) + \dots + \left(\frac1{n-1} - \frac1n\right) = 1 - \frac1n < 1$. So $\sum \frac1{n^2} < 1 + 1 = 2$. Exactly which number it is is the mystery of the next room.
The series $\sum \frac{1}{n^p}$ converges for $p > 1$ and diverges for $p \le 1$.
For $p \le 1$ we have $n^p \le n$, that is, $\frac1{n^p} \ge \frac1n$, and the series diverges by comparison with the harmonic series. For $p > 1$, repeat the second step of the staircase under the hyperbola with $\frac1x$ replaced by $\frac1{x^p}$: the bars $\frac1{k^p}$ for $k \ge 2$, shifted one unit to the left, fit under the curve, so $\frac1{2^p} + \dots + \frac1{n^p} \le \int_1^n \frac{dx}{x^p} = \frac{1 - n^{1 - p}}{p - 1} < \frac1{p - 1}$. The partial sums of the series are at most $1 + \frac1{p-1}$, and it converges.
The second tool compares a series with a geometric progression, and the progression itself is chosen to fit the series.
Let $a_n > 0$ and $\frac{a_{n+1}}{a_n} \to q$. If $q < 1$, the series $\sum a_n$ converges; if $q > 1$, it diverges. At $q = 1$ the test says nothing.
The idea: far from the start, the series looks like a geometric progression with ratio $q$. Let $q < 1$; take a number $r$ between them, $q < r < 1$. The ratios tend to $q$, so from some index $N$ on they’re all less than $r$: $a_{n+1} < r\,a_n$. Then $a_{N+1} < a_N r$, $a_{N+2} < a_N r^2$, and in general $a_{N+m} < a_N r^m$. The tail of the series is smaller, term by term, than the progression $a_N r + a_N r^2 + \dots$, which converges because $r < 1$. By the comparison test the tail converges, and with it the whole series: the first $N$ terms are a finite sum. If $q > 1$, then from some index on $a_{n+1} > a_n$: the terms grow, don’t tend to zero, and the series diverges by the necessary condition. Finally, for the harmonic series and for $\sum \frac1{n^2}$ the ratios of neighbouring terms tend to $1$, yet the two series behave differently, so at $q = 1$ anything can happen.
Jean le Rond d’Alembert published this test in 1768. It’s good for series with factorials and powers. For $\sum \frac{n}{2^n}$ the ratio $\frac{n + 1}{2n} \to \frac12$, and the series converges. For $\sum \frac{100^n}{n!}$ the ratio $\frac{100}{n + 1} \to 0$: sooner or later the factorial overtakes any power, and the series converges, while $\sum\frac{n!}{100^n}$ diverges for the same reason.
Find the sum of the series $\frac12 + \frac24 + \frac38 + \frac4{16} + \dots = \sum\limits_{n=1}^{\infty}\frac{n}{2^n}$.
The series converges by the ratio test; call its sum $S$. Subtract from $S$ the series $\frac S2 = \frac14 + \frac28 + \frac3{16} + \dots$, shifted by one place: $S - \frac S2 = \frac12 + \frac14 + \frac18 + \dots = 1$. Convergent series can be subtracted term by term: the partial sums of the difference are the differences of the partial sums. So $\frac S2 = 1$ and $S = 2$.
For the series $\sum\frac1{n^2}$ the ratio test gives $\frac{a_{n+1}}{a_n} = \frac{n^2}{(n+1)^2} \to 1$. What follows from this?
At $q = 1$ the test is silent. The convergence of $\sum\frac1{n^2}$ was proved by the comparison test, and for the harmonic series, which diverges, the ratio also tends to $1$.
Room four: π without circles
Exhibit no. 4 · The Basel problem · St Petersburg, 1734
The series $1 + \frac14 + \frac19 + \dots$ converges, and its sum is less than $2$. But which number is it? The question was asked in 1650 by Pietro Mengoli and made famous by Jacob Bernoulli of Basel, who admitted that he couldn’t crack it. Adding directly hardly helps: the tail after the $N$th term is roughly $\frac1N$, and each new correct digit costs ten times as much work.
The problem was solved in 1734 by Leonhard Euler, who wasn’t yet thirty. He was working at the St Petersburg Academy of Sciences and presented the solution to it in December 1735. The answer astonished everyone.
Euler’s reasoning was bold. A polynomial that equals $1$ at zero and has roots $r_1, \dots, r_k$ factors into the product $\left(1 - \frac{x}{r_1}\right)\cdots\left(1 - \frac{x}{r_k}\right)$ (chapter 14). The function $\frac{\sin x}{x}$ tends to $1$ at zero and vanishes at the points $\pm\pi, \pm2\pi, \dots$ Euler supposed that it factors in the same way, only with infinitely many factors; each pair of roots $\pm k\pi$ gives the factor $\left(1 - \frac{x}{k\pi}\right)\left(1 + \frac{x}{k\pi}\right) = 1 - \frac{x^2}{k^2\pi^2}$:
$$\frac{\sin x}{x} = \left(1 - \frac{x^2}{\pi^2}\right)\left(1 - \frac{x^2}{4\pi^2}\right)\left(1 - \frac{x^2}{9\pi^2}\right)\cdots$$If you multiply out the brackets, the $x^2$ term is collected from all the factors: $-\left(\frac1{\pi^2} + \frac1{4\pi^2} + \frac1{9\pi^2} + \dots\right)x^2$. And by the series for the sine, which we’ll derive in room six, $\frac{\sin x}{x} = 1 - \frac{x^2}{6} + \frac{x^4}{120} - \dots$ Equating the coefficients of $x^2$, Euler got $\sum\frac1{n^2\pi^2} = \frac16$.
The boldness was no joke: an infinite product isn’t a polynomial, and having the same roots guarantees nothing yet. The function $e^x\frac{\sin x}{x}$ has the same roots but factors differently. Euler checked the answer numerically, and his factorisation of the sine was only justified rigorously in the nineteenth century. Here’s a proof that needs only trigonometry, complex numbers and Vieta’s formulas; it’s attributed to Augustin-Louis Cauchy.
$1 + \frac14 + \frac19 + \frac1{16} + \dots = \frac{\pi^2}{6}$.
The idea: squeeze $\frac1{x^2}$ between two functions whose sums at specially chosen points can be computed exactly.
Room five: a sum that depends on the order
Exhibit no. 5 · The alternating harmonic series · Göttingen, 1854
Flip the sign of every other term in the harmonic series: $1 - \frac12 + \frac13 - \frac14 + \dots$ The partial sums zigzag: $1$, $0.5$, $0.833$, $0.583$, $0.783$, …; the steps get ever shorter, and the zigzag closes in on the number $0.6931\dots$ Such series are guaranteed to converge by a simple test.
Let $a_1 \ge a_2 \ge a_3 \ge \dots \ge 0$ and $a_n \to 0$. Then the series $a_1 - a_2 + a_3 - a_4 + \dots$ converges, and its sum $S$ differs from the partial sum $S_n$ by at most the first omitted term: $|S - S_n| \le a_{n+1}$.
The idea: the partial sums jump right and left, each jump no longer than the one before, so they close in on the sum ever more tightly.
The test doesn’t say what the sum is. It’s found by a trick that also works for the number $\pi$.
$1 - \frac12 + \frac13 - \frac14 + \dots = \ln 2$ and $1 - \frac13 + \frac15 - \frac17 + \dots = \frac\pi4$.
The idea: instead of the infinite series, take a finite geometric progression whose remainder is known exactly, and integrate. For $t \ne -1$ the formula for the sum of a progression (chapter 13) gives $1 - t + t^2 - \dots + (-t)^{n-1} = \frac{1 - (-t)^n}{1 + t}$, that is,
$$\frac{1}{1 + t} = 1 - t + t^2 - \dots + (-t)^{n-1} + \frac{(-t)^n}{1 + t}.$$Integrate from $0$ to $1$ (chapter 28). The left side gives $\ln 2$, the right side the partial sum $1 - \frac12 + \frac13 - \dots \pm \frac1n$ plus the remainder $\pm\int_0^1\frac{t^n}{1 + t}\,dt$. On the interval $[0, 1]$ the integrand is at most $t^n$, so the remainder is at most $\int_0^1 t^n\,dt = \frac1{n + 1}$ in absolute value and tends to zero. So the partial sums tend to $\ln 2$. For the second series we do the same with $\frac{1}{1 + t^2} = 1 - t^2 + t^4 - \dots + (-t^2)^{n-1} + \frac{(-t^2)^n}{1 + t^2}$: the integral of the left side from $0$ to $1$ is $\arctan 1 = \frac\pi4$, because the derivative of the arctangent is $\frac1{1+t^2}$, and the remainder is at most $\int_0^1 t^{2n}dt = \frac{1}{2n + 1}$.
Now the exhibit itself. Take the same terms, but after each positive one put two negative ones:
$$1 - \frac12 - \frac14 + \frac13 - \frac16 - \frac18 + \frac15 - \frac1{10} - \frac1{12} + \dots$$Not a single term is lost. Group them in threes: $\left(1 - \frac12\right) - \frac14 + \left(\frac13 - \frac16\right) - \frac18 + \dots = \frac12 - \frac14 + \frac16 - \dots$, exactly half the original series: each triple $\frac1{2j-1} - \frac1{4j-2} - \frac1{4j}$ equals $\frac12\left(\frac1{2j-1} - \frac1{2j}\right)$. After $3k$ terms the partial sum of the new series is half the $2k$th partial sum of the old one, and the sums in between differ from it by vanishingly small terms. The new series converges to $\frac12\ln 2$. The same numbers in a different order, and the sum is halved. The trouble is that the series converges only because the pluses and minuses cancel.
A series $\sum a_n$ is called absolutely convergent if the series of absolute values $\sum |a_n|$ converges, and conditionally convergent if it converges itself but the series of absolute values doesn’t.
If the series $\sum |a_n|$ converges, then $\sum a_n$ converges too.
The numbers $b_n = a_n + |a_n|$ are either $0$ or $2|a_n|$, so $0 \le b_n \le 2|a_n|$. The series $\sum 2|a_n|$ converges, and by the comparison test so does $\sum b_n$. Then $\sum a_n = \sum (b_n - |a_n|)$ converges as well: its partial sums are differences of partial sums of two convergent series, and the limit of a difference is the difference of the limits.
The series $1 - \frac12 + \frac13 - \dots$ converges conditionally: its series of absolute values is the harmonic series. And for such series the order of the terms decides everything.
If a series converges conditionally, then for any number $L$ its terms can be rearranged so that the new series converges to $L$. They can also be rearranged so that the series diverges.
The idea: the supplies of positive and of negative terms are infinite, and the terms themselves get smaller. So you can close in on any target by overshooting it with ever smaller swings.
Bernhard Riemann proved this theorem in his 1854 paper on trigonometric series, published after his death. With absolutely convergent series the trick doesn’t work, as Dirichlet noticed back in 1837.
If a series converges absolutely, every rearrangement of its terms converges to the same sum.
The idea: in an absolutely convergent series almost all the “mass” is concentrated in finitely many initial terms, and rearranging those doesn’t change the sum. Let $\sum a_n = S$, and let the series $\sum b_n$ be made of the same terms in a different order. Take any $\varepsilon > 0$. The tails of the convergent series $\sum |a_n|$ tend to zero, so there’s an index $N$ with $|a_{N+1}| + |a_{N+2}| + \dots < \varepsilon$ and at the same time $|S_N - S| < \varepsilon$. The terms $a_1, \dots, a_N$ stand somewhere in the new series; let them all be among its first $M$ terms. For $m \ge M$ the partial sum $T_m = b_1 + \dots + b_m$ contains $a_1, \dots, a_N$ and a few more terms with indices greater than $N$, so $|T_m - S_N| < \varepsilon$. So $|T_m - S| < 2\varepsilon$ for all $m \ge M$, that is, $T_m \to S$.
The terms of the series $1 - \frac14 + \frac19 - \frac1{16} + \dots$ have been rearranged. Can the sum change?
The series of absolute values $\sum\frac1{n^2}$ converges, and by Dirichlet’s theorem every rearrangement gives the same sum, $\frac{\pi^2}{12}$. You can see this in Riemann’s machine: the positive terms add up to only $\frac{\pi^2}{8} \approx 1.23$, and they can’t reach the target $2$.
Room six: the polynomial double
Exhibit no. 6 · The Taylor series · London, 1715
Back to the question we started with. Suppose a function is written as an “infinite polynomial” centred at $a$: $f(x) = c_0 + c_1(x - a) + c_2(x - a)^2 + \dots$ At $x = a$ all the terms but the first vanish, and $c_0 = f(a)$. Differentiate: $f'(x) = c_1 + 2c_2(x - a) + \dots$, so $c_1 = f'(a)$. After $k$ differentiations, what’s left of $c_k(x - a)^k$ is $k!\,c_k$, so $c_k = \frac{f^{(k)}(a)}{k!}$: the coefficients are dictated by the derivatives at a single point. Here we’ve allowed ourselves to differentiate term by term without proof (inside the interval of convergence it’s legitimate, chapter 53), but the definition below doesn’t rely on it.
Let a function $f$ have derivatives up to order $n$ at the point $a$. The Taylor polynomial of degree $n$ is $T_n(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x - a)^k$: at the point $a$ it has the same value and first $n$ derivatives as $f$. If $f$ has derivatives of all orders, the infinite sum of the same form is called the Taylor series of $f$ at the point $a$; for $a = 0$ it’s also called the Maclaurin series.
The derivatives of the sine go round in a circle: $\sin$, $\cos$, $-\sin$, $-\cos$, $\sin$, …, which at zero gives $0, 1, 0, -1, 0, \dots$ So only odd powers with alternating signs are left in the series for the sine. Here are the room’s main exhibits; next to each is where the series converges to the function.
| Function | Taylor series at zero | Where it holds |
|---|---|---|
| $e^x$ | $1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \dots$ | for all $x$ |
| $\sin x$ | $x - \frac{x^3}{3!} + \frac{x^5}{5!} - \dots$ | for all $x$ |
| $\cos x$ | $1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \dots$ | for all $x$ |
| $\ln(1 + x)$ | $x - \frac{x^2}{2} + \frac{x^3}{3} - \dots$ | $-1 < x \le 1$ |
| $(1 + x)^\alpha$ | $1 + \alpha x + \frac{\alpha(\alpha - 1)}{2!}x^2 + \dots$ | $|x| < 1$ |
| $\frac{1}{1 + x^2}$ | $1 - x^2 + x^4 - x^6 + \dots$ | $|x| < 1$ |
| $\arctan x$ | $x - \frac{x^3}{3} + \frac{x^5}{5} - \dots$ | $|x| \le 1$ |
The fifth row is the binomial theorem for any exponent, promised in chapter 45. For natural $\alpha$ the coefficients with index greater than $\alpha$ become zero, and the series breaks off, turning into the ordinary binomial expansion. For $\alpha = \frac12$ it never breaks off: $\sqrt{1 + x} = 1 + \frac x2 - \frac{x^2}{8} + \frac{x^3}{16} - \dots$ Newton found this series in 1665, and the general method was described by Brook Taylor in a book of 1715.
A Taylor polynomial is an approximation, and we’d like to know its price: how wrong it is.
Let the function $f$ have continuous derivatives up to order $n + 1$ on the interval between $a$ and $x$, and let $|f^{(n+1)}| \le M$ on that interval. Then $|f(x) - T_n(x)| \le \frac{M\,|x - a|^{n+1}}{(n + 1)!}$.
The idea: start from the Newton–Leibniz formula and integrate by parts again and again; each time the next term of the Taylor polynomial splits off from the integral.
By the Newton–Leibniz formula (chapter 28) $f(x) = f(a) + \int_a^x f'(t)\,dt$. That’s the equation $f(x) = T_0(x) + R_0(x)$ with the remainder $R_0(x) = \int_a^x f'(t)\,dt$. Let’s prove by induction that $f(x) = T_n(x) + R_n(x)$, where
$$R_n(x) = \int_a^x f^{(n+1)}(t)\,\frac{(x - t)^n}{n!}\,dt.$$We already have the base case. The step: integrate $R_n$ by parts, taking $u = f^{(n+1)}(t)$ and $v = -\frac{(x - t)^{n+1}}{(n + 1)!}$; the derivative of this $v$ with respect to $t$ is exactly $\frac{(x - t)^n}{n!}$. Evaluating $uv$ from $a$ to $x$ gives $0 + \frac{f^{(n+1)}(a)}{(n + 1)!}(x - a)^{n+1}$, because at $t = x$ the factor $v$ vanishes. That’s exactly the next term of the Taylor polynomial. The remaining integral, $-\int_a^x v\,du = \int_a^x f^{(n+2)}(t)\frac{(x - t)^{n+1}}{(n + 1)!}\,dt$, is $R_{n+1}$. We’ve got $R_n = \frac{f^{(n+1)}(a)}{(n+1)!}(x - a)^{n+1} + R_{n+1}$, and $T_n + R_n = T_{n+1} + R_{n+1}$.
It remains to estimate the remainder. Under the integral $|f^{(n+1)}(t)| \le M$, and the factor $\frac{(x - t)^n}{n!}$ doesn’t change sign on the interval between $a$ and $x$, so $|R_n(x)| \le M\left|\int_a^x \frac{(x - t)^n}{n!}\,dt\right| = \frac{M\,|x - a|^{n+1}}{(n + 1)!}$.
For every real $x$ the Taylor series of $e^x$, $\sin x$ and $\cos x$ at zero converge to the values of these functions.
All the derivatives of the sine and cosine are $\pm\sin$ and $\pm\cos$, which are at most $1$ in absolute value. All the derivatives of the exponential equal $e^t$, and on the interval between $0$ and $x$ they’re at most $e^{|x|}$. In both cases $M$ doesn’t depend on $n$, and the remainder is at most $M\frac{|x|^{n+1}}{(n + 1)!}$. And $\frac{|x|^{n+1}}{(n + 1)!} \to 0$: it’s the general term of the series $\sum\frac{|x|^k}{k!}$, which converges by the ratio test (the ratio of neighbouring terms is $\frac{|x|}{k + 1} \to 0$), and the general term of a convergent series tends to zero. So $T_n(x) \to f(x)$.
The estimate can be almost exact. For $\sin 1$ the polynomial $x - \frac{x^3}{6} + \frac{x^5}{120}$ gives $0.841667$, while in fact $\sin 1 = 0.841471$. There’s no $x^6$ term in the series for the sine, so this polynomial is also $T_6$, and the estimate with $n = 6$ and $M = 1$ promises an error of at most $\frac{1}{7!} = \frac1{5040} \approx 0.000198$. The real error is $0.000196$.
Find the coefficient of $x^6$ in the Taylor series of $e^{-x^2}$ at zero.
Substitute $u = -x^2$ into the series for the exponential: $e^{u} = 1 + u + \frac{u^2}{2} + \frac{u^3}{6} + \dots$ The power $x^6$ comes only from the term $\frac{u^3}{6} = \frac{-x^6}{6}$. The coefficient is $-\frac16$. By the definition we’d have to differentiate $e^{-x^2}$ six times, find $f^{(6)}(0) = -120$, and then divide by $6! = 720$: the same answer.
Room seven: a boundary you can’t see
Exhibit no. 7 · The function $\frac{1}{1 + x^2}$ · an unsolved riddle
The series $1 + x + x^2 + \dots = \frac{1}{1 - x}$ holds only for $|x| < 1$, and that’s understandable: at $x = 1$ the function runs off to infinity. For $\ln(1 + x)$ the trouble is at $x = -1$, and the series converges only up to there. But $\frac1{1 + x^2}$ is a smooth function on the whole line, never more than one. Its series $1 - x^2 + x^4 - \dots$ (geometric, with $-x^2$ in place of $x$) also converges only for $|x| < 1$. At $x = 2$ the function is a calm $\frac15$, while the series $1 - 4 + 16 - \dots$ flies to pieces.
A series of the form $\sum_{k=0}^{\infty} c_k(x - a)^k$ is called a power series centred at $a$. A number $R$ such that the series converges for $|x - a| < R$ and diverges for $|x - a| > R$ is called the radius of convergence.
Every power series has a radius of convergence (it may be zero or infinity), but in general this needs the Cauchy–Hadamard formula. For the series we’ll meet, the ratio test is enough.
Let the coefficients of the power series $\sum c_k(x - a)^k$ be non-zero and $\left|\frac{c_k}{c_{k+1}}\right| \to R$, where $0 < R \le +\infty$. Then the series converges absolutely for $|x - a| < R$ and diverges for $|x - a| > R$.
Take $x \ne a$ and apply the ratio test to the series of absolute values $|c_k|\,|x - a|^k$. The ratio of neighbouring terms is $\left|\frac{c_{k+1}}{c_k}\right|\,|x - a| \to \frac{|x - a|}{R}$ (for $R = +\infty$, to zero). If $|x - a| < R$, the limit is less than $1$, and the series of absolute values converges. If $|x - a| > R$, the limit is greater than $1$: from some point on the absolute values of the terms grow, the terms don’t tend to zero, and the series diverges by the necessary condition.
On the boundary $|x - a| = R$ the theorem promises nothing, and things vary there. The series for $\ln(1 + x)$ at $x = 1$ becomes the alternating harmonic series and converges to $\ln 2$, while at $x = -1$ it becomes the harmonic series with a minus sign and diverges.
For which $x$ does the series $x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} + \dots$ converge?
The radius of convergence is $1$. On the boundary: at $x = 1$ we get $1 - \frac12 + \frac13 - \dots = \ln 2$, and the series converges by the alternating series test; at $x = -1$ we get the series $-\left(1 + \frac12 + \frac13 + \dots\right)$, which diverges.
Back to the riddle. Why does the series for $\frac1{1+x^2}$ trip up at $x = \pm1$, where nothing happens to the function? Take the centre not at zero but at a point $a$. Then the radius of convergence turns out to be $\sqrt{1 + a^2}$: about $1.41$ at $a = 1$, about $3.16$ at $a = 3$. It looks like the distance from the point $a$ to something standing one unit off the line. There’s no such point on the number line. Where it’s hiding will be revealed in chapter 34.
The last room: π drop by drop
Exhibit no. 8 · A series for π · India, around 1400; Europe, 1670s
The series for the arctangent, $x - \frac{x^3}{3} + \frac{x^5}{5} - \dots$, has radius of convergence $1$, and on the boundary itself, at $x = 1$, it still converges; in room five we proved that it converges to $\frac\pi4$:
$$\frac\pi4 = 1 - \frac13 + \frac15 - \frac17 + \dots$$In Europe the series for the arctangent was found in 1671 by James Gregory, and this special case by Leibniz in 1673–1674. In India it was known two and a half centuries earlier: the series is attributed to Madhava of Sangamagrama, the founder of the Kerala school.
The formula is beautiful, but computing with it is torture. By the alternating series test the error after $n$ terms is at most the next term, so after multiplying by $4$ it’s at most $\frac{4}{2n + 1}$, and in fact almost exactly $\frac1n$. A thousand terms give $3.14059265383979\dots$, with $\pi = 3.14159265358979\dots$ Surprisingly, just one digit is wrong, and the next six agree again. The reason is that the error differs from $\frac1{1000}$ by less than a billionth. Why this happens was explained in 1989 by Jonathan and Peter Borwein together with Karl Dilcher: the corrections to the error are expressed through the so-called Euler numbers.
What speeds up the computation is the arctangent series with an argument less than one: then the terms decrease like a geometric progression. Madhava, judging by the records of his followers, took $\arctan\frac1{\sqrt3} = \frac\pi6$ and got $\pi = \sqrt{12}\left(1 - \frac{1}{3 \cdot 3} + \frac{1}{5 \cdot 3^2} - \frac{1}{7 \cdot 3^3} + \dots\right)$: twenty terms of this series give ten correct decimal places. And in 1706 John Machin found an identity with which he computed a hundred digits.
$\frac\pi4 = 4\arctan\frac15 - \arctan\frac1{239}$.
The idea: when complex numbers are multiplied, their arguments add (chapter 15). The argument of the number $5 + i$ is $\arctan\frac15$, and the argument of $239 - i$ is $-\arctan\frac1{239}$. Compute $(5 + i)^2 = 24 + 10i$, $(5 + i)^4 = (24 + 10i)^2 = 476 + 480i$ and $(476 + 480i)(239 - i) = 114{,}244 + 114{,}244\,i$. The last number has equal real and imaginary parts, so its argument is $\frac\pi4$. So $4\arctan\frac15 - \arctan\frac1{239} = \frac\pi4 + 2\pi k$ for some integer $k$. The left side lies between $0$ and $4\arctan\frac15 < \frac45$, because $\arctan x < x$ for $x > 0$. Such a number can differ from $\frac\pi4$ by $2\pi k$ only if $k = 0$.
Formulas of this kind remained the record-breakers’ main tool for more than two hundred years, right up to the first computer calculations of $\pi$ in 1949. And the 1706 book by William Jones in which Machin’s hundred digits appeared is famous for something else too: in it the ratio of a circle’s circumference to its diameter was first denoted by the letter $\pi$.
Before leaving the museum, consolidate the exhibits in the trainer.
Where next
We’ve been through the cabinet of curiosities, and the question from the last chapter has its answer: many functions really can be written as “infinite polynomials”, but only within their radius of convergence and only if the remainder tends to zero. In the Taylor laboratory you could see that the approximation $\sin x \approx x$ works excellently for small $x$. It’ll come in handy straight away.
The laws of nature rarely say how much of something there will be. They say how fast it changes. A cup of coffee cools the faster the hotter it is. A pendulum accelerates the harder the further it’s displaced. An epidemic grows the faster the more people are ill and the more there are who haven’t been ill yet. In each case the unknown function stands both on the right-hand side and under the derivative sign, and integrating the rate, as in chapter 28, doesn’t work. How do you find the process itself from the law by which it changes? Newton, incidentally, solved such problems with series: he substituted an infinite polynomial and found the coefficients one after another. That’s where the chapter on differential equations begins.