Logarithm power law discrepancy According to the power law:-
$$\log_a (x^k) =k\log_a x $$
So take the following example:-
$$\log_2 ((-2)^2) $$
On solving $\log_2 4=2$
However, if we use the power law, then on simplifying, $2\log_2 (-2)$ is not defined.
So how do I justify this?

This dicrepancy is due to the fact that


*

*$\log x^2$ is defined for $x\neq 0$ but

*$2\log x$ is defined for $x>0$


then the two expression are equal $\iff x>0$.
What is true $\forall x\neq 0$ is that


*

*$\log x^2=2\log |x|$


where we have used that $\sqrt {x^2}=|x|$.
