Is $y={(-1)^{x\overπ}+(-1)^{-x\overπ}\over 2}$ the same as $y=\cos x$?
Solution 1:
The function $(-1)^x$ is multivalued; more precisely, $$ \log(-1)=i(2k+1)\pi $$ for all integers $k$. Thus the values of $(-1)^x$ are defined by $$ e^{x\log(-1)}=e^{ix(2k+1)\pi} $$ and the principal value is for $k=0$; thus the principal value of your expression is $$ \frac{(-1)^{x/\pi}+(-1)^{-x/\pi}}{2}=\frac{e^{ix}+e^{-ix}}{2}=\cos x $$ However, one should be very careful in manipulating exponentials in the complex numbers, because identities such as $(a^b)^c=a^{bc}$ don't hold.
Solution 2:
Everything you have is... sort of correct. Notice that we have a few problems with this. Mainly that
$$-1=(\pm i)^2\implies(-1)^{1/2}=\stackrel?\pm i$$
and similar such things. Indeed, WolframAlpha only takes what is known as the principal branch. A fancy way of saying that we choose a path such that $(-1)^x$ is continuous and satisfies certain properties, $(-1)^{1/2}=i$ for example. So, on the contrary, $e^{ix}$ is much easier to define. Indeed, if you graphed other branches of your function, the result would not be $\cos(x)$.
Just as a side note for fun, there is one interesting piece of math we can derive from this:
$e^\pi$ is irrational and transcendental since $e^\pi=(-1)^{-i}$.