Skip to content

Orthogonality of sines and cosines

5 min read

Short answer

Over [−π,π][-\pi,\pi]: ∫sin⁡mxsin⁡nx dx=π δmn\int\sin mx\sin nx\,dx=\pi\,\delta_{mn}, ∫cos⁡mxcos⁡nx dx=π δmn\int\cos mx\cos nx\,dx=\pi\,\delta_{mn} (for m,n≥1m,n\ge1) and ∫sin⁡mxcos⁡nx dx=0\int\sin mx\cos nx\,dx=0 always. Different frequencies are orthogonal under the inner product ⟨f,g⟩=∫fg\langle f,g\rangle=\int fg, which is what makes the Fourier coefficient formulas work.

∫₋π^π sin(mx) sin(nx) dx = π if m = n, else 0∫₋π^π sin(mx) sin(nx) dx = π if m = n, else 0sin · sin π when m = n, otherwise 0cos · cos π when m = n ≥ 1, otherwise 0sin · cos always 0Consequence coefficients found one at a time
The functions are like perpendicular axes in an infinite-dimensional space.

Proof for the sine case

Use sin⁡mxsin⁡nx=12[cos⁡(m−n)x−cos⁡(m+n)x]\sin mx\sin nx=\tfrac12\big[\cos(m-n)x-\cos(m+n)x\big]. For m≠nm\ne n both cosines integrate to 00 over a full period. For m=nm=n, the first becomes 12⋅1\tfrac12\cdot1, integrating to π\pi over 2π2\pi.

Why it matters

In a vector space with an orthogonal basis {en}\{e_n\}, the coefficient of ene_n in vv is ⟨v,en⟩⟨en,en⟩\dfrac{\langle v,e_n\rangle}{\langle e_n,e_n\rangle}. Sines and cosines form such a basis for periodic functions, and the formulas an,bna_n,b_n are exactly this projection.

Worked example

Compute ∫−ππsin⁡xsin⁡2x dx\int_{-\pi}^{\pi}\sin x\sin2x\,dx and ∫−ππsin⁡2x dx\int_{-\pi}^{\pi}\sin^2x\,dx.

The first has m≠nm\ne n, so it is 00. The second has m=n=1m=n=1, so it equals π\pi (indeed sin⁡2x=12(1−cos⁡2x)\sin^2x=\tfrac12(1-\cos2x) integrates to 12⋅2π\tfrac12\cdot2\pi).

Try it yourself

Compute ∫−ππcos⁡3xcos⁡5x dx\int_{-\pi}^{\pi}\cos3x\cos5x\,dx.

Show the answer

m≠nm\ne n, so it equals 00.

Keep going with practice

Vidi's dot-product lessons are the finite-dimensional version of this same orthogonality idea.