# Show that f is differentiable at every point in R, and find the derivative f'

I have been stuck in this problem for a while, its practice question for my exam in my real analysis calculus class. Any help would be great! Thank you!

Define $f: \Bbb R \to \Bbb R$ by

$$f(x) = \left\{\begin{array}{l}x^2\ \text{if}\ x \ge 0\\-x^2\ \text{if}\ x < 0\end{array}\right.$$

(a) Show that $f$ is differentiable at every point in $\Bbb R$, and find the derivative $f'$.

(b) Show that $f'$ is not differentiable at $0$. Hence there are differentiable functions that are not twice differentiable.

• and the derivative $f'$...? – Avitus Dec 1 '13 at 21:49
• sorry i just edited it, find the derivative – Alex Chavez Dec 1 '13 at 21:49

How about this? It helps to see where the problem points may be. Do you know that every function of the type $x^n$ is differentiable? If so, $x^2$ and $-x^2$ are differentiable everywhere, but there may be a problem at $x=0$ , because of the definition of $f$. For (b), calculate $f''(x)$
For $x\ge 0$, $f'(x)=\frac{\text dx^2}{\text dx}=2x$, while if $x<0$, $f'(x)=\frac{\text d(-x^2)}{\text dx}=-2x$, so $$f'(x)=\left\{\begin{array}{l}2x\ \forall x\ge0\\-2x\ \forall x<0\end{array}\right.=|2x|$$
It should be straightforward to show $|2x|$ is not differentiable.
Find the potential problem points, they are mostly obvious, like in your case, it is $x=0$. You have to prove that $\lim_{x \to 0^{=}}f'(x) = \lim_{x \to 0^{=}}f'(x) = f'(0)$. If that condition is fulfilled, that means that the function is differentiable in $x=0$.
After that, b) use the same condition, if $\lim_{x \to 0^{=}}f''(x) = \lim_{x \to 0^{=}}f''(x) = f''(0)$ is not fulfilled, that means that the function is not differentiable in $x=0$, thus it is not differentiable.