Domain of the first derivative I have a question about a specific exercise. Given the following function
$$f(x) = |x|sin(x^2)$$
we have that the domain is $(-\infty,+\infty)$. Now the first derivative is
$$f'(x) = \frac{xsin(x^2)}{|x|} + 2x|x|cos(x^2)$$
and the domain is $(-\infty,0)\cup(0,+\infty).$ So I think that $x=0$ is a point of non-derivability. But if I do the limit for $x\rightarrow 0^+$ and for $x\rightarrow 0^-$ of $f'$ I have $0$ as a result of both. (In the same way $0$ is the result of the incremental rapport for $f$ in $0$). How is that possible? $0$ should be a point of non-derivability because of the domain of $f'$ but following these limits it seems to be a derivable point.
 A: The rules of differentiation work for the points you already know the function is differentiable; the function $|x|$ is differentiable if $x \ne 0$ and its derivative for $x \ne 0$ is $\frac{x}{|x|}$, and $\sin(x^2)$ is differentiable for any $x \in \mathbb{R}$. So, for the theorem of differentiability of a product, their product is differentiable for any $x\ne0$ and the derivative is given by the formula you've already written. However, for $x = 0$ no theorems guarantee the differentiability a priori for $f$ (because of the presence of $|x|$), so you must use the definition for $x=0$.
That is, you must evaluate $f'(0)$, if it exists, with the limit of the difference quotient:
$$f'(0)=\lim_{h \to 0} \frac{f(0+h)-f(0)}{h}=\lim_{h\to 0} \frac{f(h)}{h}=\lim_{h \to 0} \frac{|h|\sin(h^2)}{h}=\lim_{h \to 0} \frac{|h|\cdot[h^2+\text{o}(h^2)]}{h}=0$$
Hence
$$f'(x)=\begin{cases}\frac{x}{|x|}\sin(x^2)+2x|x|\cos x, \ \text{if} \ x \ne 0\\ 0, \ \text{if} \ x=0\end{cases}$$
Notice that another ways to write the derivative of $|x|$ for $x \ne 0$ is $\frac{|x|}{x}$ or $\text{sgn}(x)$, where
$$\text{sgn}(x)=\begin{cases}1, \ \text{if} \ x > 0\\ 0, \ \text{if} \ x =0,\\ -1, \ \text{if} \ x<0\end{cases}$$
