# Is $y={(-1)^{x\overπ}+(-1)^{-x\overπ}\over 2}$ the same as $y=\cos x$?

I have always been intrigued by the equation $y=(-1)^x$, perhaps because it is so simple yet so difficult to find information about. It's the closest thing to a trigonometric function attainable using only "basic" math. If you evaluate it for only whole numbers, it exhibits trigonometric behavior, going up and down the x-axis to a peak of $±1$. When we start plugging in decimal values, it gets tricky, yielding "real" values for fractions with odd numbers and complex values for fractions with even numbers. What do you do with this infinitesimal oscillation? A normal graphing software will not graph the equation. Wolfram Alpha, however, offers a graph, which looks like this.

I, unfortunately, couldn't understand how the website arrives at these curves, when really $(-1)^{1\over3}$ should equal $-1$. Yet, I discovered how the cosine function can be expressed in terms of $y=(-1)^x$ by manipulating Euler's identity.

$$e^{iπ}=-1$$ $$e^{iπx}={(-1)}^x$$ $$e^{ix}={(-1)}^{x\overπ}$$ $$e^{-ix}={(-1)}^{{-x\overπ}}$$

Since $\cos x={e^{ix}+e^{-ix}\over 2}$, adding the two above equations and dividing by two allows us to conclude that

$${(-1)^{x\overπ}+(-1)^{-x\overπ}\over 2}=\cos x$$

Wolfram Alpha confirms:

I have not seen this transformation anywhere. Am I the first to find it? It would be pretty cool if I were. Another stunning relationship I found is that the equation $y=(-1)^{-ix\overπ}$ yields the ordinary function $y=e^x$. This can be proven almost the exact same way. I think this is fascinating, and I am confused why so little is written about this. The only problem is, the relationships work when you derive them, but when you plug in numbers, why the graphs would look like that is baffling.

• $(-1)^{1/3} \neq -1$, but $(-1)^{1/3}=\left\{-1, \exp \frac {i\pi}{3}, \exp \frac {-i\pi} 3\right\}$. – YoTengoUnLCD Dec 30 '16 at 23:50
• Raising to the power of 1/3 is a cube root, no? (-1)*(-1)*(-1) definitely equals -1. – tphilli Dec 30 '16 at 23:52
• @tphilli But did you check the other values? – Simply Beautiful Art Dec 30 '16 at 23:54
• Yes, but that's not the only solution to $x^3 = -1$. Exponentiation gets screwy when you consider bases that aren't non-negative reals. – YoTengoUnLCD Dec 30 '16 at 23:55
• Woo! I can upvote again! +1 for noticing interesting things. – Simply Beautiful Art Dec 31 '16 at 0:00

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.

• Where can I learn more about this $(a^b)^c≠a^{bc}$ uncertainty? – tphilli Dec 31 '16 at 0:26
• @tphilli Such information can be found here – Simply Beautiful Art Dec 31 '16 at 0:40
• @tphilli See also this answer. – dxiv Dec 31 '16 at 0:42

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}$.

• Yes... That is a good point... – tphilli Dec 31 '16 at 0:23