Chapter VI · Derivatives and integrals

The rules of differentiation

§114 40 min

Sums, products, quotients, composite and inverse functions, each rule proved from the definition, including the case that most proofs of the chain rule get wrong.

Why this matters

Computing every derivative from the definition would be hopeless. §114 supplies seven rules that build the derivative of a complicated function from the derivatives of its parts. Together with a handful of standard derivatives (§§117–120) they let us differentiate every function met in this book. Each rule is a theorem about limits, and one of them, the rule for a function of a function, hides a trap that Hardy points out: many textbooks of his day, including the first three editions of his own book, proved it wrongly.

The idea

Throughout, ff and FF are functions with derivatives f′(x)f'(x) and F′(x)F'(x) at the point xx in question. Sums are easy: the chord slope of f+Ff + F is the sum of the chord slopes of ff and FF, so the limits add. Products are more interesting. If ff and FF are positive, think of f(x)F(x)f(x)F(x) as the area of a rectangle with sides f(x)f(x) and F(x)F(x).

Explore The product rule as a growing rectangle

Try this. Make hh smaller and smaller with the lower slider, and watch the three numbers in the read-out. Then move xx and repeat.

f(x)=1+x,F(x)=1+12x2f(x) = 1 + x,\quad F(x) = 1 + \tfrac12 x^2: the area of the rectangle is f(x)F(x)f(x)F(x)
  • f(x)F(x)
  • the strips f·δF and F·δf
  • the corner δf·δF
δ(fF)h=2.5⏟f δF/h+1.5⏟F δf/h+0.625⏟δf δF/h=4.625\dfrac{\delta(fF)}{h} = \underbrace{2.5}_{f\,\delta F/h} + \underbrace{1.5}_{F\,\delta f/h} + \underbrace{0.625}_{\delta f\,\delta F/h} = 4.625
As h→0h \to 0: the strips tend to fF′=2f F' = 2 and Ff′=1.5F f' = 1.5, the corner term to 00, so the total tends to f′F+fF′=3.5f'F + fF' = 3.5.
What to notice

The increase of the area is two strips plus a small corner. Divided by hh, each strip tends to a finite limit (fF′fF' and Ff′Ff'), but the corner, δf⋅δF/h\delta f \cdot \delta F / h, tends to 00. The corner is a product of two small increments, and one factor of hh is not enough to rescue it. That is why the product rule has two terms, not three.

The same picture explains why (fF)′≠f′F′(fF)' \ne f'F'. The product f′F′f'F' would correspond to the corner alone, which is exactly the part that disappears.

Precise statements

Hardy numbers the rules (1) to (7). In each, the conclusion includes the claim that the derivative exists, not just a formula for it.

Theorem Sums, constant multiples, reciprocals, quotients Hardy: §114 (1), (2), (4), (5)

At any xx where f′(x)f'(x) and F′(x)F'(x) exist, and kk is a constant:

  • (1) (f+F)′(x)=f′(x)+F′(x)(f + F)'(x) = f'(x) + F'(x);
  • (2) (kf)′(x)=kf′(x)(kf)'(x) = k f'(x);
  • (4) if f(x)≠0f(x) \ne 0, then (1f)′(x)=−f′(x){f(x)}2\left(\dfrac{1}{f}\right)'(x) = -\dfrac{f'(x)}{\{f(x)\}^2};
  • (5) if F(x)≠0F(x) \ne 0, then (fF)′(x)=f′(x)F(x)−f(x)F′(x){F(x)}2\left(\dfrac{f}{F}\right)'(x) = \dfrac{f'(x)F(x) - f(x)F'(x)}{\{F(x)\}^2}.
Theorem Product rule Hardy: §114 (3)

(fF)′(x)=f′(x)F(x)+f(x)F′(x)(fF)'(x) = f'(x)F(x) + f(x)F'(x).

Theorem Chain rule (function of a function) Hardy: §114 (6)

Let ϕ(x)=F{f(x)}\phi(x) = F\{f(x)\}. If ff has a derivative at xx and FF has a derivative at y=f(x)y = f(x), then ϕ\phi has a derivative at xx, and

ϕ′(x)=F′{f(x)} f′(x).\phi'(x) = F'\{f(x)\}\, f'(x).
Theorem Inverse functions Hardy: §114 (7)

Let ψ\psi be continuous and strictly increasing (or strictly decreasing) on an interval, and let ϕ\phi be its inverse, so that y=ϕ(x)y = \phi(x) exactly when x=ψ(y)x = \psi(y). If ψ′(y)\psi'(y) exists and is not zero, then ϕ\phi has a derivative at x=ψ(y)x = \psi(y), and

ϕ′(x)=1ψ′(y).\phi'(x) = \frac{1}{\psi'(y)}.

The condition ψ′(y)≠0\psi'(y) \ne 0 in (7) is essential. For ψ(y)=y3\psi(y) = y^3 we have ψ′(0)=0\psi'(0) = 0, and the inverse ϕ(x)=x3\phi(x) = \sqrt[3]{x} has a vertical tangent at 00 and no derivative there (Fig. 36 (a)). Reflecting the graph in the line y=xy = x turns a horizontal tangent into a vertical one.

Proofs

Every proof follows the same pattern: write the chord slope of the new function in terms of the chord slopes of the old ones, then use the theorems on limits of sums, products and quotients (§92).

Proof The product rule
Strategy

Add and subtract a mixed term, f(x+h)F(x)f(x + h)F(x), so that the change in fFfF splits into a change in FF alone plus a change in ff alone.

Split the increment

f(x+h)F(x+h)−f(x)F(x)=f(x+h){F(x+h)−F(x)}+F(x){f(x+h)−f(x)}f(x + h)F(x + h) - f(x)F(x) = f(x + h)\{F(x + h) - F(x)\} + F(x)\{f(x + h) - f(x)\}. Check by expanding: the mixed terms ±f(x+h)F(x)\pm f(x + h)F(x) cancel.

Divide by h≠0h \ne 0

ϕ(x+h)−ϕ(x)h=f(x+h) F(x+h)−F(x)h+F(x) f(x+h)−f(x)h.\frac{\phi(x + h) - \phi(x)}{h} = f(x + h)\,\frac{F(x + h) - F(x)}{h} + F(x)\,\frac{f(x + h) - f(x)}{h}.

Take limits

As h→0h \to 0: f(x+h)→f(x)f(x + h) \to f(x), because ff is differentiable and therefore continuous (§112). The two quotients tend to F′(x)F'(x) and f′(x)f'(x). So the right side tends to f(x)F′(x)+F(x)f′(x)f(x)F'(x) + F(x)f'(x). Continuity of ff was essential: it is what makes the “corner” of the rectangle disappear.

Proof The reciprocal rule
Strategy

Put the difference 1/f(x+h)−1/f(x)1/f(x + h) - 1/f(x) over a common denominator, which brings out the chord slope of ff.

f(x+h)≠0f(x + h) \ne 0 for small hh

ff is continuous at xx and f(x)≠0f(x) \ne 0, so f(x+h)f(x + h) is close to f(x)f(x), and in particular not zero, when ∣h∣|h| is small enough. So 1/f(x+h)1/f(x + h) is defined for such hh.

Common denominator

1h{1f(x+h)−1f(x)}=−f(x+h)−f(x)h⋅1f(x+h) f(x).\frac{1}{h}\left\{\frac{1}{f(x + h)} - \frac{1}{f(x)}\right\} = -\frac{f(x + h) - f(x)}{h} \cdot \frac{1}{f(x + h)\, f(x)}.

Take limits

The first factor tends to f′(x)f'(x) and the second to 1/{f(x)}21/\{f(x)\}^2, again by continuity of ff. The quotient rule (5) follows by applying the product rule to f⋅(1/F)f \cdot (1/F).

Now the chain rule. The natural argument is short. Put y=f(x)y = f(x) and k=f(x+h)−f(x)k = f(x + h) - f(x), so that k→0k \to 0 as h→0h \to 0, and write

ϕ(x+h)−ϕ(x)h=F(y+k)−F(y)k⋅kh.\frac{\phi(x + h) - \phi(x)}{h} = \frac{F(y + k) - F(y)}{k} \cdot \frac{k}{h}.

The first factor tends to F′(y)F'(y) and the second to f′(x)f'(x). The flaw is that we have divided by kk, and kk may be zero for values of hh as small as we please, even though h≠0h \ne 0. It happens whenever ff takes the value f(x)f(x) again, arbitrarily close to xx.

Explore When the increment kk keeps vanishing

Try this. This is f(x)=x2sin⁡(1/x)f(x) = x^2 \sin(1/x), with f(0)=0f(0) = 0, close to x=0x = 0. Move the trace point and find values of hh near 00 at which k=f(0+h)−f(0)=f(h)k = f(0 + h) - f(0) = f(h) is exactly zero.

y=x2sin⁡1xy = x^2\sin\frac1xHardy: Examples XLIV, 16
xy
  • x² sin(1/x)
  • trace point (drag)
At x=0.048x = 0.048: y=0.0021103y = 0.0021103

Differentiable at 0 with f'(0) = 0, but f' is not continuous there.

What to notice

The curve crosses the axis at h=1/(nπ)h = 1/(n\pi) for every integer nn, infinitely often in every interval around 00. At each of these hh the factor {F(y+k)−F(y)}/k\{F(y + k) - F(y)\}/k is 0/00/0, so the short proof breaks down. Note that f′(0)=0f'(0) = 0 here (as in the previous lesson), which is why Hardy’s case (b) is the delicate one.

Hardy repairs the argument by splitting into two cases, according to whether f′(x)f'(x) is zero.

Proof The chain rule, carefully
Strategy

If f′(x)≠0f'(x) \ne 0, then k≠0k \ne 0 for all small h≠0h \ne 0, and the short proof is valid. If f′(x)=0f'(x) = 0, the answer should be 00. For hh with k=0k = 0 the chord slope of ϕ\phi is exactly 00; for hh with k≠0k \ne 0 it is a bounded factor times the small factor k/hk/h.

k→0k \to 0 as h→0h \to 0

ff is differentiable at xx, hence continuous there, so k=f(x+h)−f(x)→0k = f(x + h) - f(x) \to 0.

Case (a): f′(x)≠0f'(x) \ne 0

Since k/h→f′(x)≠0k/h \to f'(x) \ne 0, we have k/h≠0k/h \ne 0, and so k≠0k \ne 0, for all h≠0h \ne 0 with ∣h∣|h| small enough. For those hh the factorisation above is legitimate. As h→0h \to 0, k→0k \to 0 through non-zero values, so {F(y+k)−F(y)}/k→F′(y)\{F(y + k) - F(y)\}/k \to F'(y), and the product tends to F′(y)f′(x)F'(y) f'(x).

Case (b): f′(x)=0f'(x) = 0, and hh with k=0k = 0

Then ϕ(x+h)=F(y+0)=ϕ(x)\phi(x + h) = F(y + 0) = \phi(x), so the chord slope of ϕ\phi is exactly 00.

Case (b): f′(x)=0f'(x) = 0, and hh with k≠0k \ne 0

Here the factorisation is valid. Because {F(y+k)−F(y)}/k→F′(y)\{F(y + k) - F(y)\}/k \to F'(y) as k→0k \to 0, there is an η>0\eta > 0 such that this quotient has absolute value less than M=∣F′(y)∣+1M = |F'(y)| + 1 whenever 0<∣k∣<η0 < |k| < \eta. Given ε>0\varepsilon > 0, choose δ>0\delta > 0 so small that ∣h∣<δ|h| < \delta implies both ∣k∣<η|k| < \eta and ∣k/h∣<ε/M|k/h| < \varepsilon/M (possible because k→0k \to 0 and k/h→0k/h \to 0). Then the chord slope of ϕ\phi has absolute value less than M⋅ε/M=εM \cdot \varepsilon / M = \varepsilon.

Conclude

In case (b), for 0<∣h∣<δ0 < |h| < \delta the chord slope of ϕ\phi is less than ε\varepsilon in absolute value, whether k=0k = 0 or not. So ϕ′(x)=0=F′(y)f′(x)\phi'(x) = 0 = F'(y) f'(x). Together with case (a), the chain rule holds in every case.

Proof The inverse-function rule
Strategy

Run the chord backwards. A chord of the graph of ϕ\phi is also a chord of the graph of ψ\psi, with run and rise exchanged, so the slopes are reciprocal. Here, unlike the chain rule, the increment kk can never vanish.

Set up the increments

Let x=ψ(y)x = \psi(y), and for h≠0h \ne 0 put ϕ(x+h)=y+k\phi(x + h) = y + k, so that x+h=ψ(y+k)x + h = \psi(y + k). Since ϕ\phi is one-to-one, h≠0h \ne 0 forces k≠0k \ne 0. Since ϕ\phi is continuous (the inverse of a continuous strictly monotonic function is continuous, §110), k→0k \to 0 as h→0h \to 0.

Exchange run and rise

ϕ(x+h)−ϕ(x)h=kψ(y+k)−ψ(y)=1/ψ(y+k)−ψ(y)k.\frac{\phi(x + h) - \phi(x)}{h} = \frac{k}{\psi(y + k) - \psi(y)} = 1 \Big/ \frac{\psi(y + k) - \psi(y)}{k}.

Take limits

As h→0h \to 0, k→0k \to 0 through non-zero values, so the denominator tends to ψ′(y)\psi'(y). Since ψ′(y)≠0\psi'(y) \ne 0, the reciprocal tends to 1/ψ′(y)1/\psi'(y).

Now put the rules to work. Each item below is checked against a derivative computed directly from chord slopes, so the widget does not need to know the answer in symbolic form to tell you whether yours is right.

Explore Rule-by-rule drill

Try this. For each function, decide which rule applies, work out the derivative on paper, then click the matching formula. Try the wrong ones too, and read why each is wrong.

1 of 6: differentiate ϕ(x)=x2sin⁡x\phi(x) = x^2\sin x
xy
  • φ′(x) from chord slopes
Hint: use the product rule. The dashed curve is the true derivative, found numerically; pick the formula you think matches it.
Right first time: 0 of 0 tried.
What to notice

A correct formula lies exactly on the dashed curve. The typical wrong answers come from three misconceptions: differentiating a product or quotient factor by factor, forgetting the inner derivative in the chain rule, and evaluating the outer derivative at the wrong place.

Worked examples and exercises

Exercise ●○○ Hardy: §114 (1), (2); Examples XXXV, 1

Prove rules (1) and (2) from the theorems on limits of sums and products.

Hint
Write the chord slope of f+Ff + F as the sum of the chord slopes of ff and FF.

Solution

For h≠0h \ne 0,

(f+F)(x+h)−(f+F)(x)h=f(x+h)−f(x)h+F(x+h)−F(x)h→f′(x)+F′(x),\frac{(f + F)(x + h) - (f + F)(x)}{h} = \frac{f(x + h) - f(x)}{h} + \frac{F(x + h) - F(x)}{h} \to f'(x) + F'(x),

because the limit of a sum is the sum of the limits. Similarly the chord slope of kfkf is kk times the chord slope of ff, which tends to kf′(x)kf'(x).

Exercise ●○○ Hardy: Examples XL, 1

Show that if y=y1y2y3y = y_1 y_2 y_3 then y′=y1′y2y3+y1y2′y3+y1y2y3′y' = y_1' y_2 y_3 + y_1 y_2' y_3 + y_1 y_2 y_3', and state the result for nn factors. Deduce that (zn)′=nzn−1z′(z^n)' = n z^{n-1} z', and in particular (xn)′=nxn−1(x^n)' = n x^{n-1}.

Hint
Apply the product rule to (y1y2)⋅y3(y_1 y_2) \cdot y_3, then use induction on nn.

Solution

(y1y2y3)′=(y1y2)′y3+y1y2y3′=y1′y2y3+y1y2′y3+y1y2y3′(y_1 y_2 y_3)' = (y_1 y_2)' y_3 + y_1 y_2 y_3' = y_1'y_2y_3 + y_1y_2'y_3 + y_1y_2y_3'. In general, (y1⋯yn)′(y_1 \cdots y_n)' is the sum of nn terms, the rr-th of which is the product with only the factor yry_r differentiated. The induction step is the product rule applied to (y1⋯yn−1)⋅yn(y_1 \cdots y_{n-1}) \cdot y_n. When all factors equal zz, each of the nn terms is zn−1z′z^{n-1} z', so (zn)′=nzn−1z′(z^n)' = n z^{n-1} z'; with z=xz = x, z′=1z' = 1 and (xn)′=nxn−1(x^n)' = nx^{n-1}, as in Examples XXXIX, 3.

Exercise ●●○ Hardy: Examples XL, 2

If y=y1y2⋯yny = y_1 y_2 \cdots y_n and no yry_r vanishes, show that y′y=y1′y1+y2′y2+⋯+yn′yn.\dfrac{y'}{y} = \dfrac{y_1'}{y_1} + \dfrac{y_2'}{y_2} + \dots + \dfrac{y_n'}{y_n}. Use it to differentiate x(x−1)(x−2)x(x - 1)(x - 2) quickly.

Hint
Divide the formula of the previous exercise by yy.

Solution

Dividing the rr-th term y1⋯yr′⋯yny_1 \cdots y_r' \cdots y_n by y=y1⋯yny = y_1 \cdots y_n leaves yr′/yry_r'/y_r. Summing gives the formula. For y=x(x−1)(x−2)y = x(x - 1)(x - 2) (where no factor vanishes): y′/y=1/x+1/(x−1)+1/(x−2)y'/y = 1/x + 1/(x - 1) + 1/(x - 2), so y′=(x−1)(x−2)+x(x−2)+x(x−1)=3x2−6x+2y' = (x - 1)(x - 2) + x(x - 2) + x(x - 1) = 3x^2 - 6x + 2. The result is a polynomial identity, so it holds at the excluded points as well. (The quantity y′/yy'/y is called the logarithmic derivative; the name will make sense in Chapter IX.)

Exercise Roots from the inverse-function rule ●●○ Hardy: §114 (7)

Use rule (7) to find the derivative of x\sqrt{x} for x>0x > 0 and of x3\sqrt[3]{x} for x≠0x \ne 0. What does (7) say at x=0x = 0?

Hint
y=xy = \sqrt{x} is the inverse of x=ψ(y)=y2x = \psi(y) = y^2 on y≥0y \ge 0, and x3\sqrt[3]{x} is the inverse of y3y^3.

Solution

For y>0y > 0, ψ(y)=y2\psi(y) = y^2 is continuous and strictly increasing with ψ′(y)=2y≠0\psi'(y) = 2y \ne 0. So (x)′=1/(2y)=1/(2x)(\sqrt{x})' = 1/(2y) = 1/(2\sqrt{x}). Similarly ψ(y)=y3\psi(y) = y^3 is strictly increasing on the whole line, with ψ′(y)=3y2\psi'(y) = 3y^2, which is non-zero for y≠0y \ne 0. So (x3)′=1/(3y2)=13x−2/3(\sqrt[3]{x})' = 1/(3y^2) = \tfrac13 x^{-2/3} for x≠0x \ne 0.

At x=0x = 0 we have y=0y = 0 and ψ′(0)=0\psi'(0) = 0, so (7) does not apply, and it could not: x3\sqrt[3]{x} has a vertical tangent at 00 and no derivative there. For x\sqrt x at 00, ψ\psi is defined only for y≥0y \ge 0, and again ψ′(0)=0\psi'(0) = 0.

Exercise ●○○ Hardy: Examples XLIV, 10

Show that the derivative of F[f{ϕ(x)}]F[f\{\phi(x)\}] is F′[f{ϕ(x)}] f′{ϕ(x)} ϕ′(x)F'[f\{\phi(x)\}]\, f'\{\phi(x)\}\, \phi'(x), and use it to differentiate sin⁡{(1+x2)3}\sin\{(1 + x^2)^3\}.

Hint
Apply the chain rule twice: first with inner function f{ϕ(x)}f\{\phi(x)\}, then to that inner function itself.

Solution

Let g(x)=f{ϕ(x)}g(x) = f\{\phi(x)\}. By the chain rule, (F∘g)′(x)=F′{g(x)}g′(x)(F \circ g)'(x) = F'\{g(x)\} g'(x), and again by the chain rule g′(x)=f′{ϕ(x)}ϕ′(x)g'(x) = f'\{\phi(x)\}\phi'(x). Substituting gives the formula. For sin⁡{(1+x2)3}\sin\{(1 + x^2)^3\}, take F=sin⁡F = \sin, f(u)=u3f(u) = u^3, ϕ(x)=1+x2\phi(x) = 1 + x^2: the derivative is cos⁡{(1+x2)3}⋅3(1+x2)2⋅2x=6x(1+x2)2cos⁡{(1+x2)3}\cos\{(1 + x^2)^3\} \cdot 3(1 + x^2)^2 \cdot 2x = 6x(1 + x^2)^2 \cos\{(1 + x^2)^3\}.

Check yourself

Check yourself True or false?

If neither ff nor FF has a derivative at xx, then f+Ff + F has no derivative at xx.

Why

False. Take f(x)=∣x∣f(x) = |x| and F(x)=−∣x∣F(x) = -|x|: neither is differentiable at 00, but f+F=0f + F = 0 is. The rules say “if the parts are differentiable, so is the combination”; they say nothing in the other direction.

Check yourself Choose one

What exactly is wrong with the short proof of the chain rule that writes the chord slope of F{f(x)}F\{f(x)\} as F(y+k)−F(y)k⋅kh\dfrac{F(y + k) - F(y)}{k} \cdot \dfrac{k}{h}?

Why

k→0k \to 0 by continuity of ff, and k/h→f′(x)k/h \to f'(x) by hypothesis, so the first and third options are wrong. The formula ϕ′(x)=F′(y)f′(x)\phi'(x) = F'(y)f'(x) is correct in every case, including f′(x)=0f'(x) = 0. The flaw is only in the proof: dividing by kk is illegitimate when k=0k = 0, which happens infinitely often near 00 for f(x)=x2sin⁡(1/x)f(x) = x^2\sin(1/x).

Check yourself Enter a number

ψ(y)=y3+y\psi(y) = y^3 + y is strictly increasing. Let ϕ\phi be its inverse. What is ϕ′(2)\phi'(2)? (Note that ψ(1)=2\psi(1) = 2.)

Why

ϕ(2)=1\phi(2) = 1, and ψ′(y)=3y2+1\psi'(y) = 3y^2 + 1, so ψ′(1)=4≠0\psi'(1) = 4 \ne 0. By rule (7), ϕ′(2)=1/ψ′(1)=1/4\phi'(2) = 1/\psi'(1) = 1/4. There is no need to find a formula for ϕ\phi.

Check yourself Choose one

Which is the derivative of fF\dfrac{f}{F}?

Why

Check with f=xf = x, F=1F = 1: the quotient is xx, with derivative 11. The correct formula gives (1⋅1−x⋅0)/1=1(1 \cdot 1 - x \cdot 0)/1 = 1; the second option gives −1-1. Checking a general rule against a simple special case is a good habit.

Hardy’s language

The proof of this theorem requires a little care.

— G. H. Hardy, §114

Summary

Summary
  • (f+F)′=f′+F′(f + F)' = f' + F', (kf)′=kf′(kf)' = kf', (fF)′=f′F+fF′(fF)' = f'F + fF', (1/f)′=−f′/f2(1/f)' = -f'/f^2, (f/F)′=(f′F−fF′)/F2(f/F)' = (f'F - fF')/F^2.
  • Chain rule: {F(f(x))}′=F′(f(x)) f′(x)\{F(f(x))\}' = F'(f(x))\, f'(x). Its proof must allow for f(x+h)=f(x)f(x + h) = f(x) at points hh arbitrarily close to 00.
  • Inverse functions: ϕ′(x)=1/ψ′(y)\phi'(x) = 1/\psi'(y), valid only where ψ′(y)≠0\psi'(y) \ne 0; where ψ′=0\psi' = 0 the inverse has a vertical tangent.
  • Each rule asserts that the derivative exists, and each proof rewrites a chord slope in terms of known chord slopes and uses continuity.