Why $\sin(n\pi) = 0$ and $\cos(n\pi)=(-1)^n$?

I am working out a Fourier Series problem and I saw that the suggested solution used
$\sin(n\pi) = 0$ and $\cos(n\pi)=(-1)^n$ to simply the expressions while finding the Fourier Coefficients $a_0$, $a_n$, $b_n$.

enter image description here

I am aware that the $\sin(x)$ has a period of $2\pi$. So I am thinking that every half of period, the graph of $\sin(x)$ has to cut through the $x$ axis thus giving us the value $0$. Am I right to think that way or is there some more important reason for that?

Also, how do they come up with $\cos(n\pi) = (-1)^n$?


Solution 1:

Recall that Euler's formula is $e^{ix}=\cos x+i\sin x$. When $x=\pi$, we have $e^{i\pi}=\cos\pi+i\sin\pi=-1\implies e^{i\pi}+1=0$.

From $e^{i\pi}+1=0\implies e^{i\pi}=-1\implies (e^{i\pi})^n=(-1)^n$. From $e^{ix}=\cos x+i\sin x$, when $x=n\pi$, $e^{in\pi}=\cos {n\pi}+i\sin {n\pi}=(-1)^n$.

This implies that $\cos {n\pi}=(-1)^n$ and $\sin {n\pi}=0$, for all $n\in \mathbb Z$.

Solution 2:

As you can see from the plot you included $\sin(n\pi) = 0$ for any integer $n$.

Also, $\cos(0) = 1$, $\cos(\pi) = -1$, $\cos(2\pi) = 1$, etc. So $\cos(n\pi) = 1$ for $n$ even and $\cos(n\pi) = -1$ for $n$ odd, which is also true for $(-1)^n$.

Solution 3:

For the sine case:

$n = \cdots -1, 0, 1, 2, 3, \cdots$

Gives us

$\cdots \sin(-\pi), \sin(0), \sin(\pi), \sin(2\pi), \sin(3\pi),\cdots$ Which is exactly where the sine function has its roots, so it is always equal to $0$.

For the cosine case, use the identity $\cos(x) = \cos(x + 2\pi) $ (period of the cosine function is $2\pi$) and plug $\cos(0)$ and $\cos(\pi)$ to verify this.

Solution 4:

The picture burned into my visual cortex is the unit circle, not the graphs of sine and cosine:

The sine and cosine of zero and pi

This together with $2\pi$-periodicity (which is geometrically obvious) immediately gives $$ \sin(n\pi) = 0,\quad \cos(n\pi) = (-1)^{n} $$ for all integers $n$.