I came across an issue when I tried to simplify an expression, like this: $$(-1)^{2x}=((-1)^2)^x=(1)^x=1$$ So now it looks like the expression I started with will always equal one. However, when I for example fill in $x=\frac{1}{2}$, I get this: $$(-1)^{2x}=(-1)^{2\cdot\frac{1}{2}}=(-1)^1=-1$$ It clearly does not equal one, so I made a mistake somewhere. Apparently the first step, $(-1)^{2x}=((-1)^2)^x$, is only true when $x$ is even. Why is this?
I thought maybe the rule does not apply if the base number is negative. But that would not explain why you get the same error when simplifying this: $$e^{2x\pi i}=(e^{2\pi i})^x=(1)^x=1$$ Again, if you fill in a half, the result should be -1 and not 1.