Why are the domains for $\ln x^2$ and $2\ln x$ different?
Solution 1:
First, you could use $\ln x$ to define functions with different domains as long as $\ln x$ is defined in that domain.
Second, the rule $\ln x^n=n\cdot \ln x$ is a bit sloppy. It should always be pointed out that $x>0$. Likewise, $\ln ab=\ln a+\ln b$, only if $a,b>0$.
Solution 2:
Note that: $$ \ln (x^2)=2\ln |x| \ne 2 \ln x $$
so the two functions are different and have different domains.
Solution 3:
The functions $f(x) =2 \ln x$ and $g(x) = \ln x^2$ have different domains. The domain of $f$ is $(0,\infty)$, and the domain of $g$ is $\mathbb{R} - \{0\}$. But as you said, when $x$ is in the domain of $f$ and the domain of $g$, we have $f(x) = g(x)$.