Home › Logarithms › Lesson 8

Logarithms in Integration

Lesson 8 of 13

Key idea of this section

∫ dx/x = ln |x| + C   (separately on (−∞, 0) and (0, ∞))
∫₀¹ ln x dx = −1,   ∫₀π/2 ln sin x dx = −(π/2) ln 2,   ∫₀∞ (e⁻ᵃˣ − e⁻ᵇˣ)/x dx = ln(b/a)

The antiderivative of 1/x

On (0, ∞) an antiderivative of 1/x is ln x; on (−∞, 0) it is ln(−x), whose derivative is −1/(−x) = 1/x. Hence ∫ dx/x = ln |x| + C, with the warning that the constant may differ on the two intervals: the general antiderivative on ℝ∖{0} is ln |x| + C₁ for x > 0 and ln |x| + C₂ for x < 0. The power rule ∫ xᵃ dx = xᵃ⁺¹/(a + 1) fails exactly at a = −1, and the logarithm fills the gap continuously in the sense that (xᵃ⁺¹ − 1)/(a + 1) → ln x as a → −1, because (eh ln x − 1)/h → ln x as h = a + 1 → 0.

Standard integrals produced by logarithms

Every rational function has an elementary antiderivative consisting of a rational function, logarithms and arctangents; this is the partial-fraction theorem. For example

∫ dx/(x² − a²) = (1/(2a)) ln |(x − a)/(x + a)| + C,
∫ tan x dx = −ln |cos x| + C,
∫ sec x dx = ln |sec x + tan x| + C.

The last integral has a notable history. Edward Wright's 1599 tables for the Mercator projection were in effect numerical values of ∫ sec φ dφ; around 1645 Henry Bond noticed, by comparing tables, that they matched ln tan(π/4 + φ/2), and the identity was proved by James Gregory in 1668. One checks that ln tan(π/4 + φ/2) = ln(sec φ + tan φ).

Integration by parts gives ∫ ln x dx = x ln x − x + C and, more generally, ∫ xᵃ ln x dx = xᵃ⁺¹ ln x/(a + 1) − xᵃ⁺¹/(a + 1)² + C for a ≠ −1. As x → 0⁺, xᵃ⁺¹ ln x → 0 when a > −1, by Theorem 4.1, so

∫₀¹ xᵃ ln x dx = −1/(a + 1)²   (a > −1),   in particular ∫₀¹ ln x dx = −1.

The integral of ln sin

Theorem 8.1 (Euler). ∫₀π/2 ln sin x dx = −(π/2) ln 2.

Proof. The integral I converges because ln sin x ~ ln x near 0. By the substitution x ↦ π/2 − x, I = ∫₀π/2 ln cos x dx. So 2I = ∫₀π/2 ln(sin x cos x) dx = ∫₀π/2 ln(sin 2x) dx − (π/2) ln 2. With u = 2x, ∫₀π/2 ln sin 2x dx = ½ ∫₀π ln sin u du = I, by the symmetry of sin about π/2. Hence 2I = I − (π/2) ln 2. ∎

Frullani integrals

Theorem 8.2. For 0 < a < b, ∫₀∞ (e⁻ᵃˣ − e⁻ᵇˣ)/x dx = ln(b/a).

Proof. (e⁻ᵃˣ − e⁻ᵇˣ)/x = ∫ₐᵇ e⁻ᵗˣ dt. The integrand e⁻ᵗˣ is non-negative, so Tonelli's theorem allows interchanging the integrals: ∫₀∞ ∫ₐᵇ e⁻ᵗˣ dt dx = ∫ₐᵇ ∫₀∞ e⁻ᵗˣ dx dt = ∫ₐᵇ dt/t = ln(b/a). ∎

The same argument proves Frullani's general formula ∫₀∞ (f(ax) − f(bx))/x dx = (f(0) − f(∞)) ln(b/a) for suitable f. The logarithm appears because the measure dx/x is invariant under dilations (Lesson 3): dilating by a and by b and subtracting leaves only the "Haar length" ln(b/a) of the interval between the scales.

Integrals that define new functions

Liouville's theory of elementary functions (1830s), made algorithmic by Risch (1969), shows that some innocent integrands have no elementary antiderivative. The most important example for us is 1/ln x. We define the logarithmic integral

li(x) = PV ∫₀ˣ dt/ln t,   Li(x) = ∫₂ˣ dt/ln t = li(x) − li(2),   li(2) = 1.04516… ,

where PV denotes the Cauchy principal value at the singularity t = 1. Integration by parts repeatedly gives the asymptotic (divergent) expansion

li(x) ~ (x/ln x)(1 + 1!/ln x + 2!/(ln x)² + 3!/(ln x)³ + …).

These functions return in Lesson 10 as the best simple approximations to the prime-counting function.

Convergence tests calibrated by logarithms

Repeated logarithms give an infinite scale of convergence. For p real,

∫₂∞ dx/(x (ln x)ᵖ) converges if and only if p > 1,

since the substitution u = ln x turns it into ∫ln 2∞ u⁻ᵖ du. For p > 1 the value is (ln 2)¹⁻ᵖ/(p − 1). Similarly ∑ 1/(n ln n) diverges (like ln ln N) while ∑ 1/(n (ln n)²) converges, and one can continue with ∑ 1/(n ln n (ln ln n)ᵖ). Cauchy's condensation test, ∑ aₙ < ∞ ⟺ ∑ 2ᵏa2ᵏ < ∞ for decreasing positive aₙ, is the discrete counterpart of the substitution u = ln x.

Exercise

  • (a)
    Evaluate ∫₀¹ x² ln x dx.
  • (b)
    Evaluate ∫₀∞ (e⁻ˣ − e⁻³ˣ)/x dx.
  • (c)
    Decide whether ∑n≥3 1/(n ln n ln ln n) converges.
Show solution

Answers: (a) By the formula with a = 2, the value is −1/9. (b) By Frullani with a = 1, b = 3, the value is ln 3 ≈ 1.0986. (c) It diverges: the integral test with u = ln ln x gives ∫ du/u = ln ln ln x → ∞, very slowly.

V.3.1