# Integrals of products of sines and cosines with arbitrary periods

I am currently studying the Fourier series, which involves integrals of products of sine and cosine functions. Because sine and cosine are orthogonal, we have been using the following facts to help us find the Fourier series of various functions.

$$\int_{-\pi}^{\pi}\cos(mx)\cos(nx)dx = \cases{\pi & , m = n \\ 0 & , m \neq n} \\ \int_{-\pi}^{\pi}\sin(mx)\sin(nx)dx = \cases{\pi & , m = n \\ 0 & , m \neq n} \\ \int_{-\pi}^{\pi}\cos(mx)\sin(nx)dx = 0, \text{for all } m, n$$

It seems like there's a more general version of these facts, for sines and cosines with periods other than $$2\pi$$; e.g. the function $$\sin(mx)$$ with period $$2\pi/m$$.

But, I can't seem to find these more general versions anywhere. Could someone please state them here?

Here is an example that seems to come from the more general version of these facts:

$$\int_{0}^{3}\sin(\pi x)\sin(\pi x)dx = 3/2$$

• By the way, you can use the Kronecker delta to write the first two integrals as $\pi\delta_{mn}$. – J.G. Apr 22 '19 at 21:02
• What you're asking is unclear. Are you trying to find a general formula for $$\int_{a}^{b}\sin(px)\sin(qx)dx$$? – clathratus Apr 22 '19 at 21:19
• @clathratus Yes, that's basically what I'm looking for. The particular problem that I'm trying to solve says $\int_{0}^{3} \sin(\pi x) \sin(\frac{\pi n x}{3}) dx = 3/2$ for some values of $n$, and I'm wondering if the reason for that is related to these three facts about the integrals of products of sines and cosines. – on-pasta Apr 22 '19 at 21:26

I am interpreting your question as you are trying to find which $$n$$ satisfy $$\int_0^3\sin(\pi x)\sin(n\pi x/3)dx=3/2$$ to do so, we preform the sub. $$\pi x/3=u\Rightarrow dx=\frac3\pi du$$: $$\frac3\pi\int_0^\pi\sin(3u)\sin(nu)du=\frac32$$ So we are now trying to solve $$\int_0^\pi\sin(3x)\sin(nx)dx=\frac\pi2$$ since $$\sin(3x)\sin(nx)$$ is symmetric about the $$y$$-axis, we have that $$\int_0^\pi\sin(3x)\sin(nx)dx=\frac12\int_{-\pi}^{\pi}\sin(3x)\sin(nx)dx$$ so we have to solve $$\int_{-\pi}^{\pi}\sin(3x)\sin(nx)dx=\pi$$ So from the second formula you listed, $$n=3$$ If there's anything I can do to improve my answer, please tell me.

I think this is what I was looking for:

$$\int_{0}^{L} \sin(\frac{\pi x}{L} m) \sin(\frac{\pi x}{L} n) dx = \cases{L/2 & , m = n \\ 0 & , m \neq n}$$

which came from this video.

• You would derive that by using $\pi x/L=u$ and the symmetry of $\sin(mx)\sin(nx)$ about the $y$-axis. – clathratus Apr 22 '19 at 21:44
• @clathratus Thank you! Do you know if a very similar thing holds for cosines? E.g. $\int_{0}^{L} \cos(\frac{\pi x}{L} m) \cos(\frac{\pi x}{L} n) dx = \cases{L/2 & , m = n \\ 0 & ,$m \neq n$}$ – on-pasta Apr 22 '19 at 21:47
• Yes. Use the sub $\pi x/L=u$ to get $$\frac{L}\pi\int_0^\pi\cos(mu)\cos(nu)du$$ Then use $$\cos(mu)\cos(nu)=\cos(-mu)\cos(-nu)$$ to get $$\frac{L}{2\pi}\int_{-\pi}^{\pi}\cos(mu)\cos(nu)du$$ which is $L/2$ for $m=n$ and $0$ otherwise. – clathratus Apr 22 '19 at 21:53
• @clathratus Very helpful -- thank you! – on-pasta Apr 22 '19 at 21:54
• You are very welcome :) – clathratus Apr 22 '19 at 21:54