Chapter VI · Derivatives and integrals

Integration and the logarithmic function

§§130–131 35 min

Integration as the inverse of differentiation, why every integral carries an arbitrary constant, the first standard forms, and the logarithm as the integral of 1/x1/x.

Why this matters

So far in this chapter we have been given a function ϕ\phi and asked for its derivative ϕ′\phi'. Now Hardy turns the question round: given a function ψ\psi, find a function ϕ\phi with ϕ′=ψ\phi' = \psi. This is integration in Hardy’s first sense. The question has three separate parts (does a solution exist, how many are there, and how do we write one down), and they have very different answers. One of them forces a new function on us: the logarithm.

The idea

Differentiation is a machine that always runs forward. Feed it x3/3−xx^3/3 - x and out comes x2−1x^2 - 1. Integration asks the machine to run backwards: we see the output x2−1x^2 - 1 and want an input. Two difficulties appear at once.

The first is that the machine forgets constants. The functions x3/3−xx^3/3 - x, x3/3−x+1x^3/3 - x + 1 and x3/3−x−7x^3/3 - x - 7 all have the same derivative, because adding a constant shifts a graph up or down without changing its slope anywhere. So the backwards question never has just one answer. The real question is whether it has only these answers.

Explore A family of integrals

Try this. The upper plot shows ψ(x)=x2−1\psi(x) = x^2 - 1. The lower plot shows several functions whose derivative is ψ\psi. Drag the black anchor point anywhere: the bold curve is the integral that passes through it. Then move the probe pp with the slider, and compare the purple tangents.

ψ(x)=x2−1\psi(x) = x^2 - 1 and its integrals ϕ(x)+C=13x3−x+C\phi(x) + C = \tfrac13 x^3 - x + C
xψ(x)
xφ(x) + C
  • ψ, the given function
  • integrals φ + C (bold: yours)
  • anchor (drag)
  • tangents at x = p
The curve through (0, 0.5)(0,\ 0.5) is 13x3−x+0.5\tfrac13 x^3 - x + 0.5. At x=1.5x = 1.5 every member has slope ψ(1.5)=1.25\psi(1.5) = 1.25.
What to notice

Every curve in the family is a vertical translate of every other, so at a given xx they all have the same slope ψ(p)\psi(p): the tangents are parallel. Choosing one point the curve must pass through picks out exactly one member. Switch to cos⁡x\cos x and 1/(1+x2)1/(1+x^2): the same picture every time.

The second difficulty is that running the machine backwards may be impossible, or possible only with functions we have not met yet. We know (Ex. XLII. 4 in Hardy) that 1/x1/x is not the derivative of any polynomial or rational function. If 1/x1/x has an integral at all, it must be a new kind of function.

Precise statements

Definition Integral, integration Hardy: §130

If ϕ′(x)=ψ(x)\phi'(x) = \psi(x), then ϕ\phi is called an integral (or integral function) of ψ\psi, and the process of finding ϕ\phi from ψ\psi is called integration. We write

ϕ(x)=∫ψ(x) dx.\phi(x) = \int \psi(x)\,dx .

The symbol ∫…dx\int \dots dx is, for now, purely an operator, like d/dxd/dx. Neither ∫\int nor dxdx means anything by itself. Its connection with areas and sums comes in §148 and Chapter VII.

Hardy splits the problem into three questions.

  1. Existence. Is there any ϕ\phi with ϕ′=ψ\phi' = \psi? Not always. A function with a jump, such as one equal to aa for x<0x < 0, bb at 00 and cc for x>0x > 0 with a,b,ca, b, c not all equal, is the derivative of nothing: by Darboux’s theorem (§129) a derivative cannot jump. But if ψ\psi is continuous, an integral always exists. Hardy proves this in Chapter VII, by way of the definite integral; until then we take it on trust.
  2. Uniqueness. If ϕ\phi is one integral, every other has the form ϕ+C\phi + C. This is the next theorem.
  3. Finding a formula. This is the practical art that fills the rest of the chapter. It is much harder than differentiation, and sometimes impossible with the functions available.
Theorem Integrals differ by constants Hardy: §130 (2)

Let ϕ\phi be an integral of ψ\psi on an interval II. Then ϕ+C\phi + C is an integral of ψ\psi on II for every constant CC, and every integral of ψ\psi on II is of this form.

The words “on an interval” matter. The function ψ(x)=1/x\psi(x) = 1/x is defined on two intervals, x<0x < 0 and x>0x > 0, and on each of them separately its integrals are fixed up to a constant, but the two constants have nothing to do with each other.

The standard forms

Reading the derivatives of §§117–120 backwards gives the first table of integrals. Each formula gives one integral; the most general one adds an arbitrary constant CC.

∫xm dx=xm+1m+1(m≠−1),∫cos⁡x dx=sin⁡x,∫sin⁡x dx=−cos⁡x,\int x^m\,dx = \frac{x^{m+1}}{m+1} \quad (m \ne -1), \qquad \int \cos x\,dx = \sin x, \qquad \int \sin x\,dx = -\cos x, ∫dx1+x2=arctan⁡x,∫dx1−x2=arcsin⁡x.\int \frac{dx}{1+x^2} = \arctan x, \qquad \int \frac{dx}{\sqrt{1-x^2}} = \arcsin x .

Here mm is rational, and for fractional mm we work where xmx^m is defined, for instance x>0x > 0. Each formula is checked by differentiating the right-hand side.

The first formula breaks down for m=−1m = -1, where it would divide by zero. This is not an accident of notation: no polynomial or rational function has derivative 1/x1/x.

The logarithmic function

Hardy now assumes, until Chapter VII proves it, that some function has derivative 1/x1/x for x>0x > 0. The area under 1/t1/t from 11 to xx is a natural candidate, and the widget below shows numerically that its slope is 1/x1/x.

Explore A function whose slope is 1/x1/x

Try this. Drag xx along the axis and compare the slope of the lower curve with the height of the upper one. Then drag xx to the left of 11.

F(x)=∫ax1t dtF(x) = \int_{a}^{x} \frac1t\,dt, a=1a = 1
tf(t)
xF(x)
  • f(t)
  • counts +
  • counts −
  • F(x)
  • x (drag)
F(2.5)=∫12.51t dt=0.91629F(2.5) = \int_{1}^{2.5} \frac1t\,dt = 0.91629. Slope of FF at xx: F′(x)=f(x)=0.4F'(x) = f(x) = 0.4.
What to notice

The lower curve F(x)F(x) is 00 at x=1x = 1 and has slope exactly 1/x1/x everywhere, so it is an integral of 1/x1/x. For x<1x < 1 the area is counted negatively, so F(x)<0F(x) < 0 there. This FF is the logarithm. Hardy only assumes, here, that such a function exists; Chapter IX builds it this way.

Definition The logarithmic function Hardy: §131

For x>0x > 0, log⁡x\log x denotes the integral of 1/x1/x (fixed so that log⁡1=0\log 1 = 0):

∫dxx=log⁡x(x>0).\int \frac{dx}{x} = \log x \qquad (x > 0).

For negative xx, the chain rule gives ddxlog⁡(−x)=−1−x=1x\dfrac{d}{dx}\log(-x) = \dfrac{-1}{-x} = \dfrac1x, so log⁡(−x)\log(-x) is an integral of 1/x1/x on x<0x < 0. The two cases combine into one formula:

Theorem The integral of 1/x1/x Hardy: §131 (4), (5)

For every real x≠0x \ne 0,

∫dxx=log⁡∣x∣,\int \frac{dx}{x} = \log|x| ,

in the sense that ddxlog⁡∣x∣=1x\dfrac{d}{dx}\log|x| = \dfrac1x for all x≠0x \ne 0.

Hardy also quotes, ahead of their proof in Chapter IX, the rules log⁡1=0\log 1 = 0, log⁡(1/x)=−log⁡x\log(1/x) = -\log x and log⁡xy=log⁡x+log⁡y\log xy = \log x + \log y. Nothing in this chapter depends on them; they only make answers shorter.

Explore Two intervals, two constants

Try this. Here ψ(x)=1/x\psi(x) = 1/x. There is an anchor on each side of the axis. Drag them independently, so that the bold curve on the left and the bold curve on the right come from different members of the family.

ψ(x)=1x\psi(x) = \dfrac1x and its integrals ϕ(x)+C=log⁡∣x∣+C\phi(x) + C = \log|x| + C
xψ(x)
xφ(x) + C
  • ψ, the given function
  • integrals φ + C (bold: yours)
  • anchor (drag)
  • tangents at x = p
Your integral is log⁡∣x∣+0\log|x| + 0 for x<0x < 0 and log⁡∣x∣+1.5\log|x| + 1.5 for x>0x > 0. The two constants differ, yet its derivative is 1/x at every x ≠ 0. At x=2x = 2 every member has slope ψ(2)=0.5\psi(2) = 0.5.
What to notice

The function you have built is differentiable at every x≠0x \ne 0 with derivative 1/x1/x, so it is an integral of 1/x1/x. But it is not log⁡∣x∣+C\log|x| + C for any single CC. The uniqueness theorem holds on each interval separately, and R∖{0}\mathbb{R} \setminus \{0\} is not an interval.

Proofs

Proof Integrals differ by constants
Strategy

One direction is a one-line check. For the other, look at the difference of two integrals: its derivative is zero, and the mean value theorem says a function with zero derivative on an interval is constant (§127).

ϕ+C\phi + C is an integral

The derivative of a constant is 00, so (ϕ+C)′=ϕ′=ψ(\phi + C)' = \phi' = \psi on II.

Take any other integral χ\chi and form δ=χ−ϕ\delta = \chi - \phi

Both χ\chi and ϕ\phi are differentiable on II with derivative ψ\psi, so δ′=ψ−ψ=0\delta' = \psi - \psi = 0 at every point of II.

δ\delta is constant on II

Take any two points a<ba < b of II. Because II is an interval, all of [a,b][a, b] lies in II, so δ\delta is continuous on [a,b][a, b] and differentiable inside. The mean value theorem gives δ(b)−δ(a)=(b−a) δ′(ξ)=0\delta(b) - \delta(a) = (b - a)\,\delta'(\xi) = 0 for some ξ\xi between aa and bb.

Conclude

So δ\delta takes the same value CC at every point of II, and χ=ϕ+C\chi = \phi + C.

The third step is where “interval” is used. For 1/x1/x on R∖{0}\mathbb{R} \setminus \{0\} the points a=−1a = -1, b=1b = 1 do not have [a,b][a, b] inside the domain, and the argument (rightly) fails.

Proof log⁡∣x∣\log|x| is an integral of 1/x1/x for every x≠0x \ne 0
Strategy

Treat the two signs of xx separately; on each side ∣x∣|x| is a simple formula.

x>0x > 0

Then ∣x∣=x|x| = x near xx, so ddxlog⁡∣x∣=ddxlog⁡x=1x\dfrac{d}{dx}\log|x| = \dfrac{d}{dx}\log x = \dfrac1x by the definition of log⁡\log.

x<0x < 0

Then ∣x∣=−x|x| = -x near xx. By the chain rule (§114), with u=−x>0u = -x > 0, ddxlog⁡(−x)=1u⋅(−1)=−1−x=1x\dfrac{d}{dx}\log(-x) = \dfrac1u \cdot (-1) = \dfrac{-1}{-x} = \dfrac1x.

Worked examples and exercises

Exercise A jump has no integral ●●○ Hardy: §130; Examples XLVII, 5

Let ψ(x)=a\psi(x) = a for x<0x < 0, ψ(0)=b\psi(0) = b, ψ(x)=c\psi(x) = c for x>0x > 0. Show that there is a function ϕ\phi with ϕ′=ψ\phi' = \psi everywhere only when a=b=ca = b = c.

Hint
If a=b=ca = b = c, write one down. Otherwise, suppose ϕ\phi exists and look at ϕ\phi on x>0x > 0 and on x<0x < 0 separately.
Hint
On x>0x > 0, ϕ(x)=cx+C1\phi(x) = cx + C_1; on x<0x < 0, ϕ(x)=ax+C2\phi(x) = ax + C_2. Continuity at 00 and the one-sided difference quotients do the rest.

Solution

If a=b=ca = b = c, then ϕ(x)=ax\phi(x) = ax works.

Conversely, suppose ϕ′=ψ\phi' = \psi everywhere. On the interval x>0x > 0, ϕ\phi and cxcx have the same derivative, so ϕ(x)=cx+C1\phi(x) = cx + C_1 there; likewise ϕ(x)=ax+C2\phi(x) = ax + C_2 for x<0x < 0. A differentiable function is continuous, so ϕ(0)=lim⁡x→0+ϕ(x)=C1\phi(0) = \lim_{x \to 0+}\phi(x) = C_1 and ϕ(0)=lim⁡x→0−ϕ(x)=C2\phi(0) = \lim_{x\to 0-}\phi(x) = C_2. Hence for h>0h > 0, {ϕ(h)−ϕ(0)}/h=c\{\phi(h) - \phi(0)\}/h = c, and for h<0h < 0 it equals aa. The derivative at 00 exists only if these agree, so a=ca = c, and then ϕ′(0)=c\phi'(0) = c, which must equal bb. So a=b=ca = b = c.

(Darboux’s theorem, §129, gives the same conclusion at once: a derivative takes every value between any two of its values, and ψ\psi does not.)

Exercise 1/x1/x is not the derivative of a rational function ●●● Hardy: §131; Examples XLII, 4

Show that there is no rational function RR with R′(x)=1/xR'(x) = 1/x.

Hint
Write RR in partial fractions, as in §118: a polynomial plus terms A/(x−α)pA/(x - \alpha)^p with p≥1p \ge 1 (the α\alpha may be complex).
Hint
Differentiate term by term. Can a term with p=1p = 1 appear in R′R'?

Solution

Write R(x)=Π(x)+∑Aα,p/(x−α)pR(x) = \Pi(x) + \sum A_{\alpha,p}/(x - \alpha)^p, with Π\Pi a polynomial, the sum finite, p≥1p \ge 1 and every Aα,p≠0A_{\alpha,p} \ne 0. Then

R′(x)=Π′(x)−∑p Aα,p(x−α)p+1.R'(x) = \Pi'(x) - \sum \frac{p\,A_{\alpha,p}}{(x-\alpha)^{p+1}} .

This is again a partial-fraction expression: a polynomial plus terms with exponents p+1≥2p + 1 \ge 2. The expression of a rational function in partial fractions is unique, so the expression for R′R' contains no term with exponent 11. But 1/x1/x is a single term with exponent 11 and α=0\alpha = 0. Hence R′≠1/xR' \ne 1/x.

Exercise Two answers that look different ●○○ Hardy: §131

Show that arcsin⁡x\arcsin x and −arccos⁡x-\arccos x are both integrals of 1/1−x21/\sqrt{1-x^2} on −1<x<1-1 < x < 1, and find the constant by which they differ.

Hint
Differentiate both. Then compare their values at one convenient point.

Solution

For −1<x<1-1 < x < 1 we have ddxarcsin⁡x=11−x2\dfrac{d}{dx}\arcsin x = \dfrac{1}{\sqrt{1-x^2}} and ddxarccos⁡x=−11−x2\dfrac{d}{dx}\arccos x = -\dfrac{1}{\sqrt{1-x^2}} (principal values). So both are integrals, and on the interval (−1,1)(-1, 1) they differ by a constant. At x=0x = 0: arcsin⁡0−(−arccos⁡0)=0+12π\arcsin 0 - (-\arccos 0) = 0 + \tfrac12\pi. So arcsin⁡x=−arccos⁡x+12π\arcsin x = -\arccos x + \tfrac12\pi, the familiar identity arcsin⁡x+arccos⁡x=12π\arcsin x + \arccos x = \tfrac12\pi.

Exercise Different constants on different intervals ●●○ Hardy: §130 (2)

Show that arctan⁡(−1/x)\arctan(-1/x) is an integral of 1/(1+x2)1/(1+x^2) for x≠0x \ne 0. By how much does it differ from arctan⁡x\arctan x on x>0x > 0, and on x<0x < 0?

Hint
Chain rule: the derivative of −1/x-1/x is 1/x21/x^2.
Hint
To find each constant, evaluate both functions at x=1x = 1 and at x=−1x = -1.

Solution

For x≠0x \ne 0,

ddxarctan⁡(−1x)=11+1/x2⋅1x2=1x2+1.\frac{d}{dx}\arctan\left(-\frac1x\right) = \frac{1}{1 + 1/x^2}\cdot\frac{1}{x^2} = \frac{1}{x^2 + 1} .

So on each of the intervals x>0x > 0 and x<0x < 0, arctan⁡x−arctan⁡(−1/x)\arctan x - \arctan(-1/x) is constant. At x=1x = 1 it is 14π−(−14π)=12π\tfrac14\pi - (-\tfrac14\pi) = \tfrac12\pi; at x=−1x = -1 it is −14π−14π=−12π-\tfrac14\pi - \tfrac14\pi = -\tfrac12\pi. The two “constants of integration” differ. The function arctan⁡(−1/x)\arctan(-1/x) even has a jump of size π\pi at 00, where it is undefined, while arctan⁡x\arctan x is smooth across 00.

Exercise Fixing the constant ●○○ Hardy: §131

Find the integral ϕ\phi of ψ(x)=3x2−2sin⁡x\psi(x) = 3x^2 - 2\sin x with ϕ(0)=4\phi(0) = 4.

Hint
Use the standard forms and add CC; then put x=0x = 0.

Solution

The general integral is x3+2cos⁡x+Cx^3 + 2\cos x + C. At x=0x = 0 this is 2+C2 + C, so C=2C = 2 and ϕ(x)=x3+2cos⁡x+2\phi(x) = x^3 + 2\cos x + 2. Check: ϕ′(x)=3x2−2sin⁡x\phi'(x) = 3x^2 - 2\sin x and ϕ(0)=0+2+2=4\phi(0) = 0 + 2 + 2 = 4.

Check yourself

Check yourself True or false?

The function equal to log⁡∣x∣\log|x| for x<0x < 0 and to log⁡∣x∣+5\log|x| + 5 for x>0x > 0 is an integral of 1/x1/x.

Why

True. At every x≠0x \ne 0 it is differentiable with derivative 1/x1/x, which is all the definition asks. It is not of the form log⁡∣x∣+C\log|x| + C, but that does not contradict the uniqueness theorem, which applies on an interval.

Check yourself Choose one

Which of these is not an integral of 2sin⁡xcos⁡x2\sin x\cos x?

Why

The first three differ from each other by constants (−cos⁡2x=sin⁡2x−1-\cos^2 x = \sin^2 x - 1 and −12cos⁡2x=sin⁡2x−12-\tfrac12\cos 2x = \sin^2 x - \tfrac12), and sin⁡2x\sin^2 x has derivative 2sin⁡xcos⁡x2\sin x\cos x. But ddxsin⁡2x=2cos⁡2x\dfrac{d}{dx}\sin 2x = 2\cos 2x. Different-looking answers to an integration problem are often all correct: differentiate to check.

Check yourself Enter a number

ϕ\phi is an integral of 3x23x^2 whose graph passes through (1,5)(1, 5). What is ϕ(2)\phi(2)?

Why

ϕ(x)=x3+C\phi(x) = x^3 + C and 1+C=51 + C = 5, so C=4C = 4 and ϕ(2)=8+4=12\phi(2) = 8 + 4 = 12.

Check yourself Choose one

Which statement about ψ(x)=[x]\psi(x) = [x] (the integral part of xx) is correct?

Why

At an integer nn, [x][x] jumps from n−1n - 1 to nn. A derivative cannot jump (Darboux’s theorem, or the exercise on jumps above), so no ϕ\phi has ϕ′=[x]\phi' = [x] across such a point. Boundedness is not enough; Hardy’s existence theorem needs continuity. (The area under [x][x] still makes sense; it is a continuous function that fails to be differentiable at the integers.)

Hardy’s language

If ψ(x) is the derivative of ϕ(x), then we call ϕ(x) an integral or integral function of ψ(x). The operation of forming ϕ(x) from ψ(x) we call integration.

— G. H. Hardy, §130

Summary

Summary
  • An integral of ψ\psi is a function ϕ\phi with ϕ′=ψ\phi' = \psi. Existence, uniqueness and finding a formula are three separate questions.
  • A function with a jump has no integral; a continuous function always has one (proved in Chapter VII).
  • On an interval, any two integrals differ by a constant: the mean value theorem in disguise. On a union of intervals, each piece has its own constant.
  • The standard forms come from reading derivatives backwards. xmx^m integrates to xm+1/(m+1)x^{m+1}/(m+1) except when m=−1m = -1.
  • ∫dx/x=log⁡∣x∣\int dx/x = \log|x|, where log⁡\log is a new function, not rational and not algebraical, whose existence Hardy assumes for now.