Why is$\int_{-\pi }^{\pi }(\sin nx)^2dx=\int_{-\pi}^{\pi}(\cos nx)^2dx=\pi$?

HINT:

As $\cos2A=2\cos^2A-1=1-2\sin^2A$

express $(\sin nx)^2,(\cos nx)^2$ in terms of $\cos(2nx)$

Now $\int\cos(mx)dx=\dfrac{\sin mx}m+K$

also $\sin(r\pi)=0$ for any integer $r$


First note that $\sin^2(nx) + \cos^2(nx) = 1$ for all $x$. Thus $$\int_{-\pi}^\pi (\sin^2(nx) + \cos^2(nx)) dx = 2\pi.$$

Now we wish to show that each integral contributed the same amount to this. At the moment we know that the average of the two integrals is $\pi$.

It is important to remember that $\cos$ and $\sin$ are simply shifted copies of one another. Moreover, the period of $\sin(nx)$ is the same as that of $\cos(nx)$, and the period is $2\pi/n$. Since $n$ is an integer, each of $\sin^2(nx)$ and $\cos^2(nx)$ go through $n$ complete periods for $\sin(nx)$ and $\cos(nx)$ over the interval $[-\pi,\pi]$. Thus, $$\int_{-\pi}^\pi \sin^2(nx) dx = \int_{-\pi}^\pi \cos^2(nx) dx$$ and they are both equal to $\pi$ by this first equation.


Note that we can write

$$\sin^2(nx)=\frac 12 -\frac 12 \cos(2nx)\\\\ $$

and

$$\cos^2(nx)=\frac12 +\frac12 \cos(2nx)$$

In addition, for $n\ge 1$,

$$\int_{-\pi}^{\pi}\cos(2nx)\,dx=0$$

Thus, we see immediately that

$$\int_{-\pi}^{\pi}\sin^2(nx)\,dx =\int_{-\pi}^{\pi}\cos^2(nx)\,dx=\pi$$

Tags:

Calculus