Search the corpus

    A differentiable function with discontinuous derivative

    P-AZOFF-A03

    Area
    Real Analysis
    Status
    draft

    Give an example of a function \(f:\mathbb R\to\mathbb R\) that is differentiable everywhere but whose derivative \(f'\) is not continuous at \(0\).

    Solution

    Define \[ f(x)= \begin{cases} x^2\sin(1/x^2),&x\neq0,\\ 0,&x=0. \end{cases} \]

    1. The function \(f\) is differentiable at every \(x\neq0\), with\[ f'(x) = 2x\sin(1/x^2) - \frac{2}{x}\cos(1/x^2). \]

    On \(\RR\sm\{0\}\), the function is a product and composition of differentiable functions. The product and chain rules give \[ \begin{aligned} f'(x) &= 2x\sin(1/x^2) + x^2\cos(1/x^2)\left(-\frac{2}{x^3}\right)\\ &= 2x\sin(1/x^2) - \frac{2}{x}\cos(1/x^2). \end{aligned} \]

    2. The function \(f\) is differentiable at \(0\), and\[ f'(0)=0. \]

    By the definition of the derivative, \[ \frac{f(h)-f(0)}{h} = h\sin(1/h^2) \] for \(h\neq0\). Since \[ \abs{h\sin(1/h^2)} \leq \abs h \longrightarrow 0, \] we obtain \[ f'(0) = \lim_{h\to0}\frac{f(h)-f(0)}h = 0. \]

    3. The derivative \(f'\) is not continuous at \(0\).

    For \(n\geq1\), put \[ x_n=\frac{1}{\sqrt{2\pi n}}. \] Then \(x_n\to0\) and \[ \frac{1}{x_n^2}=2\pi n. \] By step 1, \[ \begin{aligned} f'(x_n) &= 2x_n\sin(2\pi n) - \frac{2}{x_n}\cos(2\pi n)\\ &= -\frac{2}{x_n}. \end{aligned} \] Thus \[ f'(x_n)\longrightarrow-\infty, \] whereas step 2 gives \(f'(0)=0\). Hence \(f'(x_n)\) does not converge to \(f'(0)\), so \(f'\) is not continuous at \(0\).

    4. The displayed \(f\) is an everywhere differentiable function whosederivative is discontinuous at \(0\).

    Steps <1>1–<1>2 prove differentiability on all of \(\RR\), and step 3 proves the required discontinuity.

    5. Q.E.D.

    Step 4 supplies the requested example.