# Derivatives of Piecewise Differentiable Functions

Suppose $f(x)$ is continuous and piecewise continuously differentiable where left derivatives always exist (think $|x|$). Suppose it is not differentiable at $x_0$, so let $f'(x_0) = \lim_{\epsilon \downarrow 0} \frac{f(x_0)-f(x_0-\epsilon)}{\epsilon}$. Is it possible to prove in general that $\lim_{x\uparrow x_0} f'(x) = f'(x_0)$?

In words, I want to say that the limit of the derivatives from the left is the left derivative.

• What exactly does "piecewise differentiable" mean? There are everywhere differentiable functions with discontinuous derivatives, so unless "piecewise differentiable" adds further regularity, you won't be able to prove it. – Daniel Fischer Feb 23 '16 at 16:48
• Thanks for the pointer. I mean that $f$ is continuously differentiable at all but a finite number of points. In my setting, $f$ is also convex, which guarantees the existence of the one sided limits. Something like a piecewise linear function is what I am thinking of, but more general. – eulerup Feb 23 '16 at 16:58
• Edited the question! – eulerup Feb 23 '16 at 16:58
• Piecewise continuous differentiability suffices. There is a $\delta > 0$ such that $f$ is continuously differentiable on $[x_0-\delta,x_0]$. – Daniel Fischer Feb 23 '16 at 17:02
• Could you elaborate? Because $f$ is not differentiable at $x_0$, why is it continuously differentiable on that interval? – eulerup Feb 23 '16 at 17:21

NOTE: THIS ANSWER WAS POSTED PRIOR TO AN EDIT IN WHICH THE PROPOSED FUNCTION WENT FROM PIECEWISE DIFFERENTIABLE TO PIESCEWISE CONTINUOUSLY DIFFERENTIABLE

Note that the function $f(x)$ given by

$$f(x)=\begin{cases}x^2\sin(1/x)&,x\ne 0\\\\ 0&x=0\end{cases}$$

is everywhere differentiable since

\begin{align} f'(0)&\equiv \lim_{h\to 0}\frac{f(h)-f(0)}{h}\\\\ &=\lim_{h\to 0}\frac{h^2\sin(1/h)-0}{h}\\\\ &=0 \end{align}

However, for $x\ne 0$,

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

while the limit

$$\lim_{x\to 0^{\pm}}f'(x)\,\,\text{fails to exist}$$

Therefore, we cannot assert anything about the continuity of the derivative without having additional smoothness properties attributed.

• Thanks for the answer -- sorry for editing the question after your post. (see comments above). I think your example works for that setting as well because $f'(x)$ is continuous until zero. I am searching for conditions under which my statement would be true. What if $f$ were also lipschitz? – eulerup Feb 23 '16 at 17:04
• In the example here, $f'(x)$ is not continuous at $x=0$ and therefore, $f$ is not (obvioulsy) continuously differentiable there. – Mark Viola Feb 23 '16 at 17:07