# Why must the angle contain $\pi$ for $\cos$ be periodic?

The $\cos(\frac{n}{6})$ is aperiodic, and $\cos(\frac{n\pi}{6})$ is periodic, why? What role does the $\pi$ play? By the way, $n$ must be integer

I have seen this question,Why is cos(n/6) aperiodic? but the answer just show that it is not of the form $2\pi(mN)$,but it did't explain why should that $\pi$ exist,and the comment below said that we can't find the next larger (integer) value of n such that $\cos(\frac{n}{6})=1$ after $n=0$, however, yes we can, the $n=360 \times 6$ can let $\cos$ value back to the $0$ again. So, I want to ask why must the $\pi$ exist to let $\cos$ be a periodic?

• The argument of the cosine function is in radians, not in degrees, so you have $\cos(2\pi k)=1$ for integer $k$ ($2\pi$ corresponds to $360$ degrees). The rest follows. Sep 16 '18 at 11:25
• The truth is, any base could be used for either the trig functions or exponents. The "natural" bases are Radians for the Trig functions and "e" for exponents. See dsprelated.com/showarticle/754.php for the best explanation ever why this is so. Well, I think it's the best. Mar 14 '19 at 19:31

## 3 Answers

I will reuse a former answer of mine too: Proof of complex conjugate symmetry property of DFT. It relates to how sines and cosines can be defined. One answer is: from the exponential, and thus derives $$\pi$$. There exist other constructions, this one is (imho) elegant.

The periodicity of the cosine comes from the fact it is defined as the real part of the cisoid, or complex exponential, $$e^{ix}$$. In W. Rudin's Real and Complex analysis (very first pages, 1 to 3 of the prologue), $$e$$ comes first, and $$\pi$$ appears subsequently.

One first defines for any complex $$z$$:

$$e^z=\sum_{n=0}^{+\infty} \frac{z^n}{n!}$$

which is an absolutely convergent series. It is its own derivative. And then you get some other results, like $$e^z$$ is never equal to zero. But the two most striking ones are:

There exists a positive number $$\pi$$ such that $$e^{\pi j/2} = j$$ and such that $$e^z = 1$$ if and only if $$z/(2\pi j )$$ is an integer.

$$e^z$$ is $$2\pi j$$ periodic.

From this, you define the sine and the cosine as the imaginary and real parts. The proof is quite interesting. It for instance remarks that $$\cos 2 <0$$, and since $$\cos 0 =1$$, by continuity, there should exists a constant at which the cosine vanishes:

This should answer to Why does $$\pi$$ exist, with its role unveiled, and why the cosine is periodic.

The answer to the "next integer" is given by Matt's comment.

The confusion comes from the missing details that authors usually skip or falsely assumed about the mathematical background of their students.

Let us see why the first signal is aperiodic whereas the second one is periodic. The periodicity of a signal holds if we can show $$x(n)=x(n+N)$$, otherwise, the signal is nonperiodic. Let's see that by starting with \begin{align} x(n+N) &= \cos( \frac{n}{6} + \frac{N}{6}) \\ &= \cos(\frac{n}{6})\cos(\frac{N}{6}) - \sin(\frac{n}{6})\sin(\frac{N}{6}) \end{align} In order for $$x(n)=x(n+N)$$ to hold, $$\cos(\frac{N}{6})=1$$ and $$\sin(\frac{N}{6})=0$$. We search for the smallest value of $$N$$. This is true if $$\frac{N}{6}=2\pi \implies N = 12\pi$$. Indeed, if $$N=12\pi$$, we get \begin{align} x(n+N) &= \cos( \frac{n}{6} + \frac{N}{6}) \\ &= \cos(\frac{n}{6})(1) - \sin(\frac{n}{6})(0) \\ &= \cos(\frac{n}{6}) \\ &= x(n) \end{align} But $$N$$ must be a positive integer, therefore, the signal is nonperiodic. In other words, there is no such a positive integer so that $$x(n)=x(n+N)$$. Now let's prove the periodicity of the second signal. Simply start with \begin{align} x(n+N) &= \cos( \frac{\pi n}{6} + \frac{\pi N}{6}) \\ &= \cos(\frac{\pi n}{6})\cos(\frac{\pi N}{6}) - \sin(\frac{\pi n}{6})\sin(\frac{\pi N}{6}) \end{align} In order for $$x(n)=x(n+N)$$ to hold, $$\cos(\frac{\pi N}{6})=1$$ and $$\sin(\frac{\pi N}{6})=0$$. We search for the smallest value of $$N$$. This is true if $$\frac{\pi N}{6}=2\pi \implies N = 12$$. Indeed, if $$N=12$$, we get \begin{align} x(n+N) &= \cos( \frac{\pi n}{6} + \frac{\pi N}{6}) \\ &= \cos(\frac{\pi n}{6})\cos(\frac{\pi N}{6}) - \sin(\frac{\pi n}{6})\sin(\frac{\pi N}{6}) \\ &= \cos(\frac{\pi n}{6})(1) - \sin(\frac{\pi n}{6})(0) \\ &= \cos(\frac{\pi n}{6}) \\ &= x(n) \tag{1} \end{align} Eq.(1) proves the periodicity of $$\cos(\frac{\pi n}{6})$$.

As you can see, using trigonometric identities allow us to see clearly why the signal is periodic. It has nothing to do with $$\pi$$ rather we could find the smallest value of $$N$$ that allows us to reach $$x(n)$$ from $$x(n+N)$$. Again, these kinds of details are crucial but authors tend to ignore them.

Cuz today is Pi Day. Happy Pi Day everyone!

Seriously though, to answer this belated question in somewhat more of a simple intuitive way.

The period of the trig functions is $$2\pi$$. In order for a trig signal to be periodic (hitting the same domain values, repeatedly), it's RadiansPerSample factor has to be a rational (as in not irrational) factor of $$2\pi$$. Since $$\pi$$ is quite irrational, this means the argument has to be $$r \pi$$ where $$r$$ is a rational number (ratio of integers, say $$a/b$$).

$$\frac{1}{6}$$ is not a rational multiple of $$\pi$$, but $$\frac{\pi}{6}$$ is.

Nuttin' to it.

• Good to revive the $\pi$ day. $\pi$ is quite irrational as you say. Not always though, like in a $\pi$-based number system math.stackexchange.com/q/1320248/257503 Mar 14 '19 at 18:34
• @LaurentDuval, The choice of defining $\pi$ as the ratio of the circumference to the diameter was, in hindsight, an irrational choice (couldn't help myself with the pun). The natural choice would have been the ratio of the circumference to the radius. Therefore we should celebrate $2\pi$ day as the whole pie and eat two pies, umm, wait a minute..... Something like that. But this is why almost every physics formula that includes $\pi$ actually has a $2\pi$ term. And I'd have to change my license plate from "E I2PI", which nobody gets. ;-) I didn't even say Transcendental, till now. Mar 14 '19 at 19:03
• Did you really got that license plate? When I though I could be proud of my room number in Kyoto 3 hours and 14 days ago twitter.com/laurentduval/status/1106283337382088704 Mar 14 '19 at 20:12
• @LaurentDuval,Yes, for seven or eight years now. You should have seen the lady's face at the Secretary of State's office when I said "Awesome, nobody else has it yet?" Mar 15 '19 at 12:56