So here is the definite integral:
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,
If , then
So, the integral vanishes unless or .
If n = 2k, then
Since the integral vanishes when n is odd, we can rewrite it as the following,
For example, when n = 1011, then