Maths WorkshopMaths problems with full solutions
Exercise 1522Calculus › Single-variable calculus › Differentiation › Differentiable functionsL1Added 2 Nov 2026

Differentiable but not continuously differentiable

#differentiability#continuity of the derivative#counterexamples

Statement

Let f(x)=x2sin⁡1xf(x)=x^2\sin\dfrac1x for x≠0x\ne0 and f(0)=0f(0)=0.

  1. Show that ff is differentiable on R\mathbb{R} and compute f′f'.
  2. Show that f′f' is not continuous at 00.
Hint

Away from 00 use the usual rules. At 00 you must use the definition, with the squeeze theorem.

Show solutionHide solution

Solution

1. For x≠0x\ne0, by the product and chain rules,
f′(x)=2xsin⁡1x−cos⁡1x.f'(x)=2x\sin\frac1x-\cos\frac1x.
At 00, the difference quotient is
f(h)−f(0)h=hsin⁡1h,\frac{f(h)-f(0)}h=h\sin\frac1h,
and ∣hsin⁡1h∣≤∣h∣→0|h\sin\frac1h|\le|h|\to0. So f′(0)=0f'(0)=0 and ff is differentiable everywhere.

2. As x→0x\to0, the term 2xsin⁡1x→02x\sin\frac1x\to0, but cos⁡1x\cos\frac1x has no limit: it equals 11 along xn=12nπx_n=\frac1{2n\pi} and −1-1 along yn=1(2n+1)πy_n=\frac1{(2n+1)\pi}. So f′(x)f'(x) has no limit at 00, and in particular f′f' is not continuous at 00, although f′(0)f'(0) exists.

Remark. A derivative can be discontinuous. It cannot however have a jump discontinuity (see the problem on the limit of the derivative): its discontinuities are always of this oscillating kind.