Chapter VI · Derivatives and integrals

The derivative

§§111–113 40 min

The tangent as the limit of chords, the derivative as the limit of a difference quotient, and the ways in which a continuous function can fail to have one.

Why this matters

A continuous curve has no breaks, but it may still have corners, cusps or endless wiggles. The curves of elementary geometry are smoother than that: at each point they have a definite direction. In §§111–113 Hardy turns “direction” into a limit, the derivative, and then shows that it is a genuinely new property: every differentiable function is continuous, but not every continuous function is differentiable. Every later section of the chapter is built on this one definition.

The idea

Fix a point P=(x,ϕ(x))P = (x, \phi(x)) on the graph of ϕ\phi, and a second point Q=(x+h,ϕ(x+h))Q = (x + h, \phi(x + h)) on the same graph. The chord PQPQ rises by ϕ(x+h)−ϕ(x)\phi(x + h) - \phi(x) over a run of hh, so its slope is

q(h)=ϕ(x+h)−ϕ(x)h.q(h) = \frac{\phi(x + h) - \phi(x)}{h}.

The school definition of the tangent at PP is “the limiting position of the chord PQPQ as QQ moves up to PP”. If that limiting line exists and is not vertical, its slope must be the limit of q(h)q(h) as h→0h \to 0. Notice what kind of limit this is. The quotient q(h)q(h) is a function of hh that is not defined at h=0h = 0 (it would read 0/00/0), so we are asking exactly the question of §93: what happens to q(h)q(h) as hh approaches 00, from either side, without reaching it? Note also that hh may be negative, with QQ to the left of PP. The run and the rise then both carry signs, and the slope is still their quotient.

Explore From chords to the tangent

Try this. With ϕ(x)=x2\phi(x) = x^2 at a=1a = 1, press Halve h several times and watch the two chord slopes in the read-out. Then drag the zoom slider up to about ×100\times 100.

f(x)=x2f(x) = x^2, at a=1a = 1
xy
  • y = f(x)
  • chord to a + h
  • chord to a − h
  • tangent
  • the point a (drag)
Slope of the chord to the right: f(a+h)−f(a)h=3\dfrac{f(a+h)-f(a)}{h} = 3
to the left: f(a−h)−f(a)−h=1\dfrac{f(a-h)-f(a)}{-h} = 1
As h→0h \to 0 the chord slopes approach f′(1)=2f'(1) = 2, the slope of the dashed tangent.
What to notice

The slopes approach 22 from both sides, the right-hand chord from above (2+h2 + h) and the left-hand chord from below (2−h2 - h). Under strong zoom the parabola becomes indistinguishable from its tangent line: near a point where a derivative exists, the graph is nearly straight, and ϕ′(a)\phi'(a) is the slope of that straight line.

So for each xx where the limit exists we get a number ϕ′(x)\phi'(x), the slope of the tangent there. Letting xx vary gives a new function, ϕ′\phi'. Hardy calls it the derivative or differential coefficient of ϕ\phi.

Explore Build the derived function by hand

Try this. Drag the purple point slowly along the whole graph of sin⁡x\sin x from left to right. The lower plot records the slope of the tangent at every place you have visited.

ϕ(x)=sin⁡x\phi(x) = \sin x
xφ(x)
xφ′(x)
  • y = φ(x)
  • tangent
  • φ′(x): the slopes you have visited
At x=−6x = -6: ϕ(x)=0.2794\phi(x) = 0.2794, slope of the tangent ϕ′(x)=0.9602\phi'(x) = 0.9602. φ′ > 0: the graph is rising.
What to notice

The trace you paint is the graph of cos⁡x\cos x. It is zero exactly where the tangent is horizontal (the tops and bottoms of the sine wave), largest where the sine curve crosses the axis going up, and negative wherever the curve is falling. Use Reveal to check.

Precise statements

Hardy reached the derivative through geometry, but he stresses (§112, remark 3) that the definition itself mentions no curve at all.

Definition Derivative Hardy: §§111–112

Let ϕ\phi be defined in an interval containing xx in its interior. If the limit

ϕ′(x)=lim⁡h→0ϕ(x+h)−ϕ(x)h\phi'(x) = \lim_{h \to 0} \frac{\phi(x + h) - \phi(x)}{h}

exists (as a finite number), it is called the derivative of ϕ\phi at xx, and ϕ\phi is said to be differentiable at xx. The limit must be the same whether h→0h \to 0 through positive or through negative values.

The two one-sided limits, as h→+0h \to +0 and as h→−0h \to -0, are the slopes of the right and left half-tangents. A derivative exists exactly when both one-sided limits exist and are equal. If both exist but are different, the curve has a corner (Hardy’s Fig. 35).

Two other readings of the same limit are worth keeping in mind. In dynamics, if ϕ(t)\phi(t) is the position of a particle at time tt, then q(h)q(h) is its average velocity over the time from tt to t+ht + h, and ϕ′(t)\phi'(t) is its velocity at the instant tt. In geometry, ϕ′(x)\phi'(x) is the slope tan⁡ψ\tan\psi of the tangent, where ψ\psi is the angle the tangent makes with the xx-axis. The tangent at (x0,y0)(x_0, y_0) is then the line y−y0=ϕ′(x0)(x−x0)y - y_0 = \phi'(x_0)(x - x_0).

Theorem A differentiable function is continuous Hardy: §112 (1)

If ϕ′(x)\phi'(x) exists, then ϕ\phi is continuous at xx.

The converse is false, and §112 and §113 are a catalogue of the ways it fails. The widget below plots the quotient q(h)q(h) itself, as a function of hh, so that you can watch its limit at h=0h = 0 exist or fail to exist.

Explore The difference quotient as a function of hh

Try this. Go through the menu. For each function, drag the zoom slider all the way down (so that hh ranges over a tiny interval around 00) and decide: does q(h)q(h) approach one value from both sides?

ϕ(x)=x2, a=1:q(h)=(1+h)2−1h=2+h\phi(x) = x^2,\ a = 1:\quad q(h) = \frac{(1+h)^2-1}{h} = 2 + h
hq(h)
  • q(h), the chord slope
  • its limit φ′(a)
At h = 0.001: q ≈ 2.001. At h = −0.001: q ≈ 1.999.
Limit from the right: 2. Limit from the left: 2.
Both sides approach 2, so φ′(1) = 2.
What to notice

For x2x^2 and sin⁡x\sin x the graph of qq flattens onto the dashed line: a derivative. For ∣x∣|x| the two sides approach different values (±1\pm 1), a corner. For xsin⁡(1/x)x \sin(1/x) the quotient is sin⁡(1/h)\sin(1/h), which keeps oscillating at every scale. For x2sin⁡(1/x)x^2\sin(1/x) it oscillates too, but inside the band ∣q∣≤∣h∣|q| \le |h|, so it does tend to 00. For x3\sqrt[3]{x} it grows without bound: a vertical tangent.

The three failures in that gallery are different in kind.

  1. A corner: both one-sided limits exist but differ. Example: ∣x∣|x| at 00, with slopes +1+1 and −1-1. The curve has two directions at the point.
  2. No direction at all: the quotient oscillates. Example (§112): ϕ(x)=xsin⁡(1/x)\phi(x) = x \sin(1/x) for x≠0x \ne 0, ϕ(0)=0\phi(0) = 0. This is continuous at 00, since ∣ϕ(x)∣≤∣x∣|\phi(x)| \le |x|, but q(h)=sin⁡(1/h)q(h) = \sin(1/h) has no limit.
  3. A vertical tangent: the quotient tends to +∞+\infty or −∞-\infty. The chord does have a limiting position, but the tangent is perpendicular to the xx-axis and its slope is not a number. Hardy’s Fig. 36 shows four versions, given by y3=xy^3 = x, y3=−xy^3 = -x, y2=xy^2 = x and y2=−xy^2 = -x at the origin. In the last two the curve exists on one side only and splits into two branches y=±±xy = \pm\sqrt{\pm x}, so hh can approach 00 from one side only. That alone rules out a derivative.

Hardy mentions, without proof, that there are even continuous functions that have a derivative at no point at all (Weierstrass found the first, in 1872). So continuity is a much weaker property than differentiability.

Theorem Discontinuities of φ are points without a derivative Hardy: §113

If ϕ\phi is not continuous at xx (in particular, if ϕ\phi is not defined there), then ϕ\phi has no derivative at xx. The converse fails: ϕ\phi can be continuous at xx and still have no derivative there.

This is just the contrapositive of the previous theorem, together with the examples above. For instance 1/x1/x and sin⁡(1/x)\sin(1/x) have no derivative at 00, and [x][x], the integral part of xx, has none at any integer.

Proofs

Proof A differentiable function is continuous
Strategy

Write the change in ϕ\phi as (chord slope) ×\times (run). As h→0h \to 0 the first factor tends to the finite number ϕ′(x)\phi'(x) and the second to 00, so the product tends to 00.

Rewrite the increment

For h≠0h \ne 0, ϕ(x+h)−ϕ(x)=ϕ(x+h)−ϕ(x)h⋅h\displaystyle \phi(x + h) - \phi(x) = \frac{\phi(x + h) - \phi(x)}{h} \cdot h. This identity is the whole trick: it is legitimate because h≠0h \ne 0.

Take limits of the two factors

As h→0h \to 0 the first factor tends to ϕ′(x)\phi'(x) by hypothesis, and the second factor hh tends to 00. By the theorem on the limit of a product (§92), the product tends to ϕ′(x)⋅0=0\phi'(x) \cdot 0 = 0.

Conclude

So ϕ(x+h)→ϕ(x)\phi(x + h) \to \phi(x) as h→0h \to 0, which is exactly continuity at xx. Notice where finiteness was used. If q(h)→+∞q(h) \to +\infty (a vertical tangent), the product “∞⋅0\infty \cdot 0” tells us nothing, and indeed the function need not be continuous then. Try sgn⁡x\operatorname{sgn} x at 00, where q(h)=1/∣h∣→+∞q(h) = 1/|h| \to +\infty.

Proof xsin⁡(1/x)x\sin(1/x) is continuous at 00 but has no derivative there
Strategy

Continuity comes from squeezing ϕ\phi between −∣x∣-|x| and ∣x∣|x|. For the derivative, compute q(h)q(h) exactly: it is sin⁡(1/h)\sin(1/h), and we exhibit two sequences of hh tending to 00 along which it takes different constant values.

Continuity at 00

For x≠0x \ne 0, ∣ϕ(x)−ϕ(0)∣=∣x∣ ∣sin⁡(1/x)∣≤∣x∣|\phi(x) - \phi(0)| = |x|\,|\sin(1/x)| \le |x|. Given ε>0\varepsilon > 0, take δ=ε\delta = \varepsilon: if 0<∣x∣<δ0 < |x| < \delta then ∣ϕ(x)−ϕ(0)∣<ε|\phi(x) - \phi(0)| < \varepsilon.

The quotient

For h≠0h \ne 0, q(h)=hsin⁡(1/h)−0h=sin⁡(1/h)q(h) = \dfrac{h\sin(1/h) - 0}{h} = \sin(1/h).

Two sequences with different limits

Along hn=1/(2nπ+12π)h_n = 1/(2n\pi + \tfrac12\pi) we have q(hn)=1q(h_n) = 1; along hn′=1/(2nπ+32π)h_n' = 1/(2n\pi + \tfrac32\pi) we have q(hn′)=−1q(h_n') = -1. Both sequences tend to 00 through positive values. If q(h)q(h) had a limit ll as h→0h \to 0, then qq along every such sequence would tend to ll, so l=1l = 1 and l=−1l = -1 at once. Hence there is no limit, even from the right alone; by symmetry (qq is odd in hh, since sin⁡\sin is odd, so q(−h)=−q(h)q(-h) = -q(h)) none from the left either.

Worked examples and exercises

Exercise ●○○ Hardy: Examples XXXIX, 1–2

Show from the definition that a constant has derivative 00, and that ax+bax + b has derivative aa. What do these say about the graphs?

Hint
Compute q(h)q(h) and simplify before letting h→0h \to 0.

Solution

For ϕ(x)=c\phi(x) = c, q(h)=(c−c)/h=0q(h) = (c - c)/h = 0 for every h≠0h \ne 0, so the limit is 00. For ϕ(x)=ax+b\phi(x) = ax + b, q(h)={a(x+h)+b−ax−b}/h=aq(h) = \{a(x + h) + b - ax - b\}/h = a for every h≠0h \ne 0, so ϕ′(x)=a\phi'(x) = a. Geometrically: every chord of a straight line is the line itself, so the tangent is the line, and its slope is aa (zero for a horizontal line). Here q(h)q(h) is constant, so no real limiting process is needed.

Exercise ●○○ Hardy: Examples XXXIX, 3

Show that the derivative of xmx^m is mxm−1mx^{m-1} when mm is a positive integer. Then find the derivative of x\sqrt{x} (x>0x > 0) by a special device.

Hint
Expand (x+h)m(x + h)^m by the binomial theorem: only the term in h1h^1 survives in the limit.
Hint
For x\sqrt x, multiply the numerator and the denominator of q(h)q(h) by x+h+x\sqrt{x + h} + \sqrt{x}.

Solution

By the binomial theorem,

(x+h)m−xmh=mxm−1+(m2)xm−2h+⋯+hm−1.\frac{(x + h)^m - x^m}{h} = m x^{m-1} + \binom{m}{2} x^{m-2} h + \dots + h^{m-1}.

This is a polynomial in hh with finitely many terms; every term after the first contains a factor hh and tends to 00. So the limit is mxm−1mx^{m-1}.

For x\sqrt{x} the binomial expansion is no longer a finite sum, which is why Hardy asks for a device. Rationalise:

x+h−xh=(x+h)−xh(x+h+x)=1x+h+x→12x,\frac{\sqrt{x + h} - \sqrt{x}}{h} = \frac{(x + h) - x}{h(\sqrt{x + h} + \sqrt{x})} = \frac{1}{\sqrt{x + h} + \sqrt{x}} \to \frac{1}{2\sqrt{x}},

using the continuity of x\sqrt{\phantom{x}} at x>0x > 0. This agrees with mxm−1mx^{m-1} for m=12m = \tfrac12. The general rational case is proved in §119.

Exercise ●●○ Hardy: Examples XXXIX, 4

Prove that the derivative of sin⁡x\sin x is cos⁡x\cos x, and that of cos⁡x\cos x is −sin⁡x-\sin x.

Hint
Use sin⁡A−sin⁡B=2cos⁡12(A+B)sin⁡12(A−B)\sin A - \sin B = 2\cos\tfrac12(A + B)\sin\tfrac12(A - B).
Hint
You need the limit lim⁡t→0(sin⁡t)/t=1\lim_{t \to 0} (\sin t)/t = 1 (Ex. XXXVI, 13), with t=12ht = \tfrac12 h.

Solution

By the identity in the hint,

sin⁡(x+h)−sin⁡xh=cos⁡ ⁣(x+12h) sin⁡12h12h.\frac{\sin(x + h) - \sin x}{h} = \cos\!\left(x + \tfrac12 h\right)\, \frac{\sin \tfrac12 h}{\tfrac12 h}.

As h→0h \to 0 the first factor tends to cos⁡x\cos x, because cosine is continuous, and the second tends to 11. So the derivative is cos⁡x\cos x. Similarly, cos⁡A−cos⁡B=−2sin⁡12(A+B)sin⁡12(A−B)\cos A - \cos B = -2\sin\tfrac12(A + B)\sin\tfrac12(A - B) gives

cos⁡(x+h)−cos⁡xh=−sin⁡ ⁣(x+12h)sin⁡12h12h→−sin⁡x.\frac{\cos(x + h) - \cos x}{h} = -\sin\!\left(x + \tfrac12 h\right)\frac{\sin\tfrac12 h}{\tfrac12 h} \to -\sin x.
Exercise ●●○ Hardy: Examples XXXIX, 5–6

Write down the tangent and the normal at a point (x0,y0)(x_0, y_0) of the parabola x2=4ayx^2 = 4ay. Show that if x0=2a/mx_0 = 2a/m, y0=a/m2y_0 = a/m^2, the tangent is x=my+a/mx = my + a/m.

Hint
Solve for y=x2/(4a)y = x^2/(4a) and differentiate. The normal is perpendicular to the tangent, so its slope is −1/ϕ′(x0)-1/\phi'(x_0) when ϕ′(x0)≠0\phi'(x_0) \ne 0.

Solution

Here ϕ(x)=x2/(4a)\phi(x) = x^2/(4a) and ϕ′(x)=x/(2a)\phi'(x) = x/(2a). The tangent at (x0,y0)(x_0, y_0) is y−y0=(x0/2a)(x−x0)y - y_0 = (x_0/2a)(x - x_0). When x0≠0x_0 \ne 0 the normal is y−y0=−(2a/x0)(x−x0)y - y_0 = -(2a/x_0)(x - x_0); at the vertex x0=0x_0 = 0 the tangent is y=0y = 0 and the normal is x=0x = 0.

With x0=2a/mx_0 = 2a/m and y0=a/m2y_0 = a/m^2 the slope is x0/(2a)=1/mx_0/(2a) = 1/m, so the tangent is y−a/m2=(1/m)(x−2a/m)y - a/m^2 = (1/m)(x - 2a/m), that is, y=x/m−a/m2y = x/m - a/m^2. Multiplying by mm gives my=x−a/mmy = x - a/m, or x=my+a/mx = my + a/m.

Exercise The derivative of [x][x] ●●○ Hardy: §113

Where does [x][x] have a derivative, and what is it? Find a formula built from sin⁡πx\sin \pi x for a function with exactly the same derivative.

Hint
Between two consecutive integers [x][x] is constant. At an integer it is not continuous.

Solution

If n<x<n+1n < x < n + 1 for an integer nn, then [x+h]=[x]=n[x + h] = [x] = n for all hh small enough (say ∣h∣<min⁡(x−n,n+1−x)|h| < \min(x - n, n + 1 - x)), so q(h)=0q(h) = 0 for those hh and [x]′=0[x]' = 0. At an integer nn, [x][x] is discontinuous (it jumps from n−1n - 1 to nn), so by the theorem of §113 there is no derivative. So [x]′[x]' is 00 at every non-integer and undefined at every integer.

The function 1−sin⁡πxsin⁡πx1 - \dfrac{\sin \pi x}{\sin \pi x} (Hardy’s example) is 00 wherever sin⁡πx≠0\sin \pi x \ne 0 and is undefined at the integers. Its derivative is therefore 00 at every non-integer and undefined at the integers: exactly the same as [x]′[x]'. Two quite different functions can have the same derivative, a point that returns in §127.

Exercise Vertical tangents ●●○ Hardy: §113, Fig. 36

For each of the curves y3=xy^3 = x and y2=xy^2 = x at the origin, describe how q(h)q(h) behaves as h→0h \to 0, and explain why neither gives a derivative at 00.

Hint
For y2=xy^2 = x, treat the upper and lower halves y=xy = \sqrt{x} and y=−xy = -\sqrt{x} as two separate functions, each defined only for x≥0x \ge 0.

Solution

For y3=xy^3 = x, ϕ(x)=x3\phi(x) = \sqrt[3]{x} and q(h)=h1/3/h=h−2/3=1/h23q(h) = h^{1/3}/h = h^{-2/3} = 1/\sqrt[3]{h^2}, which is positive and tends to +∞+\infty as h→0h \to 0 from either side. The tangent is the yy-axis. There is no derivative, because the limit is not a finite number. (The function is continuous at 00, so this is a failure of a new kind, not caused by a discontinuity.)

For y2=xy^2 = x there are two functions, ϕ1(x)=x\phi_1(x) = \sqrt{x} and ϕ2(x)=−x\phi_2(x) = -\sqrt{x}, both defined only for x≥0x \ge 0. Only h>0h > 0 can be considered: ϕ1\phi_1 gives q(h)=h−1/2→+∞q(h) = h^{-1/2} \to +\infty and ϕ2\phi_2 gives q(h)=−h−1/2→−∞q(h) = -h^{-1/2} \to -\infty. No derivative exists, both because the quotient is unbounded and because hh can approach 00 from one side only.

Check yourself

Check yourself True or false?

If ϕ\phi is continuous at xx, then ϕ\phi is differentiable at xx.

Why

False. ∣x∣|x| is continuous at 00 but has a corner there; xsin⁡(1/x)x\sin(1/x) is continuous at 00 and its chord slopes oscillate; x3\sqrt[3]{x} is continuous at 00 and has a vertical tangent. The true implication goes the other way: differentiable implies continuous.

Check yourself Choose one

For ϕ(x)=∣x∣\phi(x) = |x| at x=0x = 0, which statement is correct?

Why

q(h)=∣h∣/hq(h) = |h|/h is 11 for h>0h > 0 and −1-1 for h<0h < 0. A derivative needs a single limit from both sides. A lowest point does not force ϕ′=0\phi' = 0 unless the derivative exists (that is Theorem C of §123). Averaging the two slopes is what the symmetric quotient {ϕ(x+h)−ϕ(x−h)}/2h\{\phi(x + h) - \phi(x - h)\}/2h does, which is why that quotient is not the definition. And ∣x∣|x| is perfectly continuous.

Check yourself Enter a number

Let ϕ(x)=x2sin⁡(1/x)\phi(x) = x^2 \sin(1/x) for x≠0x \ne 0 and ϕ(0)=0\phi(0) = 0. What is ϕ′(0)\phi'(0)?

Why

q(h)=hsin⁡(1/h)q(h) = h\sin(1/h), and ∣q(h)∣≤∣h∣→0|q(h)| \le |h| \to 0. So ϕ′(0)=0\phi'(0) = 0 even though qq oscillates: the oscillations are squeezed. Compare xsin⁡(1/x)x\sin(1/x), where the quotient sin⁡(1/h)\sin(1/h) is not squeezed at all.

Check yourself Choose one

A particle is at position ϕ(t)=t2\phi(t) = t^2 at time tt. Which quantity is its velocity at t=3t = 3?

Why

Velocity at an instant is the limit of average velocities over shorter and shorter intervals; {(3+h)2−9}/h=6+h→6\{(3 + h)^2 - 9\}/h = 6 + h \to 6. The second option is the average velocity over one second, and the first is the average from time 00, assuming the particle started at 00.

Hardy’s language

The geometry of curves is merely one of many departments of mathematics in which the idea of a derivative finds an application.

— G. H. Hardy, §112

Summary

Summary
  • ϕ′(x)=lim⁡h→0{ϕ(x+h)−ϕ(x)}/h\phi'(x) = \lim_{h\to0} \{\phi(x + h) - \phi(x)\}/h: the limit of chord slopes, taken from both sides, which must be a finite number.
  • Geometrically ϕ′(x)\phi'(x) is the slope of the tangent; dynamically it is an instantaneous velocity. Under magnification a differentiable graph looks straight.
  • Differentiable implies continuous; continuous does not imply differentiable.
  • Three ways to fail at a point of continuity: a corner (one-sided limits differ), oscillation (xsin⁡(1/x)x\sin(1/x)), a vertical tangent (q→±∞q \to \pm\infty).
  • ϕ′\phi' is itself a function, defined wherever the limit exists.