Okay this question was on our math exam today, which states that
Find the domain at which $ f(X)=x|x|$ is differentiable?
(a) $\mathbb R$
(b) $\mathbb R-\{0\}$
(c) $\mathbb R$+
(d) none of the above
I was thinking about two ways to solve the question:-
the first one is to take the derivative of the function using the product rule which will be $ f'(x) = |x| + x \frac d {dx}|x| $ while I know that the function $|x|$ is not differentiable at zero then I deduced that $f'(x) $ is not differentiable at zero so I chose
(b) " $\mathbb R-\{0\}$ ".
the second way to think about the problem is to deal with it as ordinary $ |X| $ which will give us $X^2$ and $-x^2$, and taking their derivative which is $2x$ and $-2x$ by substituting by zero then both sides will be zero so it will be differentiable at zero so i chose
(a) $\mathbb R$
So, i need help to find the most correct one, and why the another is wrong.
Thanks.
You are correct, indeed
and the derivative at $x=0$ is $0$.
We can also show this fact directly by definition of derivative at the origin.
Note that $f(x)$ in not twice differentiable then $f\in C^1$ but $f\not \in C^2$.