I'm working on a numerical analysis project (working with matlab a lot) and I noticed that when I ask for matlab to compute the exponent of a negative number, it gives wrong output when the exponent is not an integer.
For example like the title, when I input $(-1)^{0.2}$ in my calculator, it says $1$, which is the correct answer, if I know anything about how exponents work.
This is because $(-1)^{0.2}=((-1)^2)^{0.1}=1^{0.1}=1$
However, when I put it in matlab, it gives the output $0.8090 + 0.5878i$ how can this be?
On the other hand, $(-1)^{0.2}=((-1)^{0.1})^2$ and $(-1)^{0.1}$ is indeed a complex number. So on the one hand it has an imaginary part, and on the other hand it doesn't...I'm very confused.
This is a very common misconception about powers of negative numbers. The rule $x^{ab} = (x^a)^b$ only works for positive $x$. The reason we restrict to positive $x$ is that powers become a bit mysterious in some sense if $x<0$. Solving $x = (-1)^{.2}$ can be thought of as solving for those $x$ so that $x^5 = -1$ instead. Is $1$ a solution to this equation?