# The existence of second derivative

Let $f(x)=|x|x$ then $f''(0)$ does not exist.

Why?

If $x>0$, $f'(x)=2x$ and if $x<0$, $f'(x)=-2x$.

Then when $x=0$, does $f'(x)$ also not exist?

-
You are on the right track but you got confused at the end. f'(x) exists and is continuous at all points. It is: 2x for x>0 and -2x for x<0. Now think about the function f'(x) (this really is a function for all x and is different to f(x) and f''(x) ). As x approaches 0 from below, the gradient of f('x) is -1. As f'(x) approached 0 from above, the gradient of f'(x) is 1 which does not equal -1. Hence f'(x) is not differentiable at x=0. –  Adam Rubinson Nov 27 '12 at 11:47

Write $f$ as: $$f(x) = \begin{cases} x^2 & \text{if } x \ge 0 \\ -x^2 & \text{if } x < 0\end{cases}$$

It's easy to see that $f$ is differentiable everywhere. The case $x = 0$ gives $f'(0) = 0$ for the limits from both sides.

We have: $$f'(x) = \begin{cases} 2x & \text{if } x \ge 0 \\ -2x & \text{if } x < 0\end{cases}$$

In other words, $f'(x) = 2|x|$, which is not differentiable at $x = 0$.

-
Thanks! I'd like to check to accept your answer but don't know why it doesn't work. –  email Nov 27 '12 at 11:46
@email Happy to help! –  Ayman Hourieh Nov 27 '12 at 11:55

$f'(x)= 2x$ if $x\geq0$ and $f'(x)=-2x$ if $x\leq 0$. Note that $f'$ is well defined (because $2\times 0 = -2 \times 0$.

Now for $f''$ we have $f''(x)= 2$ if $x\geq 0$ and $f''(x)= -2$ if $x\leq 0$. This isn't well defined in 0.

-