Integrating the 2022nd power of cosine x from 0 to 2Pi

Posted: May 16, 2022 in Mathematics
Tags: ,

So here is the definite integral:

\displaystyle \int_0^{2\pi} \cos^{2022}{x} \text{ d}x

And here is the solution:

The trick here is to use Euler’s formula and the rest is kinda straight forward.

In general, for any natural number n, we have the following,

\displaystyle \int_0^{2\pi} \cos^n{x} \text{ d}x = \int_0^{2\pi} \left(\frac{e^{ix}+e^{-ix}}{2}\right)^n \text{d}x = \frac{1}{2^n}\int_0^{2\pi} \sum_{k=0}^n \binom{n}{k} e^{i(n-k)x}e^{-ikx} \text{ d}x

\displaystyle = \frac{1}{2^n} \sum_{k=0}^n \binom{n}{k} \int_0^{2\pi} e^{i(n-2k)x} \text{ d}x

If n-2k\neq0, then

\displaystyle \int_0^{2\pi} e^{i(n-2k)x}\text{ d}x = \frac{e^{i(n-2k)x}}{i(n-2k)} \bigg|_0^{2\pi} = 0

So, the integral vanishes unless n-2k=0 or n=2k.

If n = 2k, then

\displaystyle \frac{1}{2^n}\sum_{k=0}^n\binom{n}{k}\int_0^{2\pi}e^{i(n-2k)x}\text{ d}x = \frac{1}{2^n}\binom{n}{n/2}2\pi = \frac{\pi}{2^{n-1}}\binom{n}{n/2}

Since the integral vanishes when n is odd, we can rewrite it as the following,

\displaystyle \int_0^{2\pi} \cos^{2n}{x}\text{ d}x = \frac{\pi}{2^{2n-1}}\binom{2n}{n}, \quad\text{for }n\in\mathbb{N}

For example, when n = 1011, then

\displaystyle \int_0^{2\pi} \cos^{2022}{x}\text{ d}x = \frac{\pi}{2^{2021}}\binom{2022}{1011}

Leave a comment