I have fear this is an extremely ridiculous and basic question. But let's say we have
$f(x) = \ln(x^2)$
by applying one of the most basic identities for logarithms, it should be possible to say that
$f(x) = \ln(x^2) = 2 \ln(x)$
However, it seems this actually changes the function. If I evaluate $\ln(x^2)$ with a negative number, I will certainly get a real number. However, the second version will result in a complex number. For example:
$ \ln((-10)^2) = 4.60517019$
$2 \ln(-10) = 4.60517019 + 6.28318531\text { }i$
Can someone explain where is my error?