If $f(x)=|\log _e|x||$, then f'(x) equals
Answer & explanation
Correct answer: option 2
For x > 1, we have
$f(x)=|\log | x||=\log x \Rightarrow f'(x)=\frac{1}{x}$
For x < -1, we have
$f(x)=|\log |x||=\log (-x) \Rightarrow f'(x)=\frac{1}{x}$
For 0 < x < 1, we have
$f(x)=|\log |x||=-\log x \Rightarrow f'(x)=-\frac{1}{x}$
For -1< x < 0, we have
$f(x)=-\log (-x) \Rightarrow f'(x)=-\frac{1}{x}$
Hence, $f'(x)=\left\{\begin{aligned} \frac{1}{x}, & |x|>1 \\ -\frac{1}{x}, & |x|<1\end{aligned}\right.$