Why do these "equal" logarithms give different answers

This came across a discussion amongst Algebra 2 teachers at my school.
We know $a\log x= \log x^a$
Say
$2\log x=5$
$\log x^2 =5$
When $\log x=\log_{10} x$
Solving the first equation yields $x=10^{5/2}$ while the second equation yields $x=\pm\sqrt{10^5}$.
Which solution is correct or does it depend on the equation?


The equations "$2\log x = 5$" and "$\log x^2=5$" are not equivalent.

The reason is that the first equation implies that $x>0$ while the second does not.

The correct way to move from the first to the second is to conjoin the condition $x>0$. So instead, one can say that "$2\log x = 5$" and "$\log x^2 = 5 \textrm{ where }x>0$" are equivalent.


The fallacy in the question is that (in $\mathbb R$) we do NOT

know $a\log x= \log x^a$

What actually holds is:$$x>0\implies a\log x=\log x^a$$