Unit 3, chapter 14

Integrate an infinite expansion

How to evaluate an integral by term-by-term integration of a power series, using the exponential series, uniform convergence, a removable singularity at an endpoint and a geometric tail bound on the error.

  • Chapter 14
  • Symmetry, improper integrals, Simpson's rule and power series

The integrand (ex−1)/x(e^x - 1)/x on [0,1][0, 1] reads 0/00/0 at the left endpoint, and no antiderivative built from elementary functions exists, so the fundamental theorem has no formula to work with. Expanding exe^x as a power series turns the quotient into a sum of plain powers of xx, and each power is easy to integrate. This page shows why the endpoint is harmless, when an infinite sum may be integrated one term at a time, and how a bound on the omitted terms certifies the value 1.3179021.317902 to six decimal places.

Key terms

Removable singularity

Definition Let ff be defined at every point of an interval DD containing cc, except possibly at cc itself. The point cc is a removable singularity of ff if the limit L=lim⁡x→cf(x)L = \lim_{x \to c} f(x), taken over the points x≠cx \ne c of DD, exists as a finite number, but ff is undefined at cc or f(c)≠Lf(c) \ne L. Setting f(c)=Lf(c) = L gives the continuous extension of ff, which is continuous at cc. When cc is an endpoint of DD the limit is one-sided. For integrals this has a direct consequence. If ff is continuous on (a,b](a, b] and lim⁡x→a+f(x)=L\lim_{x \to a^+} f(x) = L is finite, the extension is continuous on [a,b][a, b], its integral over [a,b][a, b] is an ordinary integral, and that integral equals

lim⁡ε→0+∫a+εbf(x) dx.\lim_{\varepsilon \to 0^+} \int_{a + \varepsilon}^{b} f(x)\,dx .

In plain words The formula fails at one point, or gives the wrong value there, but near that point the graph has only a hole at a finite height. Filling the hole with the limiting value makes the function continuous on the whole closed interval. Changing a value at a single point does not change an integral, so filling the hole adds no area. What it does show is that the integrand is continuous, and therefore bounded, on the closed interval, so the integral is an ordinary one.

Example Because e0=1e^0 = 1, the quotient (ex−1)/x(e^x - 1)/x is the difference quotient of exe^x at 00. Its limit is the derivative of exe^x at 00, so

lim⁡x→0ex−1x=e0=1.\lim_{x \to 0} \frac{e^x - 1}{x} = e^0 = 1 .

The continuous extension ff has f(0)=1f(0) = 1 and is continuous on [0,1][0, 1]. By contrast, 1/x1/x has no finite limit as x→0+x \to 0^+, so 00 is not a removable singularity of 1/x1/x. For 0<ε<10 < \varepsilon < 1,

∫ε1dxx=−ln⁡ε,\int_{\varepsilon}^{1} \frac{dx}{x} = -\ln \varepsilon ,

which grows without bound as ε→0+\varepsilon \to 0^+, so the integral of 1/x1/x over [0,1][0, 1] diverges.

Power series

Definition A power series centered at x0x_0 is a series

∑n=0∞cn(x−x0)n\sum_{n=0}^{\infty} c_n (x - x_0)^n

with real coefficients cnc_n, read as a function of xx, with the convention (x−x0)0=1(x - x_0)^0 = 1 even at x=x0x = x_0. Every power series has a radius of convergence RR, which is 00, a positive number or ∞\infty, such that the series converges absolutely when ∣x−x0∣<R\lvert x - x_0 \rvert < R and diverges when ∣x−x0∣>R\lvert x - x_0 \rvert > R. At the endpoints x=x0±Rx = x_0 \pm R of a finite positive radius the series may converge or diverge, and each endpoint needs its own check. When R>0R > 0, the sum is a continuous function, and even a differentiable one, on the open interval (x0−R,x0+R)(x_0 - R, x_0 + R).

In plain words A power series is like a polynomial with infinitely many terms. Inside its interval of convergence it defines a well-behaved function. Outside that interval the series diverges and defines no value at all, even if some closed formula for its sum still makes sense there.

Example The geometric series has center 00, every coefficient equal to 11 and radius R=1R = 1. For ∣x∣<1\lvert x \rvert < 1 its sum is

∑n=0∞xn=11−x.\sum_{n=0}^{\infty} x^n = \frac{1}{1 - x} .

At x=1x = 1 and at x=−1x = -1 its terms do not tend to 00, so it diverges at both endpoints. The formula 1/(1−x)1/(1 - x) gives −1-1 at x=2x = 2, but the series 1+2+4+⋯1 + 2 + 4 + \cdots diverges there, so the identity holds only for ∣x∣<1\lvert x \rvert < 1.

Exponential series

Definition For a whole number n≥1n \ge 1 the factorial n!=1⋅2⋯nn! = 1 \cdot 2 \cdots n is the product of the positive integers up to nn, and 0!=10! = 1. The exponential series is the power series

ex=∑n=0∞xnn!,e^x = \sum_{n=0}^{\infty} \frac{x^n}{n!} ,

valid for every real xx. Its radius of convergence is infinite, because for x≠0x \ne 0 the ratio of the absolute values of consecutive terms is ∣x∣/(n+1)\lvert x \rvert / (n + 1), which tends to 00. Taylor’s theorem shows that the sum is exe^x.

In plain words Every power of xx appears, each divided by a factorial. The factorials grow so fast that for every fixed xx the terms tend to zero quickly enough for the series to converge, on the whole real line.

Example Subtract 11 to remove the constant term, then divide by x≠0x \ne 0. Each remaining power drops by one, so

ex−1x=∑n=1∞xn−1n!=1+x2+x26+⋯\begin{aligned} \frac{e^x - 1}{x} &= \sum_{n=1}^{\infty} \frac{x^{n-1}}{n!} \\[0.4em] &= 1 + \frac{x}{2} + \frac{x^2}{6} + \cdots \end{aligned}

The right side is again a power series with infinite radius. At x=0x = 0 only its first term survives, and its value 11 matches the continuous extension, so the series equals the extended integrand ff at every real xx. Since a power series is continuous inside its interval of convergence, this gives a second proof that the limit at 00 is 11. All the coefficients are positive, so ff increases on [0,1][0, 1], from f(0)=1f(0) = 1 to f(1)=e−1≈1.718f(1) = e - 1 \approx 1.718.

Uniform convergence

Definition A series ∑n≥1gn\sum_{n \ge 1} g_n of functions on a set EE, with partial sums SN=g1+⋯+gNS_N = g_1 + \cdots + g_N, converges uniformly on EE to a function SS if

sup⁡x∈E ∣S(x)−SN(x)∣→0\sup_{x \in E} \, \lvert S(x) - S_N(x) \rvert \to 0

as N→∞N \to \infty. Equivalently, for every ε>0\varepsilon > 0 there is one N0N_0 such that ∣S(x)−SN(x)∣<ε\lvert S(x) - S_N(x) \rvert < \varepsilon for every N≥N0N \ge N_0 and every xx in EE at once. The Weierstrass M-test gives a practical way to prove it. If ∣gn(x)∣≤Mn\lvert g_n(x) \rvert \le M_n for every nn and every xx in EE, and the series of numbers ∑Mn\sum M_n converges, then ∑gn\sum g_n converges uniformly and absolutely on EE, because at every xx the error after NN terms is at most ∑n>NMn\sum_{n > N} M_n. For a power series with radius R>0R > 0 and any rr with 0<r<R0 < r < R, the series converges absolutely at x=x0+rx = x_0 + r, so the M-test with Mn=∣cn∣rnM_n = \lvert c_n \rvert r^n gives uniform convergence on [x0−r,x0+r][x_0 - r, x_0 + r].

In plain words Pointwise convergence allows every xx its own number of terms. Uniform convergence asks for one number of terms that pushes the error below a chosen tolerance everywhere on the set at the same time. Draw a band of height ε\varepsilon above and below the graph of SS. From some NN on, the graph of every partial sum lies inside that band.

Example On [0,1][0, 1] the terms of the series for (ex−1)/x(e^x - 1)/x satisfy

∣xn−1n!∣≤1n!,\left\lvert \frac{x^{n-1}}{n!} \right\rvert \le \frac{1}{n!} ,

because ∣xn−1∣≤1\lvert x^{n-1} \rvert \le 1 there. The series ∑n≥11/n!\sum_{n \ge 1} 1/n! converges to e−1e - 1, so the M-test gives uniform convergence on [0,1][0, 1]. After four terms the error is below 0.010.01 at every point of the interval. The geometric series shows that uniform convergence can fail on the whole open interval of convergence. After the terms through xNx^N its error is

11−x−∑n=0Nxn=xN+11−x,\begin{aligned} &\frac{1}{1 - x} - \sum_{n=0}^{N} x^n \\[0.4em] &\quad = \frac{x^{N+1}}{1 - x} , \end{aligned}

which grows without bound as x→1−x \to 1^-, whatever NN is. On [−r,r][-r, r] with 0<r<10 < r < 1 the error is at most rN+1/(1−r)r^{N+1}/(1 - r), which tends to 00, so there the convergence is uniform.

Term-by-term integration

Definition Let g1,g2,…g_1, g_2, \dots be integrable on [a,b][a, b], and suppose ∑gn\sum g_n converges uniformly on [a,b][a, b] to SS. Then SS is integrable on [a,b][a, b] and

∫abS(x) dx=∑n=1∞∫abgn(x) dx.\begin{aligned} &\int_a^b S(x)\,dx \\[0.4em] &\quad = \sum_{n=1}^{\infty} \int_a^b g_n(x)\,dx . \end{aligned}

The reason is that the integral of the remainder is at most a width times a height in absolute value,

∣∫ab(S−SN) dx∣≤(b−a)sup⁡[a,b]∣S−SN∣,\begin{aligned} &\left\lvert \int_a^b \bigl(S - S_N\bigr)\,dx \right\rvert \\[0.4em] &\quad \le (b - a) \sup_{[a, b]} \lvert S - S_N \rvert , \end{aligned}

and uniform convergence sends the height to 00. A power series with radius R>0R > 0 converges uniformly on every closed interval inside (x0−R,x0+R)(x_0 - R, x_0 + R), so it may be integrated term by term over any such interval.

In plain words Swapping the sum and the integral exchanges two limits, so it needs a reason. Uniform convergence supplies one, since the leftover part of the sum is uniformly small, and a uniformly small function over an interval of finite length has a small integral. Convergence at each point alone is not enough. The functions equal to NN on (0,1/N)(0, 1/N) and to 00 elsewhere tend to 00 at every point of [0,1][0, 1], yet each of them has integral 11 over [0,1][0, 1].

Example The series for the extended integrand converges uniformly on [0,1][0, 1] and its terms are continuous, so

I=∫01ex−1x dx=∑n=1∞1n!∫01xn−1 dx.\begin{aligned} I &= \int_0^1 \frac{e^x - 1}{x}\,dx \\[0.4em] &= \sum_{n=1}^{\infty} \frac{1}{n!} \int_0^1 x^{n-1}\,dx . \end{aligned}

Here the integrand takes the value 11 at x=0x = 0, and the improper reading as a limit of integrals over [ε,1][\varepsilon, 1] gives the same number. Since the integral of xn−1x^{n-1} over [0,1][0, 1] is 1/n1/n for every n≥1n \ge 1,

I=∑n=1∞1n n!=1+14+118+⋯\begin{aligned} I &= \sum_{n=1}^{\infty} \frac{1}{n\,n!} \\[0.4em] &= 1 + \frac{1}{4} + \frac{1}{18} + \cdots \end{aligned}

The next terms are 1/961/96 and 1/6001/600. The constant term of the integrand contributes area 11 and every other term adds positive area, so I>1I > 1, and since the integrand rises from 11 to e−1e - 1, also I<e−1I < e - 1. The series is itself an exact answer. In terms of special functions it equals Ei⁡(1)−γ\operatorname{Ei}(1) - \gamma, where Ei⁡\operatorname{Ei} is the exponential integral and γ≈0.5772\gamma \approx 0.5772 is Euler’s constant.

Geometric tail bound

Definition Let ∑n≥1an\sum_{n \ge 1} a_n be a series of positive terms, fix a whole number N≥0N \ge 0, and write SN=a1+⋯+aNS_N = a_1 + \cdots + a_N for the partial sum and TN=∑n>NanT_N = \sum_{n > N} a_n for the tail. Suppose there is a number qq with 0<q<10 < q < 1 such that an+1≤q ana_{n+1} \le q\,a_n for every n≥N+1n \ge N + 1. Then aN+1+k≤qkaN+1a_{N+1+k} \le q^k a_{N+1} for every k≥0k \ge 0, and comparison with a geometric series shows that the series converges and

0<TN≤aN+11−q.0 < T_N \le \frac{a_{N+1}}{1 - q} .

So the sum SS satisfies SN<S≤SN+aN+1/(1−q)S_N < S \le S_N + a_{N+1}/(1 - q), and the upper inequality is strict when an+1<q ana_{n+1} < q\,a_n for every n≥N+1n \ge N + 1.

In plain words Once every term is at most a fixed fraction qq of the one before it, the omitted terms add up to no more than a geometric series that starts with the first omitted term. That geometric series has a simple sum, so the whole infinite remainder is bounded by a number you can compute. With positive terms every partial sum is an underestimate, and the bound says by how much at most.

Example For an=1/(n n!)a_n = 1/(n\,n!) the ratio of consecutive terms is

an+1an=n(n+1)2<1n+1.\frac{a_{n+1}}{a_n} = \frac{n}{(n+1)^2} < \frac{1}{n + 1} .

For n≥N+1n \ge N + 1 this is less than 1/(N+2)1/(N + 2), so q=1/(N+2)q = 1/(N + 2) works, with strict inequality, and

0<I−SN<N+2N+1 aN+1.0 < I - S_N < \frac{N + 2}{N + 1}\, a_{N+1} .
NNSNS_N, roundedBound on I−SNI - S_N, rounded up
441.3159722221.3159722220.0020.002
661.3178703701.3178703703.3×10−53.3 \times 10^{-5}
881.3179018151.3179018153.5×10−73.5 \times 10^{-7}
10101.3179021491.3179021492.5×10−92.5 \times 10^{-9}

With N=8N = 8 the bound gives 1.3179018<I<1.31790221.3179018 < I < 1.3179022, and every number in that interval rounds to 1.3179021.317902, so I≈1.317902I \approx 1.317902 to six decimal places. With N=7N = 7 the bound is about 3.5×10−63.5 \times 10^{-6}, more than one unit in the sixth decimal, so the interval it gives cannot fix that digit. Ten terms give 1.317902148<I<1.3179021521.317902148 < I < 1.317902152, which fixes eight decimals, I≈1.31790215I \approx 1.31790215.

Check yourself

  1. Use the geometric series to write ln⁡2\ln 2 as a series, starting from the identity
ln⁡2=∫01/2dx1−x.\ln 2 = \int_0^{1/2} \frac{dx}{1 - x} .

Why is term-by-term integration allowed on this interval?

Show the answer

The starting identity holds because −ln⁡(1−x)-\ln(1 - x) is an antiderivative of 1/(1−x)1/(1 - x) for x<1x < 1, and −ln⁡12+ln⁡1=ln⁡2-\ln \tfrac12 + \ln 1 = \ln 2. For ∣x∣<1\lvert x \rvert < 1 the integrand equals ∑n≥0xn\sum_{n \ge 0} x^n. The interval [0,12][0, \tfrac12] lies inside the interval of convergence (−1,1)(-1, 1). On it ∣xn∣≤(12)n\lvert x^n \rvert \le (\tfrac12)^n, and ∑n≥0(12)n=2\sum_{n \ge 0} (\tfrac12)^n = 2 converges, so the M-test gives uniform convergence of a series of continuous terms. Integrating term by term,

∫01/2xn dx=1(n+1) 2n+1,\int_0^{1/2} x^n\,dx = \frac{1}{(n + 1)\,2^{n+1}} ,

and with k=n+1k = n + 1,

ln⁡2=∑k=1∞1k 2k=12+18+124+⋯\begin{aligned} \ln 2 &= \sum_{k=1}^{\infty} \frac{1}{k\,2^k} \\[0.4em] &= \frac{1}{2} + \frac{1}{8} + \frac{1}{24} + \cdots \end{aligned}

The first four terms add up to about 0.68230.6823, a little below ln⁡2≈0.6931\ln 2 \approx 0.6931, as expected for a series of positive terms.

  1. A classmate evaluates the integral of ex/xe^x/x over [0,1][0, 1] by writing ex/x=∑n≥0xn−1/n!e^x/x = \sum_{n \ge 0} x^{n-1}/n! and integrating term by term. What goes wrong, and does the integral have a value?
Show the answer

The term with n=0n = 0 is x−1x^{-1}, so the right side is not a power series, and the singularity at 00 is not removable, since ex/x→∞e^x/x \to \infty as x→0+x \to 0^+. Split the integrand as 1/x+(ex−1)/x1/x + (e^x - 1)/x for x≠0x \ne 0. For 0<ε<10 < \varepsilon < 1,

∫ε1exx dx=−ln⁡ε+∫ε1ex−1x dx.\begin{aligned} \int_{\varepsilon}^{1} \frac{e^x}{x}\,dx &= -\ln \varepsilon \\[0.4em] &\quad + \int_{\varepsilon}^{1} \frac{e^x - 1}{x}\,dx . \end{aligned}

As ε→0+\varepsilon \to 0^+ the last integral tends to I≈1.3179I \approx 1.3179, while −ln⁡ε-\ln \varepsilon grows without bound. So the improper integral diverges and has no value. Term-by-term integration would start with the integral of 1/x1/x over [0,1][0, 1], which already diverges. The method works only after the 1/x1/x part is removed, and subtracting 11 in ex−1e^x - 1 does exactly that.

  1. Find the value of the integral below to four decimal places with a certified error bound, and then check it against II with integration by parts.
J=∫01ex−1−xx2 dxJ = \int_0^1 \frac{e^x - 1 - x}{x^2}\,dx
Show the answer

At x=0x = 0 the quotient reads 0/00/0. For x≠0x \ne 0, subtracting 1+x1 + x from the exponential series and dividing by x2x^2 gives

ex−1−xx2=∑n=2∞xn−2n!=12+x6+x224+⋯\begin{aligned} \frac{e^x - 1 - x}{x^2} &= \sum_{n=2}^{\infty} \frac{x^{n-2}}{n!} \\[0.4em] &= \frac{1}{2} + \frac{x}{6} + \frac{x^2}{24} + \cdots \end{aligned}

This is a power series with infinite radius, so its sum is continuous and the limit at 00 is its value there, 12\tfrac12. The singularity is removable, and the integral uses the extension with value 12\tfrac12 at 00. On [0,1][0, 1] each term is at most 1/n!1/n! in absolute value and ∑n≥21/n!=e−2\sum_{n \ge 2} 1/n! = e - 2 converges, so the convergence is uniform. Since the integral of xn−2x^{n-2} over [0,1][0, 1] is 1/(n−1)1/(n - 1) for n≥2n \ge 2,

J=∑n=2∞1(n−1) n!=12+112+172+⋯\begin{aligned} J &= \sum_{n=2}^{\infty} \frac{1}{(n - 1)\,n!} \\[0.4em] &= \frac{1}{2} + \frac{1}{12} + \frac{1}{72} + \cdots \end{aligned}

With bn=1/((n−1) n!)b_n = 1/((n - 1)\,n!) the ratio of consecutive terms is

bn+1bn=n−1n(n+1)<1n+1.\frac{b_{n+1}}{b_n} = \frac{n - 1}{n(n + 1)} < \frac{1}{n + 1} .

Keep the terms n=2n = 2 to 66, whose sum is 12+112+172+1480+13600=14392400≈0.5995833\tfrac12 + \tfrac{1}{12} + \tfrac{1}{72} + \tfrac{1}{480} + \tfrac{1}{3600} = \tfrac{1439}{2400} \approx 0.5995833. For n≥7n \ge 7 the ratio is below 18\tfrac18, so the tail is less than b7/(1−18)=87⋅130240=126460≈0.0000378b_7/(1 - \tfrac18) = \tfrac87 \cdot \tfrac{1}{30240} = \tfrac{1}{26460} \approx 0.0000378. Hence 0.5995833<J<0.59962120.5995833 < J < 0.5996212, and both ends round to 0.59960.5996, so J≈0.5996J \approx 0.5996 to four decimal places.

For the check, integrate by parts on [ε,1][\varepsilon, 1] with u=ex−1−xu = e^x - 1 - x and dv=dx/x2dv = dx/x^2, so du=(ex−1) dxdu = (e^x - 1)\,dx and v=−1/xv = -1/x. The boundary term is −(ex−1−x)/x-(e^x - 1 - x)/x evaluated from ε\varepsilon to 11, so

∫ε1ex−1−xx2 dx=−(e−2)+eε−1−εε+∫ε1ex−1x dx.\begin{aligned} &\int_{\varepsilon}^{1} \frac{e^x - 1 - x}{x^2}\,dx \\[0.4em] &\quad = -(e - 2) + \frac{e^{\varepsilon} - 1 - \varepsilon}{\varepsilon} \\[0.4em] &\qquad + \int_{\varepsilon}^{1} \frac{e^x - 1}{x}\,dx . \end{aligned}

The middle term equals ε\varepsilon times a quotient that tends to 12\tfrac12, so it tends to 00 as ε→0+\varepsilon \to 0^+. Therefore J=I−(e−2)J = I - (e - 2). With I≈1.31790215I \approx 1.31790215 and e−2≈0.71828183e - 2 \approx 0.71828183 this gives J≈0.59962032J \approx 0.59962032, which lies inside the certified interval.