[Math] $(-1)^X?$

complex numbersgraphing-functionswolfram alpha

Why the negative number raised to X gives strange graph?

Y = (-1) ^ X

enter image description here

This is sine and cosine both functions in real and imaginary part.

How to explain this?

Best Answer

If you heard about complex numbers, you should wonder how powers are evaluated in the complex.

A possible definition is with the polar representation

$$z=re^{i\theta}\implies z^x=r^xe^{i\theta x}$$ where $x$ is a real number.

Then

$$(-1)^x=(e^{i\pi})^x=e^{i\pi x}=\cos(\pi x)+i\sin(\pi x).$$


Beware that this is not the definition, because one also has

$$(-1)^x=(e^{i3\pi})^x=\cos(3\pi x)+i\sin(3\pi x)$$ and similar with other $2\pi$ increments.


More generally, a complex raised to a complex power can be defined by logarithms,

$$z^w=e^{w\log z}=e^{w(\log r+i\theta)}=e^{x\log r-y\theta+i(x\theta+y\log r)}=e^{x\log r-y\theta}(\cos(x\theta+y\log r)+i\sin(x\theta+y\log r)).$$

Related Question