Say for instance, we have a function $y = x^3$, the derivative of which is $\frac{\mathrm{d}y}{\mathrm{d}x} = 3x^2$. Now, say I want to do a logarithmic differentiation: $$ \ln(y) = \ln(x^3) \hspace{10pt}\implies\hspace{10pt} \ln(y) = 3\ln(x), $$ so by implicit differentiation with respect to $x$, $$ \frac{1}{y}\frac{\mathrm{d}y}{\mathrm{d}x} = 3\cdot\frac{1}{x} \implies \frac{\mathrm{d}y}{\mathrm{d}x} = y\cdot 3 \cdot \frac{1}{x} = x^3\cdot \frac{3}{x} = 3 x^2. $$
Why does this work, even though $\ln(x)$ function is not defined for negative values of $x$?
Or does doing differentiation using logarithms limit the result to positive values for $x$ only which in this case is yielding the correct result nonetheless?
For some reason, the authors of articles I found regarding the same, don't seem to be too concerned regarding this problem. Any help would be appreciated,
Thankyou.
Logarithms are defined for all numbers except 0.
If you haven’t learned about Euler’s identity, it states that $$e^{{\pi}{i}}=-1$$
This is a very famous identity, which is learnt typically during the early stages of complex numbers.
Anyway, this formula basically shows that we can take a log of a negative number, we’ll just get a complex result. $$\log(e^{{\pi}{i}})=\log(-1)$$ Hence, $${\pi}{i}{log(e)}=log(-1)$$ and $$log(-1)={\pi}{i}$$ Using the logarithmic identities like the addition one we can then determine the logarithm for any real number except for 0 (you can find out why with some pen and paper).
Since the calculus works for complex numbers as well, albeit differently, you can, in fact, differentiate it.