Chapter IX · The logarithmic, exponential and circular functions of a real variable

The logarithmic series

§220 35 min

Integrating the geometric series 1−t+t2−…1 - t + t^2 - \dots term by term gives log⁡(1+x)=x−x2/2+x3/3−…\log(1+x) = x - x^2/2 + x^3/3 - \dots for −1<x≤1-1 < x \le 1, and the remainder is an area we can see and bound.

Why this matters

The logarithm was defined as an area, log⁡x=∫1xdt/t\log x = \int_1^x dt/t. To compute with it we want a power series, as we now have for exe^x. But log⁡x\log x itself has no expansion in powers of xx (it tends to −∞-\infty at 00), so §220 expands log⁡(1+x)\log(1 + x) instead. The result, x−12x2+13x3−…x - \tfrac12 x^2 + \tfrac13 x^3 - \dots, is valid only on the interval −1<x≤1-1 < x \le 1, and seeing exactly why is the main lesson: the proof is a model for §221 and for many later estimates.

The idea

Shift the integral: log⁡(1+x)=∫0xdt1+t\log(1 + x) = \int_0^x \frac{dt}{1+t}. For ∣t∣<1|t| < 1 the integrand is a geometric series, 1−t+t2−…1 - t + t^2 - \dots. Integrating term by term would give x−12x2+13x3−…x - \tfrac12 x^2 + \tfrac13 x^3 - \dots at once. But “integrate an infinite series term by term” is exactly the kind of step this book does not take on trust.

Hardy’s trick is to stop the geometric series after finitely many terms and keep the exact remainder. For any t≠−1t \ne -1 and any m≥1m \ge 1,

11+t=1−t+t2−⋯+(−1)m−1tm−1+(−1)mtm1+t,\frac{1}{1+t} = 1 - t + t^2 - \dots + (-1)^{m-1}t^{m-1} + (-1)^m \frac{t^m}{1+t},

which you can check by multiplying through by 1+t1 + t. Only finite sums are integrated, and the whole question becomes: how big is the integral of the last piece?

Explore The error is an area

Try this. Start with x=0.8x = 0.8 and m=3m = 3, then add terms. Next set xx close to 11, then try negative xx near −0.9-0.9, and finally push xx past 11.

ty
  • 11+t\frac{1}{1+t}
  • the first mm terms of the geometric series
  • area between them over [0,x][0, x] = error
Sum of the first 3 terms of the series: 0.65066667; log⁡(1+x)=0.58778666\log(1+x) = 0.58778666; error 0.0629 (the shaded area is 0.0629). Hardy’s bound: ∣Rm∣≤xm+1m+1=0.102|R_m| \le \frac{x^{m+1}}{m+1} = 0.102. Inside the range of validity: more terms, smaller area.
What to notice

The red area between the curve 1/(1+t)1/(1+t) and its truncated geometric series is exactly the error of the partial sum. For 0≤x≤10 \le x \le 1 it shrinks steadily as mm grows, slowly when x=1x = 1. For xx near −1-1 it shrinks too, but needs many terms. For x>1x > 1 the polynomial swings wildly beyond t=1t = 1 and the area explodes: no number of terms helps.

Precise statements

Theorem The logarithmic series Hardy: §220

If −1<x≤1-1 < x \le 1 then

log⁡(1+x)=x−x22+x33−⋯=∑n=1∞(−1)n−1xnn.\log(1+x) = x - \frac{x^2}{2} + \frac{x^3}{3} - \dots = \sum_{n=1}^\infty \frac{(-1)^{n-1}x^n}{n}.

If x>1x > 1 or x≤−1x \le -1 the series does not converge. In particular,

log⁡2=1−12+13−14+… .\log 2 = 1 - \frac12 + \frac13 - \frac14 + \dots.

The identity behind it is exact for every x>−1x > -1 and every mm:

log⁡(1+x)=x−x22+⋯+(−1)m−1xmm+(−1)mRm,Rm=∫0xtm1+t dt.\log(1+x) = x - \frac{x^2}{2} + \dots + (-1)^{m-1}\frac{x^m}{m} + (-1)^m R_m, \qquad R_m = \int_0^x \frac{t^m}{1+t}\,dt.

Proofs

Proof The logarithmic series
Strategy

Integrate the finite geometric sum with its exact remainder from 00 to xx, then show that the remainder integral RmR_m tends to 00, separately for 0≤x≤10 \le x \le 1 and for −1<x<0-1 < x < 0. Outside the interval, show that the terms do not tend to 00.

The exact identity

Integrate the identity for 1/(1+t)1/(1 + t) from 00 to xx; this is legitimate for x>−1x > -1, since then 1+t>01 + t > 0 on the whole range. The integral of tkt^k is xk+1/(k+1)x^{k+1}/(k+1), which gives the identity above with Rm=∫0xtm/(1+t) dtR_m = \int_0^x t^m/(1+t)\,dt.

0≤x≤10 \le x \le 1: Rm≤xm+1/(m+1)≤1/(m+1)R_m \le x^{m+1}/(m+1) \le 1/(m+1)

On [0,x][0, x] we have 1+t≥11 + t \ge 1, so 0≤tm/(1+t)≤tm0 \le t^m/(1+t) \le t^m. Integrating, 0≤Rm≤xm+1/(m+1)≤1/(m+1)0 \le R_m \le x^{m+1}/(m+1) \le 1/(m+1), which tends to 00.

−1<x<0-1 < x < 0: put x=−ξx = -\xi with 0<ξ<10 < \xi < 1

Substitute t=−ut = -u: Rm=±∫0ξum/(1−u) duR_m = \pm\int_0^{\xi} u^m/(1-u)\,du. On [0,ξ][0, \xi] we have 1−u≥1−ξ>01 - u \ge 1 - \xi > 0, so

∣Rm∣≤11−ξ∫0ξum du=ξm+1(m+1)(1−ξ)→0.|R_m| \le \frac{1}{1-\xi}\int_0^\xi u^m\,du = \frac{\xi^{m+1}}{(m+1)(1-\xi)} \to 0.

The factor 1/(1−ξ)1/(1 - \xi) is large when xx is near −1-1, but it is fixed while m→∞m \to \infty.

Outside (−1,1](-1, 1] the series diverges

If ∣x∣>1|x| > 1, then ∣x∣n/n→∞|x|^n/n \to \infty (powers beat nn), so the terms do not tend to 00 and the series cannot converge. If x=−1x = -1, the series is −(1+12+13+… )-(1 + \tfrac12 + \tfrac13 + \dots), the harmonic series, which diverges to −∞-\infty. (It must: log⁡(1+x)→−∞\log(1+x) \to -\infty as x→−1x \to -1.)

At x=1x = 1 the bound 1/(m+1)1/(m+1) is honest about how slow the series is: the error after mm terms really is about 1/(2m)1/(2m). Compare it with a point inside the interval.

Explore Inside the interval versus on its edge

Try this. This compares the errors of the series at x=1x = 1 (blue) and at x=0.5x = 0.5 (ochre) on a log scale. It starts with 30 terms; set Terms to 100100.

∑n=1∞(−1)n−1xnn\sum_{n=1}^{\infty} \frac{(-1)^{n-1}x^n}{n} compared with ∑n=1∞(−1)n−1xnn\sum_{n=1}^{\infty} \frac{(-1)^{n-1}x^n}{n}
n|s − sₙ| (log scale)
  • |s − sₙ| for (−1)n−1xnn\frac{(-1)^{n-1}x^n}{n}
  • |s − sₙ| for (−1)n−1xnn\frac{(-1)^{n-1}x^n}{n}
Plot
After 30 terms s30=0.6767581377s_{30} = 0.6767581377; the sum is 0.69314718, so ∣s−s30∣|s - s_{30}| = 0.0164. The series converges (but not absolutely) to 0.69314718. The comparison series converges to 0.40546511.
What to notice

At x=0.5x = 0.5 the error falls in a straight line on the log scale, like a geometric series: each term gains a fixed number of digits. At x=1x = 1 it creeps down like 1/m1/m: a hundred terms give only two decimals of log⁡2\log 2. Hardy calls the series at x=1x = 1 practically useless for computation, and Exercise 5 below shows a better way.

Worked examples and exercises

Exercise ●○○ Hardy: Examples XCII, 1

Show that log⁡11−x=x+x22+x33+…\log \dfrac{1}{1-x} = x + \dfrac{x^2}{2} + \dfrac{x^3}{3} + \dots for −1≤x<1-1 \le x < 1.

Hint
Replace xx by −x-x in the theorem.

Solution

log⁡11−x=−log⁡(1+(−x))\log\frac{1}{1-x} = -\log(1 + (-x)). The theorem applies to −x-x exactly when −1<−x≤1-1 < -x \le 1, that is, −1≤x<1-1 \le x < 1, and gives −(−x−12x2−13x3−… )=x+12x2+13x3+…-\bigl(-x - \tfrac12 x^2 - \tfrac13 x^3 - \dots\bigr) = x + \tfrac12 x^2 + \tfrac13 x^3 + \dots.

Exercise ●○○ Hardy: Examples XCII, 5

Show that log⁡2\log 2 lies between the sum of the first 2n2n and the sum of the first 2n+12n + 1 terms of 1−12+13−…1 - \frac12 + \frac13 - \dots.

Hint
Look at the sign of (−1)mRm(-1)^m R_m in the exact identity at x=1x = 1.

Solution

At x=1x = 1 the identity reads log⁡2=sm+(−1)mRm\log 2 = s_m + (-1)^m R_m with Rm=∫01tm/(1+t) dt>0R_m = \int_0^1 t^m/(1+t)\,dt > 0. For m=2nm = 2n this gives log⁡2>s2n\log 2 > s_{2n}; for m=2n+1m = 2n+1 it gives log⁡2<s2n+1\log 2 < s_{2n+1}. (This is also the alternating series test of §195, but here it falls out of the formula.)

Exercise ●●○ Hardy: Examples XCII, 3

Show that, for x>0x > 0, log⁡(1+x)=x1+x+12(x1+x)2+13(x1+x)3+…\log(1 + x) = \dfrac{x}{1+x} + \dfrac12\Bigl(\dfrac{x}{1+x}\Bigr)^2 + \dfrac13\Bigl(\dfrac{x}{1+x}\Bigr)^3 + \dots. Why is this useful even for large xx?

Hint
Put u=x/(1+x)u = x/(1+x). What is 1/(1−u)1/(1-u)?

Solution

With u=x/(1+x)u = x/(1+x) we have 0<u<10 < u < 1 and 1−u=1/(1+x)1 - u = 1/(1 + x), so log⁡(1+x)=log⁡11−u\log(1 + x) = \log\frac{1}{1-u}. By Exercise 1 this is u+12u2+13u3+…u + \frac12 u^2 + \frac13 u^3 + \dots. Unlike the original series, this one converges for every x>0x > 0 (indeed for every x≥−12x \ge -\tfrac12, where −1≤u<1-1 \le u < 1), though slowly when xx is large, since then uu is close to 11.

Exercise ●●○ Hardy: Examples XCII, 6

Find lim⁡x→11−x+log⁡x1−2x−x2\displaystyle\lim_{x \to 1} \frac{1 - x + \log x}{1 - \sqrt{2x - x^2}}.

Hint
Put x=1+hx = 1 + h and expand numerator and denominator in powers of hh.

Solution

With x=1+hx = 1 + h and ∣h∣<1|h| < 1, the logarithmic series gives 1−x+log⁡x=−h+(h−12h2+13h3−… )=−12h2+O(h3)1 - x + \log x = -h + \bigl(h - \tfrac12 h^2 + \tfrac13 h^3 - \dots\bigr) = -\tfrac12 h^2 + O(h^3). Also 2x−x2=1−h22x - x^2 = 1 - h^2, so by the binomial series 1−h2=1−12h2+O(h4)\sqrt{1 - h^2} = 1 - \tfrac12 h^2 + O(h^4) and the denominator is 12h2+O(h4)\tfrac12 h^2 + O(h^4). The ratio is −12+O(h)12+O(h2)→−1\dfrac{-\tfrac12 + O(h)}{\tfrac12 + O(h^2)} \to -1.

Exercise A fast series for log⁡2\log 2 ●●○ Hardy: Examples XCII, 7

Show that, for y>0y > 0,

log⁡y=2{y−1y+1+13(y−1y+1)3+15(y−1y+1)5+… },\log y = 2\left\{\frac{y-1}{y+1} + \frac13\Bigl(\frac{y-1}{y+1}\Bigr)^3 + \frac15\Bigl(\frac{y-1}{y+1}\Bigr)^5 + \dots\right\},

and use it with y=2y = 2 to find log⁡2\log 2 to three decimals.

Hint
Let u=(y−1)/(y+1)u = (y-1)/(y+1), so ∣u∣<1|u| < 1 and y=(1+u)/(1−u)y = (1 + u)/(1 - u). Subtract the series for log⁡(1−u)\log(1-u) from that for log⁡(1+u)\log(1+u).

Solution

For y>0y > 0, u=(y−1)/(y+1)u = (y-1)/(y+1) lies in (−1,1)(-1, 1) and y=(1+u)/(1−u)y = (1+u)/(1-u). Both log⁡(1+u)\log(1+u) and log⁡(1−u)\log(1-u) are given by the logarithmic series, and subtracting, the even powers cancel:

log⁡y=log⁡(1+u)−log⁡(1−u)=2(u+13u3+15u5+… ).\log y = \log(1+u) - \log(1-u) = 2\bigl(u + \tfrac13 u^3 + \tfrac15 u^5 + \dots\bigr).

For y=2y = 2, u=13u = \tfrac13: 2(13+181+11215+115309)=2(0.333333+0.012346+0.000823+0.000065)=0.6931352\bigl(\tfrac13 + \tfrac1{81} + \tfrac1{1215} + \tfrac1{15309}\bigr) = 2(0.333333 + 0.012346 + 0.000823 + 0.000065) = 0.693135. The neglected terms are positive and less than 29u9/(1−u2)=178732<2×10−5\tfrac29 u^9/(1 - u^2) = \tfrac{1}{78732} < 2 \times 10^{-5}, so 0.693135<log⁡2<0.6931480.693135 < \log 2 < 0.693148 and log⁡2=0.693…\log 2 = 0.693\ldots (in fact 0.69314720.6931472). Four terms here beat a thousand terms of 1−12+13−…1 - \tfrac12 + \tfrac13 - \dots.

Check yourself

Check yourself Choose one

For which xx does x−x22+x33−…x - \frac{x^2}{2} + \frac{x^3}{3} - \dots converge to log⁡(1+x)\log(1+x)?

Why

At x=1x = 1 the remainder is at most 1/(m+1)1/(m+1), so the series converges (to log⁡2\log 2). At x=−1x = -1 it is minus the harmonic series and diverges. For x>1x > 1 the function log⁡(1+x)\log(1 + x) is perfectly well defined, but the terms xn/nx^n/n do not tend to 00, so the series cannot represent it there: a function and its power series are different objects.

Check yourself Enter a number

At x=1x = 1 Hardy’s bound is 0≤Rm≤1/(m+1)0 \le R_m \le 1/(m+1). What is the smallest mm for which this bound is less than 0.0010.001?

Why

1/(m+1)<0.0011/(m+1) < 0.001 means m+1>1000m + 1 > 1000, so m=1000m = 1000. (For m=999m = 999 the bound equals 0.0010.001 exactly.) A thousand terms for three decimals: this is why the series is not used to compute log⁡2\log 2.

Check yourself True or false?

The series 1−12+13−…1 - \frac12 + \frac13 - \dots for log⁡2\log 2 converges absolutely.

Why

False. The series of absolute values is the harmonic series, which diverges. The logarithmic series converges absolutely for ∣x∣<1|x| < 1 but only conditionally at x=1x = 1; that is why its sum can be changed by rearranging it (Misc. Examples IX, 19, on the problems page).

Check yourself Choose one

In the proof for −1<x<0-1 < x < 0, the bound for ∣Rm∣|R_m| contains the factor 1/(1−ξ)1/(1-\xi), which is huge when xx is close to −1-1. Why does the proof still work?

Why

For a fixed xx the factor 1/(1−ξ)1/(1-\xi) is just a (possibly large) constant; it does not grow with mm. So the bound is a constant times ξm+1/(m+1)\xi^{m+1}/(m+1), which tends to 00. The largeness of the constant only means that more terms are needed near −1-1, as the widget showed.

Hardy’s language

It is natural to expect that log (1 + x) will be equal, when −1 < x < 1, to the series obtained by integrating each term of the series 1 − t + t² − … from t = 0 to t = x.

— G. H. Hardy, §220

Summary

Summary
  • log⁡(1+x)=x−12x2+13x3−…\log(1 + x) = x - \frac12 x^2 + \frac13 x^3 - \dots exactly when −1<x≤1-1 < x \le 1; at x=1x = 1 it gives log⁡2=1−12+13−…\log 2 = 1 - \frac12 + \frac13 - \dots.
  • Method: integrate a finite geometric sum with its exact remainder; the error is Rm=∫0xtm/(1+t) dtR_m = \int_0^x t^m/(1+t)\,dt, an area.
  • Bounds: 0≤Rm≤xm+1/(m+1)0 \le R_m \le x^{m+1}/(m+1) for 0≤x≤10 \le x \le 1, and ∣Rm∣≤ξm+1/((m+1)(1−ξ))|R_m| \le \xi^{m+1}/((m+1)(1-\xi)) for x=−ξ<0x = -\xi < 0.
  • Convergence is geometric inside the interval but only like 1/m1/m at x=1x = 1; recombining series, as in log⁡y=2∑u2k+1/(2k+1)\log y = 2\sum u^{2k+1}/(2k+1), gives fast methods.