# Why do some logarithmic equations have two solutions?

I was trying to find solutions for a high school math problem, but there was one thing I didn't quite understand.

There is a logarithmic identity that says that

$$ln\:x^2=2\cdot ln \:x$$

However, when solving an equation, the two different forms give different solutions When graphing in Geogebra, or trying to solve with wolframalpha, $$2 \cdot ln\:x=1$$ has only a positive answer to the equation ($$\sqrt e$$)

But when using $$ln\:x^2=1$$, I also get the solutions for negative x ($$\:\sqrt e, -\sqrt e)$$.

If these forms are exactly the same, why do they give different solutions?

$$\log x^2=2\log |x|.$$
• @ZackKing: this is because $x^2=|x|^2$, nothing to do with logarithms. – Yves Daoust Mar 17 at 19:47
$$\ln(x^2) = 2\ln(x)$$ only holds for $$x > 0$$.
• I agree, but I guess this is implied as $\ln(x)$ was probably only defined for $x > 0$ anyway. – Klaus Mar 17 at 19:45