# Continuity and differentiability of the function $x|x|$

Let $f:\mathbb R \to \mathbb R$ defined by $f(x) = x|x|$, Is the function continous at all points? If it is, then is it differentiable at all points?

Yes, the function is continuous everywhere but there is a slight confusion in differentiability. What I tried is,

$$\large{f(x) = \begin{cases} x^2 & x\geq 0 \\ -x^2 & x \leq 0 \end{cases}}$$

Then I applied left hand derivative limit and right hand derivative limit at $0$, then LDL comes to be $-x$ and RDL comes to be $x$, then the function is not differentiable at $0$. Am i right? and is the function not differentiable at some other points too.

• the function is once, but, not twice differentiable at zero. – James S. Cook May 19 '15 at 6:37

As you wrote, it is continuous everywhere. But it's also differentiable everywhere.

You might think that it's not differentiable because $|x|$ is not differentiable at $x=0$, where the graph makes a sharp turn.

But remember that you're dealing with $x|x|$, so as $f(x)$ approaches $0$, $x|x|$ approaches from the negative left (since $x$ is negative, $x|x|$ is too), and $x|x|$ approaches from the positive right. So there's no sharp turn that would cause it to be non-differentiable. Really, a picture paints a thousand words. Just plot $f(x)$ to see that it is clearly differentiable:

• No problem. I just tried to supply the intuitition. You can make your proof rigorous by using @learnmore's both-sided limits. – Newb May 19 '15 at 6:57

RHD:$\lim _{h\to 0}\dfrac{f(h)-f(0)}{h-0}=\lim_{h\to 0}\dfrac{h^2}{h}=0$

LHD:$\lim _{h\to 0}\dfrac{f(0)-f(-h)}{h}=\lim_{h\to 0}\dfrac{-h^2}{h}=0$

Both are equal and hence differentiable

• Yep...I forgot to apply the limit.... – Sam Christopher May 19 '15 at 6:43