What is the derivative of $|x|^r$ Let $r>1$. We look a the function $x\mapsto |x|^r$. In my understanding, after applying the chain rule for $x\neq 0$, we have that the derivative is $rx|x|^{r-2}$. For 0, after checking the difference quotient, we have that the derivative there is 0. Is this correct? I’m asking because in some material I’m reading, the derivative at $x\neq 0$ is given without the $r$-term and I’m not sure wether that’s a typo.
 A: For $x\neq 0$ derivative is:
$$\begin{cases}r x^{r-1} &, \text{for }x> 0\\ -r x^{r-1}&,\text{for }x<0 \end{cases}$$
In point $x=0$ the function is continous, but not necesarly differentiable.
We know, that $r>1$, so $r-1>0$. Thus we have:
$$\lim_{x\to 0^{+}}rx^{r-1} = 0$$
$$\lim_{x\to 0^{-}}-rx^{r-1} = 0$$
As the limits for both sides are equal, the derivative in point $x=0$ exists and is equal to these limits, thus we can expand our definition of derivative:
$$\begin{cases}r x^{r-1} &, \text{for }x> 0\\0&, \text{for }x=0\\ -r x^{r-1}&,\text{for }x<0 \end{cases}$$
A: By the chain rule,
$$(|x|^r)'=r|x|'|x|^{r-1}.$$
As the absolute value is piecewise linear, the derivative $|x|'$ is $-1$ in the negatives and $1$ in the positives.
The case of $x=0$ requires a special treatment as the first derivative is not defined.
Now for $r>1$,
$$\lim_{x\to0}\left|\frac{|x|^r-0}{x-0}\right|=\lim_{x\to0}\,|x|^{r-1}=0=\lim_{x\to0}\frac{|x|^r-0}{x-0}.$$
A: You are fully correct.
Chain rule, with the knowledge that the derivative of $x\mapsto|x|$ is $x/|x|$ (for $x\ne0$); thus, for $x\ne0$,
$$
f'(x)=r|x|^{r-1}\frac{x}{|x|}=r|x|^{r-2}x
$$
At zero the derivative is $0$ (provided $r>1$), as it is easy to see.
Alternatively,
$$
\log f(x)=r\log\lvert x\rvert
$$
so
$$
\frac{f'(x)}{f(x)}=\frac{r}{x}
$$
and
$$
f'(x)=\frac{r|x|^r}{x}=\frac{r|x|^{r-2}x^2}{x}=r|x|^{r-2}x
$$
(for $x\ne0$, of course).
You may want to use the “sign function”:
$$
\operatorname{sgn}x=\begin{cases}
-1 & x<0\\[4px]
0 & x=0 \\[4px]
1 & x>0
\end{cases}
$$
so that
$$
f'(x)=r|x|^{r-1}\operatorname{sgn}x
$$
(also for $x=0$), but it's just cosmetic.
