Tutorials › Real Analysis › Noncontinuous Derivatives

Differentiation · Tutorial 455 of 1000

Noncontinuous Derivatives

Learn how a function can be differentiable everywhere while its derivative fails to be continuous, and how the Mean Value Theorem helps analyze derivative limits.

Advanced 10 min read

What You'll Learn

  • Define continuity of a derivative at a point
  • Construct a differentiable function whose derivative oscillates near the origin
  • Verify when derivative values become unbounded near a point
  • Use sequences to test whether a derivative has a limit
  • Apply the Mean Value Theorem to identify a finite derivative limit
  • Distinguish oscillatory discontinuity from a jump discontinuity

Differentiability Does Not Guarantee a Continuous Derivative

Differentiability is a local condition on the function: it asks whether difference quotients based at a point have a limit. It does not require the derivatives at nearby points to approach the derivative at that point. The examples in Derivative-Based Counterexamples already show that derivative values near a point can behave very differently from the derivative there. We now make the resulting failure of continuity explicit.

For a function \(f\) differentiable on an open interval containing \(a\), the derivative \(f'\) is itself a function on that interval. Its continuity at \(a\) is a separate question.

Definition: The derivative \(f'\) is continuous at \(a\) if \(\lim_{x\to a}f'(x)=f'(a)\). If this equality fails, then \(f'\) is discontinuous at \(a\), even though \(f'(a)\) may exist.

There are two especially instructive ways continuity can fail. Nearby derivative values may oscillate between distinct limits along different sequences, or their magnitudes may grow without bound. We will verify both possibilities directly. The first is a useful model because the derivative stays bounded but has no limit.

A Bounded Derivative Can Oscillate Without a Limit

The following result gives a family of functions with a derivative that oscillates near the origin. Taking the exponent parameter to be \(2\) will provide our first example.

Theorem: Let \(q\) be a positive even integer, and define \(f(0)=0\) and \(f(x)=x^{q+1}\sin(1/x^q)\) for \(x\ne0\). Then \(f\) is differentiable on \(\mathbb{R}\), \(f'(0)=0\), and \(f'\) is not continuous at \(0\).

Proof. For \(h\ne0\), the difference quotient at the origin is

$$ \frac{f(h)-f(0)}{h} =h^q\sin(1/h^q). $$

Its absolute value is at most \(|h|^q\), which tends to zero as \(h\to0\). Thus \(f'(0)=0\). For \(x\ne0\), the product and chain rules give

$$ f'(x)=(q+1)x^q\sin(1/x^q)-q\cos(1/x^q). $$

To test continuity at zero, consider the positive sequences

$$ x_n=(2\pi n)^{-1/q}, \qquad y_n=((2n+1)\pi)^{-1/q}, \qquad n=1,2,\ldots. $$

Both sequences tend to zero. Since \(1/x_n^q=2\pi n\), substitution into the derivative formula gives

$$ f'(x_n)=(q+1)x_n^q\sin(2\pi n)-q\cos(2\pi n)=-q. $$

For the other sequence, \(1/y_n^q=(2n+1)\pi\), so

$$ f'(y_n)=(q+1)y_n^q\sin((2n+1)\pi)-q\cos((2n+1)\pi)=q. $$

If \(f'\) were continuous at zero, both sequences of derivative values would tend to \(f'(0)=0\). Instead, one is constantly \(-q\), and the other is constantly \(q\). Since \(q>0\), these values differ, so \(f'\) is not continuous at zero. \(\square\)

Worked Example: A Bounded Oscillating Derivative

Take \(q=2\) in the theorem, so \(f(0)=0\) and \(f(x)=x^3\sin(1/x^2)\) when \(x\ne0\). The difference quotient at zero is

$$ \frac{f(h)-f(0)}{h}=h^2\sin(1/h^2), \qquad \left|h^2\sin(1/h^2)\right|\leq h^2. $$

It tends to zero, so \(f'(0)=0\). At nonzero \(x\),

$$ f'(x)=3x^2\sin(1/x^2)-2\cos(1/x^2). $$

Choose \(x_n=(2\pi n)^{-1/2}\) and \(y_n=((2n+1)\pi)^{-1/2}\). For the first sequence, the sine term is zero and the cosine term is \(1\), giving \(f'(x_n)=-2\). For the second, the sine term is zero and the cosine term is \(-1\), giving \(f'(y_n)=2\). Both sequences approach zero, but the derivative values have different limits. Thus \(f'\) is discontinuous at zero, even though \(f'(0)=0\).

This example also shows that unboundedness is not necessary for discontinuity. For \(x\ne0\), the formula implies

$$ |f'(x)|\leq 3x^2+2. $$

In particular, the derivative values remain bounded for \(x\) sufficiently close to zero. Their failure to settle to a single value comes from oscillation, not growth in magnitude.

Nearby Derivative Values Can Also Become Unbounded

A different choice of powers makes the oscillating term in the derivative grow in magnitude. This gives another way for continuity to fail: a continuous function at a point must have nearby values close to its value there, whereas an unbounded derivative cannot satisfy that condition.

Worked Example: An Unbounded Derivative Near the Origin

Define \(g(0)=0\) and \(g(x)=x^2\sin(1/x^3)\) for \(x\ne0\). At zero,

$$ \frac{g(h)-g(0)}{h}=h\sin(1/h^3), \qquad \left|h\sin(1/h^3)\right|\leq |h|. $$

Therefore \(g'(0)=0\). At nonzero \(x\), differentiation gives

$$ g'(x)=2x\sin(1/x^3)-\frac{3}{x^2}\cos(1/x^3). $$

Set \(x_n=(2\pi n)^{-1/3}\), so \(x_n\to0\) and \(1/x_n^3=2\pi n\). The sine term vanishes and the cosine term equals \(1\). Hence

$$ g'(x_n)=-\frac{3}{x_n^2}=-3(2\pi n)^{2/3}. $$

These values tend to \(-\infty\). Thus \(g'\) is unbounded in every neighborhood of zero, so it cannot be continuous there. Notice that the difference quotient at zero and the derivative values at the \(x_n\) answer different questions: the former establishes \(g'(0)\), while the latter describes derivatives at nonzero inputs.

A Finite Limit of Nearby Derivatives Must Match

When nearby derivative values do have a finite limit, the Mean Value Theorem forces that limit to equal the derivative at the point. This fact is useful when checking a proposed continuity claim: there cannot be a finite punctured limit different from \(f'(a)\).

Theorem: Suppose \(f\) is differentiable on an open interval containing \(a\). If \(\lim_{x\to a,\,x\ne a}f'(x)=L\) for a finite real number \(L\), then \(f'(a)=L\).

Proof. For any \(x\ne a\) sufficiently close to \(a\), \(f\) is continuous on the closed interval with endpoints \(a\) and \(x\), and differentiable in its interior. The Mean Value Theorem therefore gives a point \(c_x\) strictly between \(a\) and \(x\) such that

$$ \frac{f(x)-f(a)}{x-a}=f'(c_x). $$

As \(x\to a\), the point \(c_x\), lying between \(a\) and \(x\), also tends to \(a\). Since \(c_x\ne a\), the assumed limit of \(f'\) implies \(f'(c_x)\to L\). Consequently,

$$ f'(a) =\lim_{x\to a}\frac{f(x)-f(a)}{x-a} =\lim_{x\to a}f'(c_x) =L. $$

The first equality is the definition of \(f'(a)\), which exists by hypothesis. This proves the result. \(\square\)

The theorem does not say that every derivative has a limit at each point. It says that if a finite limit of nearby derivative values exists, its value is already determined. In the oscillating example, the two sequences show that no such limit exists. In the unbounded example, the displayed sequence rules out a finite limit as well.

Worked Example: Adding a Linear Term

Let \(H(x)=x+f(x)\), where \(f\) is the function from the bounded oscillation example. Since \(f'(0)=0\), direct use of the difference quotient gives

$$ H'(0)=\lim_{h\to0}\frac{h+f(h)}{h} =1+\lim_{h\to0}\frac{f(h)}{h} =1. $$

For \(x\ne0\), the derivative is

$$ H'(x)=1+3x^2\sin(1/x^2)-2\cos(1/x^2). $$

Along \(x_n=(2\pi n)^{-1/2}\), this gives \(H'(x_n)=1-2=-1\). Along \(y_n=((2n+1)\pi)^{-1/2}\), it gives \(H'(y_n)=1+2=3\). Neither sequence of values tends to \(H'(0)=1\), and they also disagree with each other. Thus the derivative can be discontinuous even when its value at the point is nonzero.

The added linear term changes the derivative at zero from \(0\) to \(1\), and shifts both oscillating sequences of values by \(1\). It does not remove the discontinuity.

What These Examples Do—and Do Not—Show

The examples establish that a function can be differentiable everywhere while its derivative is discontinuous. They also distinguish three different situations: bounded oscillation, unbounded derivative values near a point, and oscillation around a nonzero derivative value. In each case, continuity is tested by comparing \(f'(x)\) with \(f'(a)\) as \(x\) approaches \(a\), rather than by looking only at whether \(f'(a)\) exists.

A common pitfall is to infer continuity of \(f'\) from differentiability of \(f\). Differentiability guarantees that the derivative exists, but it does not guarantee that nearby derivative values approach it. Another pitfall is to treat a formula for \(f'(x)\) at \(x\ne a\) as if it automatically applied at \(a\). The derivative at \(a\) must be established from its difference quotient, as in the examples above.

There is also an important restriction on how a derivative can be discontinuous. Darboux’s Theorem for Derivatives, which is studied in the next two tutorials, says that derivatives have the intermediate value property. In particular, a derivative cannot have a simple jump discontinuity: if it takes values on opposite sides of a number between two inputs, it must take that intermediate value somewhere between them. The oscillation in our examples is consistent with this property; the derivative moves through intermediate values rather than jumping over them. The next tutorial examines this feature in detail.

1
Compute the derivative at the point.
Use the difference quotient at the point where continuity is being tested.
2
Differentiate away from the point.
Obtain a formula for nearby derivative values, without assuming that the formula extends to the point.
3
Test a limit or find contrasting sequences.
Two sequences with different limiting derivative values disprove continuity; a sequence with unbounded derivative values does so as well.

Check Your Understanding

Use the definitions and arguments in this tutorial to assess each question.

  1. What two facts must be compared to determine whether \(f'\) is continuous at \(a\)?
  2. For \(f(x)=x^3\sin(1/x^2)\), what are the values of \(f'(x_n)\) and \(f'(y_n)\) for the sequences used in the worked example?
  3. Why does the sequence \(x_n=(2\pi n)^{-1/3}\) show that the derivative of \(g(x)=x^2\sin(1/x^3)\) is unbounded near zero?
  4. What does the Mean Value Theorem imply if \(f'(x)\) has a finite limit as \(x\to a\), with \(x\ne a\)?
  5. Why do the examples of oscillating derivatives not contradict Darboux’s Theorem for Derivatives?