If $f(x)=\log |x|, x \neq 0$ then f'(x) equals
Answer & explanation
Correct answer: option 2
We have,
$f(x)=\log |x|= \begin{cases}\log x, & x>0 \\ \log (-x), & x<0\end{cases}$
∴ $f'(x)=\left\{\begin{array}{cl}\frac{1}{x}, & x>0 \\ -\frac{1}{x} \times(-1)=\frac{1}{x}, & x<0\end{array}\right.$
$\Rightarrow f'(x)=\frac{1}{x}$ for all $x \neq 0$.