If I want to use logarithmic differentiation to differentiate a function $y = f(x)$, and $f(x)$ evaluates to negative numbers for some values of $x$, then I can't just take the log of both sides. I have to take the log of the absolute value of both sides since logs are undefined on negative numbers. But since the absolute value function is not one-to-one, it's not necessarily true that
$$y = f(x) \iff \ln |y| = \ln |f(x)|$$
right? So are there any cases where this causes logarithmic differentiation to give the wrong answer?
Can logarithmic differentiation give the wrong answer when applied to functions that evaluate to negative numbers
calculusderivativesfunctions
Best Answer
If I understand the question correctly, the procedure under discussion is finding $f'(x)$ by calculating $f(x)\cdot \frac d{dx}(\log |f(x)|)$, and the question is whether the absolute value signs could ever cause this procedure to produce the wrong formula for $f'(x)$.
The answer is no, and the reason is that the derivative of the function $\log|u|$ is $\frac1u$ for all $u\ne0$ (check this). We think of $\log u$ as "the" function that has derivative $\frac1u$, but $\log|u|$ is a perfectly good function defined on the entire domain of $\frac1u$ whose derivative is in fact $\frac1u$. This, by the way, is the reason that the indefinite integral $\int \frac1u\,du$ evaluates to $\log|u|+C$ rather than $\log u+C$: the former answer accounts for the entire domain of $\frac1u$ while the latter doesn't.