Unit content
Trigonometric Fourier series and orthogonal coefficient projection
A periodic or interval-defined function can often be represented as a sum of sine and cosine modes. The coefficients are not guessed: they are obtained by exploiting the orthogonality of the trigonometric functions.
Consider a sufficiently well-behaved real function $f(\theta)$ on
$$0\le\theta\le2\pi.$$
A trigonometric Fourier series has the form
$$\boxed{ f(\theta) =\frac{a_0}{2} +\sum_{n=1}^{\infty} \left[a_n\cos(n\theta)+b_n\sin(n\theta)\right] }.$$
The same mathematics can represent a periodic waveform, a spatial boundary shape, or any other function for which such an expansion is appropriate. No interpretation in terms of time or frequency is required.
Orthogonality
Over a complete $2\pi$ interval,
$$\int_0^{2\pi}\cos(m\theta)\cos(n\theta),d\theta =0\qquad(m\ne n),$$
$$\int_0^{2\pi}\sin(m\theta)\sin(n\theta),d\theta =0\qquad(m\ne n),$$
and
$$\int_0^{2\pi}\sin(m\theta)\cos(n\theta),d\theta=0.$$
For positive integers $n$,
$$\int_0^{2\pi}\cos^2(n\theta),d\theta=\pi,$$
$$\int_0^{2\pi}\sin^2(n\theta),d\theta=\pi.$$
The constant mode has
$$\int_0^{2\pi}1,d\theta=2\pi.$$
These relations say that different sine and cosine modes do not contribute to one another when projected over the full interval.
Deriving a cosine coefficient
Multiply the Fourier expansion by $\cos(m\theta)$ and integrate from $0$ to $2\pi$.
Every term vanishes by orthogonality except the $m$th cosine mode:
$$\int_0^{2\pi}f(\theta)\cos(m\theta),d\theta =a_m\int_0^{2\pi}\cos^2(m\theta),d\theta.$$
Therefore
$$\boxed{ a_m=\frac1\pi \int_0^{2\pi}f(\theta)\cos(m\theta),d\theta }.$$
Likewise,
$$\boxed{ b_m=\frac1\pi \int_0^{2\pi}f(\theta)\sin(m\theta),d\theta }.$$
The constant coefficient is
$$\boxed{ a_0=\frac1\pi\int_0^{2\pi}f(\theta),d\theta }.$$
Fourier coefficients are therefore projections of the function onto orthogonal basis functions.
Half-range trigonometric expansions
Many problems naturally use
$$0\le\theta\le\pi.$$
On this interval,
$$\int_0^\pi\cos(m\theta)\cos(n\theta),d\theta=0 \qquad(m\ne n),$$
and for $n\ge1$,
$$\int_0^\pi\cos^2(n\theta),d\theta=\frac\pi2.$$
Thus an expansion
$$f(\theta)=A_0+\sum_{n=1}^{\infty}A_n\cos(n\theta)$$
has coefficients
$$\boxed{A_0=\frac1\pi\int_0^\pi f(\theta),d\theta},$$
$$\boxed{A_n=\frac2\pi\int_0^\pi f(\theta)\cos(n\theta),d\theta \qquad(n\ge1)}.$$
A corresponding sine expansion uses the same $2/\pi$ normalization for positive modes.
Half-range forms are especially useful when a geometry or boundary condition is naturally parameterized over only half a period.
Worked example
Let
$$f(\theta)=1+3\cos\theta-2\sin(2\theta).$$
Its Fourier coefficients can be recovered by projection.
For the first cosine coefficient,
$$a_1=\frac1\pi\int_0^{2\pi} \left(1+3\cos\theta-2\sin2\theta\right)\cos\theta,d\theta.$$
Orthogonality eliminates the constant-cosine and sine-cosine terms, leaving
$$a_1=\frac1\pi(3)\int_0^{2\pi}\cos^2\theta,d\theta =\frac1\pi(3)(\pi)=\boxed{3}.$$
Similarly,
$$b_2=\frac1\pi\int_0^{2\pi}f(\theta)\sin2\theta,d\theta =\boxed{-2}.$$
All other nonconstant sine/cosine coefficients vanish, and
$$a_0=2.$$
The projection method therefore recovers exactly the original expansion.
Finite approximations and convergence
A truncated Fourier series
$$f_N(\theta)=\frac{a_0}{2} +\sum_{n=1}^{N} \left[a_n\cos(n\theta)+b_n\sin(n\theta)\right]$$
approximates the function using finitely many modes. Increasing $N$ can resolve progressively finer variation.
Convergence depends on the regularity of the function. Smooth functions are generally represented efficiently, while discontinuities produce slower convergence and oscillatory behavior near the jump.
The core reusable idea is independent of the application: orthogonal modes let a function be decomposed into coefficients that can be found one at a time by integration.