Analysis

A slope can swing but never jump

A function can have a slope at every point without that slope changing continuously: x² sin(1/x) has slope nought at the origin and a slope that swings between −1 and 1 however close to the origin it is taken. What a slope cannot do is jump. Darboux proved in 1875 that a derivative takes every value between any two of its values, so a step is never a derivative — and the only way a slope can be discontinuous is by oscillating.

Worth reading first: The slope of a single point · A curve with a corner at every point.

Every derivative met in a first course is continuous. The slope of a polynomial is a polynomial, the slope of the sine is the cosine, the exponential is its own slope, and the slope of a mirror image is a reciprocal of something continuous. It is easy to come away believing that a function with a slope at every point has a slope that changes smoothly from point to point.

It need not. The function

f(x)=x2sin⁡(1/x),f(0)=0,f(x) = x^2 \sin(1/x), \qquad f(0) = 0,

has a slope at every point, including the origin, and its slope is not continuous at the origin. What makes it worth a whole essay is what its slope does instead of being continuous — and what, according to a theorem Gaston Darboux proved in 1875, no slope anywhere can ever do.

The slope of x² sin(1/x): discontinuous at nought, and never jumping. The derivative of x^2 sin(1/x) on [−0.12, 0.12], with the value at nought marked and the level 0.5 crossed 77 times.
Fig. 1 The slope of x2sin⁡(1/x)x^2 \sin(1/x) near the origin: 2x sin(1/x) − cos(1/x) away from it, and nought at it, where the secants put it. It has no limit at the origin, swinging between about −1 and 1 on every interval round it, and it crosses the dashed level 0.5 again and again without end.

The picture is the derivative, plotted. Away from the origin it is 2xsin⁡(1/x)−cos⁡(1/x)2x\sin(1/x) - \cos(1/x); as xx approaches nought the first term dies and the second keeps swinging between −1-1 and 11 faster and faster, so the slope has no limit there. At the origin itself the slope is nought, a single dot in the middle of the blur. The slope is discontinuous at the origin, and it never jumps: it reaches every level between −1-1 and 11 — the dashed line at 0.50.5 is crossed over and over — on every interval round the origin, however short.

Three powers of one wiggle

The family xpsin⁡(1/x)x^p \sin(1/x) separates the ways a slope can fail, one power at a time, and the secants from the origin are what separate them.

The secant from the origin to the point at hh has slope f(h)/hf(h)/h, which for xpsin⁡(1/x)x^p\sin(1/x) is hp−1sin⁡(1/h)h^{p-1}\sin(1/h). For p=1p = 1 that is just sin⁡(1/h)\sin(1/h).

x sin(1/x) and its secants from the origin. The graph of x^1 sin(1/x) on [−0.4, 0.4] with its envelope and secants from the origin of slopes -0.191, -0.959, 0.887, 0.989, -0.132.
Fig. 2 x sin(1/x) near nought, between the lines y=±xy = \pm x, with secants from the origin to the points at h = 0.3, 0.2, 0.12, 0.07 and 0.04. Their slopes are sin(1/h) — −0.19, −0.96, 0.89, 0.99, −0.13 — and however short a secant is taken, slopes of exactly 1 and exactly −1 both occur.

Nothing squeezes those slopes. At h=1/(π/2+2πk)h = 1/(\pi/2 + 2\pi k) the secant slope is exactly 11, at h=1/(3π/2+2πk)h = 1/(3\pi/2 + 2\pi k) it is exactly −1-1, and both families of points crowd into the origin as kk grows. So the secants from the origin have no limiting slope, and xsin⁡(1/x)x\sin(1/x) has no derivative there. It is continuous at the origin — squeezed between y=xy = x and y=−xy = -x — and it has no tangent, which is the corner in a far more restless form: not two slopes, one from each side, but every slope between −1-1 and 11 from both sides at once.

One more power changes the verdict.

x² sin(1/x) and its secants from the origin. The graph of x^2 sin(1/x) on [−0.4, 0.4] with its envelope and secants from the origin of slopes -0.057, -0.192, 0.106, 0.069, -0.005.
Fig. 3 x2sin⁡(1/x)x^2 \sin(1/x) near nought, between the parabolas y=±x2y = \pm x^2, with secants from the origin to the same five points. Their slopes are hsin⁡(1/h)h \sin(1/h) — −0.057, −0.192, 0.106, 0.069, −0.005 — squeezed between ±h\pm h, so they close on nought and the function has slope nought at the origin although it never settles on one side of the axis.

For p=2p = 2 the secant slope is hsin⁡(1/h)h\sin(1/h), and whatever the sine does, the factor hh drives the product to nought. The function has a derivative at the origin and it is 00. The curve still crosses the axis infinitely often in every neighbourhood of the origin — it is trapped between two parabolas that touch there, and the parabolas’ common tangent is the axis, so the curve is forced onto it.

Having a derivative at a point is a statement about secants from that point, and nothing else. It says nothing about the slopes at neighbouring points, which for p=2p = 2 are exactly the swinging values in the first figure. The function is differentiable everywhere, and its derivative is discontinuous at one point.

The theorem: a slope takes every value in between

The swinging looks like lawless behaviour, and the surprise is how much law it obeys.

Darboux’s theorem. If ff has a derivative at every point of an interval, and cc lies strictly between f′(a)f'(a) and f′(b)f'(b), then f′(x)=cf'(x) = c at some xx between aa and bb.

That is the intermediate value property, which continuous functions are famous for having, now claimed for derivatives whether or not they are continuous. It says a derivative can never skip a value: if it is below cc somewhere and above cc somewhere else, it is equal to cc somewhere between. And its proof uses nothing about f′f' except that it exists.

Darboux's argument: subtract a line, and the lowest point has the slope that was subtracted. A curve with slope 0.60 at 0.4 and 1.16 at 2.8; subtracting the line of slope 0.9 leaves a curve with an interior minimum at 1.559, where the original slope is 0.9.
Fig. 4 A curve whose slope is 0.60 at x = 0.4 and 1.16 at x = 2.8, above the same curve with the line 0.9x subtracted. The lower curve begins downhill and ends uphill, so its lowest point on the interval lies strictly inside it, at x = 1.559; there its slope is nought, and so the upper curve’s slope is exactly 0.9 — the tangent drawn.

The argument is the figure. Subtract the line cxcx from ff to get g(x)=f(x)−cxg(x) = f(x) - cx, whose slope is f′(x)−cf'(x) - c. At the left end that slope is negative, so gg starts by going down; at the right end it is positive, so gg ends by going up. A function that is differentiable is continuous, so gg has a lowest point on the closed interval — and it cannot be either end, since just inside each end gg is lower than at the end. So the lowest point is inside, and at an interior lowest point the slope is nought: a secant to the right cannot slope down and a secant to the left cannot slope up, so their common limit can only be nought. There f′(x)−c=0f'(x) - c = 0.

Nowhere in that argument is the slope assumed continuous. The steps are: gg is continuous because it is differentiable, a continuous function on a closed interval has a lowest point, and a lowest point inside an interval has slope nought. The intermediate value property of the slope is extracted from the existence of a minimum of the function — a property of ff, not of f′f'.

A second proof, made of secants

There is another proof, and it deserves telling here because it is built entirely out of secants — the objects the derivative was defined from.

Take every pair of points x<yx < y in [a,b][a, b] and the slope of the secant joining them, (f(y)−f(x))/(y−x)(f(y) - f(x))/(y - x). As the pair varies continuously that slope varies continuously, because ff is continuous and the denominator stays away from nought while x<yx < y. The pairs form a triangle, which is connected, so the secant slopes form an interval: every value between two secant slopes is itself a secant slope.

Now bring in the two ends. Secants from aa to points just to its right have slopes close to f′(a)f'(a), and secants from points just left of bb to bb have slopes close to f′(b)f'(b). So any value cc strictly between f′(a)f'(a) and f′(b)f'(b) lies between two secant slopes, and is therefore the slope of some secant. Finally, the mean value theorem says every secant’s slope is the slope of a tangent somewhere between its ends. So cc is a value of f′f'.

The two proofs share their essential step. Both use the continuity of ff — once to get a lowest point, once to make the secant slopes move without jumping — and neither uses anything about f′f' beyond its existence. The secants move continuously, and the tangents are their limits and their representatives, so the tangents inherit the secants’ refusal to skip a value.

What a slope cannot do

The theorem rules out whole families of functions at a stroke, and the most useful to rule out is the simplest discontinuous function there is.

A step, equal to −1-1 for negative xx and +1+1 for positive, is not the derivative of anything. It takes the values −1-1 and 11 and never 00, so Darboux’s theorem forbids it — whatever is put at the origin itself. The obvious candidate to have it as a slope is ∣x∣|x|, and ∣x∣|x| shows why the candidate fails.

A point with two slopes. Secants to |x| at zero, taken from each side. Every one from the right has slope 1 and every one from the left has slope −1, at every distance, so the quotients never settle.
Fig. 5 Secants to |x| from the origin, taken from each side. Every secant from the right has slope 1 and every secant from the left has slope −1, at every distance, so the function that should have had the step as its slope has no slope at the origin at all.

The secants from the right all have slope 11 and those from the left all have slope −1-1, and no single number is their limit. The step is the slope of ∣x∣|x| everywhere except the one point where it would need to jump, and at that point ∣x∣|x| has no slope. That is not an accident of this example: Darboux’s theorem says any function with the step as its slope on both sides of the origin must fail to have a slope at the origin itself.

The second thing a slope cannot do is subtler, and it follows from the mean value theorem rather than from Darboux’s. Suppose the slope approaches a limit LL as xx approaches a point cc from either side. For each nearby xx the secant from cc to xx has the slope of the tangent at some point between them, and those tangent slopes approach LL; so the secant slopes approach LL too, and f′(c)=Lf'(c) = L. A slope that has a limit at a point equals it there. A derivative cannot have a removable gap any more than it can have a step.

Put the two together and the discontinuities left to a derivative are exactly the kind the first figure shows: points where the slope has no limit at all because it keeps swinging. That is a strong restriction, and it came from an argument about a lowest point.

A smoother wiggle, and where continuity returns

One more power of xx and the slope becomes continuous.

The slope of x³ sin(1/x): continuous at nought. The derivative of x^3 sin(1/x) on [−0.12, 0.12], with the value at nought marked.
Fig. 6 The slope of x3sin⁡(1/x)x^3 \sin(1/x) near the origin: 3x2sin⁡(1/x)−xcos⁡(1/x)3x^2 \sin(1/x) - x \cos(1/x). The extra power of x squeezes the swinging, the slope tends to nought, and it is continuous at the origin.

The slope of x3sin⁡(1/x)x^3\sin(1/x) is 3x2sin⁡(1/x)−xcos⁡(1/x)3x^2\sin(1/x) - x\cos(1/x), and now both terms carry a power of xx in front, so both are squeezed to nought. The slope still oscillates infinitely often near the origin, and the oscillation is damped. Smoothness is bought one power at a time: xsin⁡(1/x)x\sin(1/x) is continuous with no slope at the origin, x2sin⁡(1/x)x^2\sin(1/x) has a slope that is not continuous, x3sin⁡(1/x)x^3\sin(1/x) has a continuous slope with no second derivative at the origin, x4sin⁡(1/x)x^4\sin(1/x) has a second derivative that is not continuous, and so on — each further power buys the next step, alternately the existence of one more derivative and then its continuity. Each step up in smoothness costs one more power of xx.

The same trade appeared in the curve with a corner at every point, where Weierstrass’s sum of cosines is continuous everywhere and has no slope anywhere. There the wiggles are added at every scale at once and nothing ever squeezes them; here there is one wiggle, concentrated at one point, and a power of xx decides how much of it survives.

How thin the bad set must be

A derivative can be discontinuous at one point. Can it be discontinuous everywhere?

No, and the reason is a theorem from a different part of the subject. The slope is a limit of secant slopes,

f′(x)=lim⁡n→∞f(x+1/n)−f(x)1/n,f'(x) = \lim_{n \to \infty} \frac{f(x + 1/n) - f(x)}{1/n},

and for each nn the quotient on the right is a continuous function of xx, since ff is. So every derivative is a pointwise limit of continuous functions. A limit that jumps at every fraction showed what such limits can and cannot do: René Baire proved that a pointwise limit of continuous functions is continuous at a dense set of points, so it cannot be discontinuous everywhere, and its points of discontinuity form a set that is thin in the sense of being a countable union of nowhere-dense pieces.

That thinness is about arrangement, not size, and the difference is where the real surprise lies. A nowhere-dense set can have positive length — a set with no interval in it and length to spare is one — and Vito Volterra built, in 1881, a function differentiable everywhere whose slope is bounded and discontinuous at every point of such a set. That slope is not integrable in Riemann’s sense, because the points where a function jumps must have no length for Riemann’s sums to close. So Volterra’s function has a slope and the slope has no Riemann integral: the fundamental theorem of calculus, read backwards, fails for it. Darboux’s theorem constrains how a slope can be discontinuous, Baire’s constrains where, and neither prevents the discontinuities from having positive length, which is one of the facts that pushed the subject towards Lebesgue’s integral, under which the fundamental theorem holds for every bounded slope.

A function that takes every value on every interval

The intermediate value property sounds as though it nearly forces continuity. It does not, and the extreme example shows how far apart the two are.

John Conway described a function, usually called the base-13 function, that takes every real value on every interval, however short. Write a number in base thirteen, using the ten digits and three extra symbols read as a plus sign, a minus sign and a decimal point. If from some position onward the expansion spells out a signed decimal number — a sign, some digits, a point and then only digits — the function’s value is that number; otherwise it is nought. Every interval contains numbers whose expansions end in any pattern at all, so on every interval the function takes every value.

It has the intermediate value property as strongly as a function can: between any two points it takes not only every value between its values there but every value there is. And it is discontinuous at every single point. So it is not the slope of anything — not by Darboux’s theorem, which it satisfies, but by Baire’s, which says a slope must be continuous somewhere. The two constraints on derivatives are independent, and a function can pass the first with nothing to spare and fail the second everywhere.

Why continuity was the wrong property to expect

The intermediate value property is usually taught as a consequence of continuity, and that ordering is what makes Darboux’s theorem feel strange. A function with the property need not be continuous — the slope of x2sin⁡(1/x)x^2\sin(1/x) has it and is not — so the property is strictly weaker, and derivatives are a natural class that has the weaker property without the stronger one.

It is worth asking why the weaker property is the one that survives differentiation. The answer is in the proof: a slope inherits the intermediate value property from the function’s continuity, through the existence of a lowest point. The function is continuous and the slope is whatever it is, and Darboux’s argument transfers exactly one property across. Continuity of the slope would need information about how the function curves between points, which the existence of a slope at each point does not supply.

This is also the answer to a practical question. Newton’s method, bisection and every other search for a point where a slope equals a given value need that value to be taken somewhere, and continuity of the slope is usually assumed to guarantee it. It is never needed. If the slope exists everywhere on an interval and takes values on both sides of the target, the target is taken — by Darboux, with no continuity assumption at all.

The dense core the pictures cannot resolve

The swinging is drawn only as finely as a screen allows. Near the origin the slope of x2sin⁡(1/x)x^2\sin(1/x) swings infinitely often, and a plot at any resolution shows a solid block where the swings are closer together than a pixel. The figure counts crossings of the level 0.50.5 on a grid fine in 1/x1/x, reaching down to about 0.0040.004, and reports those; the claim that the crossings continue without end is the theorem’s, not the plot’s.

The squeezing is shown at five secants. Five secant slopes shrinking towards nought is evidence for p=2p = 2 and not a proof; the proof is the inequality ∣hsin⁡(1/h)∣≤∣h∣|h\sin(1/h)| \le |h|, which the figure checks at each secant and which does the whole job.

One curve illustrates Darboux’s argument, and it happens to have a slope that is continuous — the figure shows the mechanism, a lowest point inside an interval, and could not show that the mechanism works for a discontinuous slope, since a discontinuous slope drawn on a page looks like the solid block above. Volterra’s function is described and not drawn: its discontinuities sit on a set with no interval in it, and no picture at a fixed resolution can show a set like that as anything but empty or full.

Still open: which functions are slopes

Darboux’s theorem gives a condition every derivative must satisfy, and Baire’s gives another, and neither is enough. There are functions with the intermediate value property that are limits of continuous functions and are nevertheless the slope of nothing: the property is necessary and far from sufficient.

Which functions are derivatives? William Henry Young asked for a characterisation in 1911, meaning a description in terms of the function’s own values — the way continuous or has the intermediate value property is a description — rather than the circular is the slope of something. Many partial answers are known, and many classes of functions have been shown to consist entirely of derivatives or to contain none. A characterisation of the kind Young asked for is still not known, and Andrew Bruckner and John Leonard’s survey of derivatives in 1966, which set out the question in its modern form, is still cited for it as an open problem.

A slope is constrained by the function, not by itself

The habit worth keeping is the one Darboux’s proof uses.

A derivative is a limit, and limits can behave badly: the slope of x2sin⁡(1/x)x^2\sin(1/x) has no limit of its own at the origin, and nothing about the slope as a function prevents that. What constrains it is the function it is the slope of. The function is continuous, so it has lowest points on closed intervals; lowest points inside an interval have slope nought; and subtracting a line moves the lowest point to wherever the slope equals the line’s. Every restriction on the slope — no steps, no removable gaps, every value in between — is a property of the function, carried across by that one move.

That is the same direction of reasoning that ran through the slope of a single point, where a slope was defined from secants of the function rather than from anything about slopes. The slope has no life of its own. It is a record of how the function’s secants behave, and whatever the function guarantees about its secants, the slope inherits — including, in the case that surprised everybody, the intermediate value property without the continuity it was supposed to come from.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

ContinuityCounterexampleDerivativeIntermediate value theoremLimitMean value theoremOscillationSecant