The function $(-1)^{-x}$

I was bored so I put functions in Wolfram Alpha. And I got something that looks like a sin function. And in addition to that, the real part was continuous and the imaginary part was a cos function. It might be obvious to most of you but the only math education I got is from high school. Thanks.

• What's the question? – user228113 Jun 14 '16 at 13:58
• @G.Sassatelli OP wants to know why the graph is the way it is – Gathdi Jun 14 '16 at 14:00

First you need to assume that you're working within the complex numbers, meaning that we assume $-1\in \mathbb C$ - otherwise your expression is simply not defined - and further we assume that $x\in \mathbb{R}$.

Now we perform some basic manipulations on your expression and get $$(-1)^{-x}=\exp\{\log((-1)^{-x})\}=\exp\{-x\log(-1)\}$$ The expression $\log(-1)$ is not defined in $\mathbb R$ but is very much in $\mathbb C$, we are working with the complex logarithm and are using the principal value, we get $$\log(-1)=\log(1)+i\mathrm{arg}(1)=i\pi$$ Now we put everything back together and we get using the Euler formula for $x\in \mathbb R$ \begin{align} (-1)^{-x}=\exp\{\log((-1)^{-x})\}=&\exp\{-x\log(-1)\}\\ =&\exp\{-xi\pi\}\\ =&\cos(x\pi)-i\sin(\pi x) \end{align} Now you can plot your function, decomposed into an imaginary and real part, and you'll get the desired $\sin(\cdot),\cos(\cdot)$ functions, which are scaled accordingly. That means $$\Re((-1)^{-x})=\cos(x\pi) \text{ and } \Im((-1)^{-x})=-\sin(\pi x)$$

I assume that you are wondering why this pattern emerges,

It follows from Euler's identity that $(-1)^x = \cos(\pi x) + i\sin(\pi x) = \text{cis}(\pi x)$, which explains the sine-like behavior.

Thus, $(-1)^{-x} = \text{cis}(-\pi x) = e^{-i x} = \cos(\pi x) - i \sin(\pi x)$.

It is worth noting, that it really has to do with arbitrary, although convinient, conventions.

This has been asked several times already, I am just too bored to look for duplicates.

In general, for $x,y \in \Bbb C$, one defines $x^y$ as $\Bbb e ^{y \ln x}$. Of course, one has to tell what the natural logarithm means for complex numbers. The usual procedure is to eliminate a half-line from the complex plane, in order to be able to unambigously define a "principal argument". Fine, but what half-line to choose? Most people choose to eliminate the subset $\{ z \in \Bbb C \mid \Re z \le 0 \}$, which means that with this convention one may not speak about $\ln y$ for real $y \le 0$. In particular, $(-1)^{-x}$ would no longer make sense under this convention.

Of course, other half-lines may be eliminated, in which case one might be able to define $(-1)^{-x}$ (which would be a complex number even for $x \in \Bbb R$!), but this approach is less common. Assuming that you choose to go this way, you could remove the half-line $\{ z \in \Bbb C \mid \Re z \ge 0 \}$ (this being just one possibility among many others), define the principal argument to be $\arg z$ to be the angle formed by the segment $0z$ with the $x$-axis (measured from the $x$-axis counter-clockwisely), and then define $\ln z = \ln |z| + \Bbb i \arg z$. It becomes clear that, with this convention, $\ln (-1) = \ln 1 + \Bbb i \pi = \Bbb i \pi$, so that

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

so $\Re (-1)^{-x} = \cos (\pi x), \quad \Im (-1)^x = -\sin (\pi x)$, which explains the shape of the curves in your plot.

(I have used Euler's formula $\Bbb e ^{\Bbb i x} = \cos x + \Bbb i \sin x$ and the fact that $\cos (-x) = \cos x$ and $\sin (-x) = \sin x$.)

$(-1)^x=e^{x\cdot\ln(-1)}$. There is no unique value of $\ln(-1)$, however if we chose the principal value of the logarithm, $\ln(-1)=i\pi$, yielding $(-1)^x=e^{ix\pi}=\cos(\pi x)+i\sin(\pi x)$. Weird results such as $1^x=e^{2i\pi x}$ are obtained by taking $\ln(1)=2i\pi$, which lies on another branch. It is a matter of convention which branch we chose.

• you also see why the imaginary part is zero at every integer – Noe Blassel Jun 14 '16 at 14:01
• This answer falls in the same trap in which most beginner answering this question falls: by the same argument, one could "prove" the nonsensical formula $1^x = (\Bbb e ^{2 \pi i})^x = \Bbb e ^{2 \pi i x} = \cos (2\pi x) + \Bbb i \sin (2\pi x)$, which is obviously not true. The reason is that, for arbitrary complex numbers, it is no longer true that $(a^b)^x = a^{bx}$. I would delete this answer, even though it brought you points (but what pride is in getting votes from people who do not know the craft?). – Alex M. Jun 14 '16 at 14:14
• @Alex M. I edited my answer to reflect the problem you pointed out. – Noe Blassel Jun 14 '16 at 14:26
• You should remove the $\Bbb i$ from inside the trigonometric functions. – Alex M. Jun 14 '16 at 14:31