We consider the fonction $f$ defined by $$ f(x) = \begin{cases} x \log|x|-x, &x \neq 0\\ 0, &x =0. \end{cases} $$ The question is calculate $f'(x)$.
We have for all $x \neq 0$: $$f'(x)= (x(\log|x|-1))' = \log|x|-1 - \frac{x}{|x|}.$$ I have difficulties to finite calculate, the result have to be $\log|x|$ but how we found this result? Please.
Pedestrian approach:
1) $y:=\ln |x|$ , $x \not =0.$
a) $x >0:$
$y=\ln |x| =\ln x; $
$y' = 1/x.$
b) $x <0:$
$y= \ln |x| = \ln (-x);$
$y' = (1/(-x))(-1) = 1/x$, chain rule.
c) $x \not =0:$
$f'(x)= \log |x| +x/x -1= \log |x|.$
d) $x=0:$
$\lim_{h \rightarrow 0} \dfrac{(h \ln|h| -h) -f(0)}{h}=$
$\lim_{h \rightarrow 0}(\ln |h| -1).$
Does not exist.