Exponentiation not commutative? I have noticed the following:
$$\left( (-1)^{1/2} \right)^2 = i^2= -1$$
But
$$\left( (-1)^{2} \right)^{1/2} = \sqrt{1} = 1$$
I understand with complex numbers there is an issue of taking the principal root, yet this problem is still present. Under what circumstances will exponents commute?
 A: Complex exponentiation is defined as $a^b=e^{b\log a}.$ To analyze the commutativity in this case, $i^2=e^{2\log i}$ and $\log i =\ln(1)+i(2\pi m+\pi/2)$ and $m\in\Bbb{Z}$ depends on the branch of logarithm that we choose. Therefore $$i^2=e^{2i(2\pi m+\pi/2)}=e^{i\pi}=-1$$ regard less of the branch. On the other hand, $\sqrt{1}=e^{1/2\log 1},$ where $\log 1=\ln(1)+2\pi n i$ for some $n\in\Bbb{Z}.$ Thus $$\sqrt{1}=e^{n\pi  i}$$ and this depends on the branch that we choose. According to the parity of $n,$ here we have $$\sqrt{1}=\pm1.$$
A: Integer powers commute. If $a,b\in \Bbb Z$, then $(z^a)^b=z^{ab}=(z^b)^a$, for any complex $z$. Further, if $x$ is a positive real number, any real powers commute, so $(x^a)^b=x^{ab}=(x^b)^a$ for $a,b\in\Bbb R$.
Outside of those special cases, it’s best to be careful.
A: You don't really need to think about complex numbers here.
Just look at
$$
\left((-1)^2\right)^{1/2} = 1
$$
and
$$
(-1)^1 = -1.
$$
The issue here is the fact that the equation $x^2=1$ has two solutions, $x=+1$ and $x=-1$.
When you write $1^{1/2}$, you're taking the positive square root of $1$, which is $1$.
To elaborate
Let's rewrite your problem as follows:
$$
\textbf{Problem 1: }\text{Find $x$ such that } x = \left((-1)^2\right)^{1/2}.
$$
Look at the related problem:
$$
\textbf{Problem 2: }\text{Find $x$ such that } x^2 = (-1)^2.
$$
Clearly, Problem 2 has two solutions, $+1$ and $-1$.
Problem 1 is essentially asking for the positive solution to Problem 2, hence the inconsistency.
In short: As John Lou said in his comment, if the base is negative, you can't necessarily commute exponentiation.
