Orthogonality and Bessel's Inequality

Why should decomposing a periodic function into sines and cosines produce a Pythagorean theorem? The answer lies in structure. The trigonometric system is not just a convenient collection of functions. It is an orthogonal system in a vector space equipped with an inner product. Fourier coefficients are nothing but coordinates in that geometry. Once this is seen clearly, deep facts about Fourier series change character. They stop looking like calculus tricks. Instead they start looking like linear algebra: projections, best approximation, and a Pythagorean identity that bounds coefficient size. This article develops that geometric viewpoint rigorously. We define the inner product structure on square-integrable functions on a circle. We prove that the trigonometric system is orthogonal. We show that the NN-th partial sum of the Fourier series is the unique best approximation to ff. This holds among trigonometric polynomials of degree ≤N\le N, in the least-squares sense. From this optimality falls out Bessel's inequality. This is a bound controlling the size of Fourier coefficients. It holds for every function with finite energy. No continuity, no differentiability, no convergence assumption on the series itself is needed. As a corollary we obtain the Riemann–Lebesgue lemma: Fourier coefficients of an integrable function tend to zero. The big picture is that Fourier analysis is secretly a chapter of Hilbert space theory. It sits inside real analysis. The inner product ⟨f,g⟩=∫fgˉ\langle f, g\rangle = \int f\bar g turns the space of square-integrable functions into something new. It becomes an infinite-dimensional analogue of Euclidean space. The orthonormal trigonometric functions play the role of coordinate axes. Bessel's inequality is the statement that "the sum of squared coordinates cannot exceed the squared length of the vector." This is literally the Pythagorean theorem, run in infinitely many dimensions. It is proved with nothing more than integration and algebra. By the end of this article you will have several things. You will have a complete, self-contained proof that trigonometric partial sums minimize mean-square error. You will have a full derivation and proof of Bessel's inequality. Sharp attention is paid to what is and is not assumed about ff. You will have a proof of the Riemann–Lebesgue lemma as a clean corollary. You will also have worked examples computing genuine (asymmetric) Fourier coefficients. These examples check Bessel's inequality numerically. This sets the stage for a deeper question. When does the Fourier series actually converge back to ff? That question is treated in Convergence of Fourier Series.

Key takeaways
  • The trigonometric functions {1,cos⁡nx,sin⁡nx}\{1, \cos nx, \sin nx\} form an orthogonal system on [−π,π][-\pi,\pi] under the inner product ⟨f,g⟩=∫−ππfgˉ\langle f,g\rangle = \int_{-\pi}^\pi f\bar g.
  • Fourier coefficients an,bna_n, b_n are exactly the coordinates of ff in this orthogonal basis, obtained by projection.
  • The Fourier partial sum SNfS_N f is the unique trigonometric polynomial of degree ≤N\le N minimizing ∥f−T∥2\|f - T\|_2 over all such TT.
  • Bessel's inequality says a022+∑n=1N(an2+bn2)≤1π∫−ππf(x)2 dx\displaystyle \frac{a_0^2}{2} + \sum_{n=1}^N (a_n^2+b_n^2) \le \frac{1}{\pi}\int_{-\pi}^\pi f(x)^2\,dx for every NN, with no convergence assumed.
  • Letting N→∞N \to \infty gives convergence of ∑(an2+bn2)\sum (a_n^2+b_n^2), and forces an,bn→0a_n, b_n \to 0 — the Riemann–Lebesgue lemma.
  • Key idea: Fourier analysis is Euclidean geometry — orthogonal projection, Pythagoras, and best approximation — carried out in an infinite-dimensional space of functions.

Where this lives today

The projection/optimality argument underlying Bessel's inequality is the prototype for Hilbert space theory in functional analysis: the same three-line completed-square proof, verbatim, establishes that orthogonal projection onto any closed subspace of an inner product space minimizes distance, with Bessel's inequality as the general statement that ∑∣⟨f,en⟩∣2≤∥f∥2\sum |\langle f,e_n\rangle|^2 \le \|f\|^2 for any orthonormal system {en}\{e_n\}, trigonometric or not (e.g. Legendre polynomials, Hermite functions, wavelets). In signal processing and engineering, this is exactly the statement that a signal's "energy" bounds the total power captured by any finite set of orthogonal frequency channels, underlying spectral analysis, the design of orthogonal transforms (DCT/DFT used in JPEG and MP3 compression), and the theory of orthogonal filter banks. In quantum mechanics, Bessel's inequality (and its equality form, Parseval/Plancherel) governs expansions of a wavefunction in an orthonormal basis of eigenstates, guaranteeing that probabilities computed from projection coefficients never exceed total probability 11 after normalization. In statistics, the same least-squares argument is literally the derivation of ordinary least-squares regression: fitting a linear model by minimizing squared error is orthogonal projection onto the column space of the design matrix, and the "residual sum of squares decomposition" is Pythagoras in disguise. In numerical analysis and approximation theory, Bessel's inequality certifies a priori that truncated orthogonal expansions (Chebyshev, Legendre, spherical harmonics) cannot have unbounded coefficient growth, which underlies convergence and stability estimates for spectral methods used in solving partial differential equations. Finally, the Riemann–Lebesgue lemma derived here is a basic tool in the study of oscillatory integrals throughout harmonic analysis and PDE theory, and is the first ingredient needed to attack the pointwise convergence questions taken up next in Convergence of Fourier Series.

Ask the tutor: How does Bessel's inequality change if we use complex exponentials einxe^{inx} instead of cos⁡nx,sin⁡nx\cos nx,\sin nx, and why does the complex form make Parseval's identity look even cleaner?

DefinitionOrthogonal systems, inner product, Fourier coefficients

Let f,g:[−π,π]→Rf, g : [-\pi,\pi] \to \mathbb{R} be Riemann integrable. Define the inner product

⟨f,g⟩  =  ∫−ππf(x) g(x) dx,\langle f, g \rangle \;=\; \int_{-\pi}^{\pi} f(x)\,g(x)\,dx,

and the associated seminorm ∥f∥2=⟨f,f⟩1/2=(∫−ππf(x)2 dx)1/2\|f\|_2 = \langle f,f\rangle^{1/2} = \left(\int_{-\pi}^\pi f(x)^2\,dx\right)^{1/2}. A sequence of Riemann integrable functions {φn}n≥0\{\varphi_n\}_{n \ge 0} on [−π,π][-\pi,\pi] is called an orthogonal system if

⟨φm,φn⟩=0for all m≠n,\langle \varphi_m, \varphi_n \rangle = 0 \quad \text{for all } m \ne n,

and each ∥φn∥2>0\|\varphi_n\|_2 > 0. It is orthonormal if in addition ∥φn∥2=1\|\varphi_n\|_2 = 1 for all nn. The trigonometric system on [−π,π][-\pi,\pi] is the family

1,cos⁡x, sin⁡x,cos⁡2x, sin⁡2x,cos⁡3x, sin⁡3x, …1,\quad \cos x,\ \sin x,\quad \cos 2x,\ \sin 2x,\quad \cos 3x,\ \sin 3x,\ \dots

For ff Riemann integrable on [−π,π][-\pi,\pi], the Fourier coefficients of ff are

an=1π∫−ππf(x)cos⁡nx dx(n≥0),bn=1π∫−ππf(x)sin⁡nx dx(n≥1),a_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos nx\,dx \quad (n \ge 0), \qquad b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin nx\,dx \quad (n \ge 1),

and the NN-th Fourier partial sum is the trigonometric polynomial

SNf(x)  =  a02+∑n=1N(ancos⁡nx+bnsin⁡nx).S_N f(x) \;=\; \frac{a_0}{2} + \sum_{n=1}^{N} \big(a_n \cos nx + b_n \sin nx\big).

Intuition

Think of Riemann integrable functions on [−π,π][-\pi,\pi] as vectors, with ⟨f,g⟩=∫fg\langle f,g\rangle = \int f g playing the role of the dot product. Two functions are "perpendicular" exactly when this integral vanishes — and remarkably, cos⁡mx\cos mx and sin⁡nx\sin nx are perpendicular to each other, and to all other trigonometric functions of different frequency, for a completely elementary reason: products of sines and cosines at different integer frequencies oscillate and their oscillations cancel exactly over a full period. This is the same phenomenon as an orthogonal basis e1,e2,e3e_1, e_2, e_3 in R3\mathbb{R}^3: to find the coordinate of a vector vv along e1e_1, you don't solve a system of equations, you just take the dot product ⟨v,e1⟩/∥e1∥2\langle v, e_1\rangle / \|e_1\|^2. Fourier coefficients are exactly this projection formula applied to the "axes" cos⁡nx,sin⁡nx\cos nx, \sin nx. Once you see an,bna_n, b_n as coordinates, the partial sum SNfS_N f is recognizable as the orthogonal projection of ff onto the finite-dimensional subspace spanned by frequencies 00 through NN — and orthogonal projections are always the closest point in the subspace, which is precisely the least-squares optimality theorem below. Bessel's inequality is then just Pythagoras: the squared length of ff is at least the sum of the squared lengths of its projections onto mutually perpendicular axes.

Figure
Orthogonal projection picture: ff decomposed onto the subspace spanned by low frequencies, with orthogonal remainder
span(cos nx, sin nx) ⊥ remainder f S_N f f − S_N f ‖f‖² = ‖S_N f‖² + ‖f − S_N f‖² ≥ ‖S_N f‖²

Central results

LemmaOrthogonality relations for the trigonometric system

For all integers m,n≥0m, n \ge 0,

∫−ππcos⁡mxcos⁡nx dx={0m≠n2πm=n=0πm=n≥1∫−ππsin⁡mxsin⁡nx dx={0m≠n or m=n=0πm=n≥1\int_{-\pi}^{\pi} \cos mx \cos nx\, dx = \begin{cases} 0 & m \ne n \\ 2\pi & m = n = 0 \\ \pi & m = n \ge 1 \end{cases} \qquad \int_{-\pi}^{\pi} \sin mx \sin nx\, dx = \begin{cases} 0 & m \ne n \text{ or } m=n=0\\ \pi & m = n \ge 1 \end{cases}
∫−ππcos⁡mxsin⁡nx dx=0for all m,n≥0.\int_{-\pi}^{\pi} \cos mx \sin nx \,dx = 0 \quad \text{for all } m, n \ge 0.
Proof

Technique: product-to-sum identities and direct antiderivatives. Recall the elementary identities, valid for all real α,β\alpha,\beta:

cos⁡αcos⁡β=12[cos⁡(α−β)+cos⁡(α+β)],sin⁡αsin⁡β=12[cos⁡(α−β)−cos⁡(α+β)],\cos\alpha\cos\beta = \tfrac12\big[\cos(\alpha-\beta) + \cos(\alpha+\beta)\big], \qquad \sin\alpha\sin\beta = \tfrac12\big[\cos(\alpha-\beta) - \cos(\alpha+\beta)\big],
cos⁡αsin⁡β=12[sin⁡(α+β)−sin⁡(α−β)].\cos\alpha\sin\beta = \tfrac12\big[\sin(\alpha+\beta) - \sin(\alpha-\beta)\big].

These follow from the addition formulas cos⁡(α±β)=cos⁡αcos⁡β∓sin⁡αsin⁡β\cos(\alpha\pm\beta) = \cos\alpha\cos\beta \mp \sin\alpha\sin\beta and sin⁡(α±β)=sin⁡αcos⁡β±cos⁡αsin⁡β\sin(\alpha\pm\beta) = \sin\alpha\cos\beta \pm \cos\alpha\sin\beta, added or subtracted appropriately.

Case cos⁡mxcos⁡nx\cos mx\cos nx, m≠nm\ne n. Applying the identity with α=mx,β=nx\alpha = mx,\beta = nx,

∫−ππcos⁡mxcos⁡nx dx=12∫−ππcos⁡((m−n)x) dx+12∫−ππcos⁡((m+n)x) dx.\int_{-\pi}^\pi \cos mx\cos nx\,dx = \frac12\int_{-\pi}^\pi \cos((m-n)x)\,dx + \frac12\int_{-\pi}^\pi \cos((m+n)x)\,dx.

For any nonzero integer kk, ∫−ππcos⁡(kx) dx=[sin⁡kxk]−ππ=sin⁡(kπ)−sin⁡(−kπ)k=0\int_{-\pi}^\pi \cos(kx)\,dx = \left[\frac{\sin kx}{k}\right]_{-\pi}^\pi = \frac{\sin(k\pi) - \sin(-k\pi)}{k} = 0, since sin⁡(kπ)=0\sin(k\pi)=0 for integer kk. Here m−n≠0m - n \ne 0 by assumption and m+nm+n: if m+n=0m+n=0 then m=n=0m=n=0, excluded since m≠nm \ne n; so both integrals vanish, giving total 00.

Case m=n≥1m=n\ge 1. Then m−n=0m - n = 0 contributes ∫−ππ1 dx=2π\int_{-\pi}^\pi 1\,dx = 2\pi, and m+n=2n≠0m+n = 2n \ne 0 contributes 00 as above. Total: 12(2π)+0=π\frac12(2\pi) + 0 = \pi.

Case m=n=0m=n=0. Directly ∫−ππ1⋅1 dx=2π\int_{-\pi}^\pi 1 \cdot 1\,dx = 2\pi.

Sine–sine case is identical using the second identity: for m≠nm \ne n both cos⁡((m−n)x)\cos((m-n)x) and cos⁡((m+n)x)\cos((m+n)x) integrate to 00 over a full period (with the same exception check as above — if m+n=0m+n=0 then m=n=0m=n=0 is excluded by m≠nm\ne n, or by the standing convention b0b_0 is not defined since sin⁡0x≡0\sin 0x \equiv 0). For m=n≥1m=n\ge1: 12(2π)−12(0)=π\frac12(2\pi) - \frac12(0) = \pi. For m=n=0m=n=0, sin⁡0⋅sin⁡0=0\sin 0 \cdot \sin 0 = 0 identically, giving the stated value 00.

Cosine–sine case. Using the third identity,

∫−ππcos⁡mxsin⁡nx dx=12∫−ππsin⁡((m+n)x) dx−12∫−ππsin⁡((m−n)x) dx.\int_{-\pi}^\pi \cos mx \sin nx\,dx = \frac12\int_{-\pi}^\pi \sin((m+n)x)\,dx - \frac12\int_{-\pi}^\pi \sin((m-n)x)\,dx.

For any integer kk, ∫−ππsin⁡(kx) dx=0\int_{-\pi}^\pi \sin(kx)\,dx = 0: if k≠0k \ne 0 this is [−cos⁡kxk]−ππ=−cos⁡(kπ)−cos⁡(−kπ)k=0\left[-\frac{\cos kx}{k}\right]_{-\pi}^\pi = -\frac{\cos(k\pi)-\cos(-k\pi)}{k} = 0 since cosine is even; if k=0k=0 the integrand is identically 00. Both terms vanish for every m,nm,n, so the cross integral is always 00. ■\blacksquare

∎
CorollaryFourier coefficients as orthogonal projections

Let ff be Riemann integrable on [−π,π][-\pi,\pi] and let SNf(x)=a02+∑n=1N(ancos⁡nx+bnsin⁡nx)S_N f(x) = \frac{a_0}{2} + \sum_{n=1}^N (a_n \cos nx + b_n \sin nx) with an,bna_n, b_n as in the definition. Then SNfS_N f is precisely the function obtained by expanding ff in the orthogonal system {1,cos⁡x,sin⁡x,…,cos⁡Nx,sin⁡Nx}\{1,\cos x,\sin x,\dots,\cos Nx,\sin Nx\} using the standard projection coefficients

an=⟨f,cos⁡nx⟩⟨cos⁡nx,cos⁡nx⟩,bn=⟨f,sin⁡nx⟩⟨sin⁡nx,sin⁡nx⟩,a_n = \frac{\langle f, \cos nx\rangle}{\langle \cos nx,\cos nx\rangle}, \qquad b_n = \frac{\langle f,\sin nx\rangle}{\langle \sin nx,\sin nx\rangle},

consistent with ∥cos⁡nx∥22=∥sin⁡nx∥22=π\|\cos nx\|_2^2 = \|\sin nx\|_2^2 = \pi (n≥1n\ge1) and ∥1∥22=2π\|1\|_2^2 = 2\pi from the Lemma.

Proof

Immediate from the definitions: ⟨f,cos⁡nx⟩=∫−ππf(x)cos⁡nx dx=πan\langle f, \cos nx\rangle = \int_{-\pi}^\pi f(x)\cos nx\,dx = \pi a_n, so an=⟨f,cos⁡nx⟩/π=⟨f,cos⁡nx⟩/⟨cos⁡nx,cos⁡nx⟩a_n = \langle f,\cos nx\rangle/\pi = \langle f,\cos nx\rangle/\langle\cos nx,\cos nx\rangle, and similarly for bnb_n using ⟨sin⁡nx,sin⁡nx⟩=π\langle \sin nx,\sin nx\rangle = \pi. The constant term: ⟨f,1⟩=∫−ππf=πa0\langle f, 1\rangle = \int_{-\pi}^\pi f = \pi a_0, and ⟨1,1⟩=2π\langle 1,1\rangle = 2\pi, so ⟨f,1⟩/⟨1,1⟩=a0/2\langle f,1\rangle/\langle 1,1\rangle = a_0/2, matching the constant term in SNfS_N f. ■\blacksquare

∎
TheoremLeast-squares optimality of Fourier partial sums

Let ff be Riemann integrable on [−π,π][-\pi,\pi], fix N≥0N \ge 0, and let

TN={T(x)=c02+∑n=1N(cncos⁡nx+dnsin⁡nx):cn,dn∈R}\mathcal{T}_N = \left\{ T(x) = \frac{c_0}{2} + \sum_{n=1}^N (c_n \cos nx + d_n \sin nx) : c_n, d_n \in \mathbb{R} \right\}

be the space of trigonometric polynomials of degree ≤N\le N. Then among all T∈TNT \in \mathcal{T}_N, the quantity

E(T)=∫−ππ(f(x)−T(x))2 dxE(T) = \int_{-\pi}^\pi \big(f(x) - T(x)\big)^2\,dx

is minimized uniquely by T=SNfT = S_N f, the NN-th Fourier partial sum of ff. Moreover the minimum value equals

E(SNf)=∫−ππf(x)2 dx  −  π(a022+∑n=1N(an2+bn2)).E(S_N f) = \int_{-\pi}^\pi f(x)^2\,dx \;-\; \pi\left(\frac{a_0^2}{2} + \sum_{n=1}^N (a_n^2+b_n^2)\right).
Proof

Technique: expand the square, use orthogonality to isolate cross terms, complete the square in each free coefficient. Write T(x)=c02+∑n=1N(cncos⁡nx+dnsin⁡nx)∈TNT(x) = \frac{c_0}{2} + \sum_{n=1}^N (c_n\cos nx + d_n \sin nx) \in \mathcal{T}_N. Expand

E(T)=∫−ππf2 dx  −  2∫−ππf(x)T(x) dx  +  ∫−ππT(x)2 dx.E(T) = \int_{-\pi}^\pi f^2\,dx \;-\; 2\int_{-\pi}^\pi f(x) T(x)\,dx \;+\; \int_{-\pi}^\pi T(x)^2\,dx.

We compute the last two integrals using the orthogonality relations of the preceding Lemma.

Cross term. By linearity of the integral,

∫−ππf(x)T(x) dx=c02∫−ππf dx+∑n=1Ncn∫−ππfcos⁡nx dx+∑n=1Ndn∫−ππfsin⁡nx dx.\int_{-\pi}^\pi f(x)T(x)\,dx = \frac{c_0}{2}\int_{-\pi}^\pi f\,dx + \sum_{n=1}^N c_n \int_{-\pi}^\pi f\cos nx\,dx + \sum_{n=1}^N d_n \int_{-\pi}^\pi f \sin nx\,dx.

By definition of the Fourier coefficients, ∫−ππf dx=πa0\int_{-\pi}^\pi f\,dx = \pi a_0, ∫−ππfcos⁡nx dx=πan\int_{-\pi}^\pi f\cos nx\,dx = \pi a_n, ∫−ππfsin⁡nx dx=πbn\int_{-\pi}^\pi f \sin nx\,dx = \pi b_n. Hence

∫−ππfT dx=π(c0a02+∑n=1N(cnan+dnbn)).\int_{-\pi}^\pi f T\,dx = \pi\left( \frac{c_0 a_0}{2} + \sum_{n=1}^N (c_n a_n + d_n b_n)\right).

Quadratic term. Squaring TT produces a constant term, squares cos⁡2,sin⁡2\cos^2, \sin^2, and cross products cos⁡mxcos⁡nx\cos m x \cos nx, sin⁡mxsin⁡nx\sin mx \sin nx (m≠nm\ne n), and cos⁡mxsin⁡nx\cos mx \sin nx (all m,nm,n). By the Lemma, every cross product with distinct frequencies or mixed type integrates to 00; only the diagonal terms survive:

∫−ππT2 dx=c024⋅2π+∑n=1N(cn2⋅π+dn2⋅π)=π(c022+∑n=1N(cn2+dn2)).\int_{-\pi}^\pi T^2\,dx = \frac{c_0^2}{4}\cdot 2\pi + \sum_{n=1}^N \big(c_n^2 \cdot \pi + d_n^2 \cdot \pi\big) = \pi\left(\frac{c_0^2}{2} + \sum_{n=1}^N (c_n^2 + d_n^2)\right).

(To see there are no missed cross terms: expanding T2T^2 as a finite sum of products of basis functions and integrating termwise is valid because the integral of a finite sum equals the sum of integrals — no limiting process, no need for uniform convergence, since TN\mathcal T_N is a finite linear combination.)

Assembling E(T)E(T). Combining the three pieces,

E(T)=∫−ππf2 dx−2π(c0a02+∑n=1N(cnan+dnbn))+π(c022+∑n=1N(cn2+dn2)).E(T) = \int_{-\pi}^\pi f^2\,dx - 2\pi\left(\frac{c_0a_0}{2}+\sum_{n=1}^N(c_na_n+d_nb_n)\right) + \pi\left(\frac{c_0^2}{2}+\sum_{n=1}^N(c_n^2+d_n^2)\right).

Group by coefficient. The c0c_0-terms form π(c022−c0a0)=π2(c0−a0)2−π2a02\pi\left(\frac{c_0^2}{2} - c_0 a_0\right) = \frac{\pi}{2}(c_0 - a_0)^2 - \frac{\pi}{2}a_0^2, a completed square, valid by direct algebraic expansion: π2(c0−a0)2=π2c02−πc0a0+π2a02\frac{\pi}{2}(c_0-a_0)^2 = \frac{\pi}{2}c_0^2 - \pi c_0 a_0 + \frac{\pi}{2}a_0^2, matching after rearranging. For each n≥1n \ge 1, the cnc_n-terms form π(cn2−2cnan)=π(cn−an)2−πan2\pi(c_n^2 - 2c_na_n) = \pi(c_n-a_n)^2 - \pi a_n^2, and similarly the dnd_n-terms form π(dn−bn)2−πbn2\pi(d_n - b_n)^2 - \pi b_n^2. Substituting all completed squares,

E(T)=∫−ππf2 dx−π(a022+∑n=1N(an2+bn2))+π2(c0−a0)2+π∑n=1N[(cn−an)2+(dn−bn)2].E(T) = \int_{-\pi}^\pi f^2\,dx - \pi\left(\frac{a_0^2}{2}+\sum_{n=1}^N(a_n^2+b_n^2)\right) + \frac{\pi}{2}(c_0-a_0)^2 + \pi\sum_{n=1}^N\Big[(c_n-a_n)^2+(d_n-b_n)^2\Big].

The first two terms do not depend on TT at all; call their sum MM. The remaining terms form a sum of squares, each multiplied by a strictly positive constant (π/2\pi/2 or π\pi), hence

E(T)=M+π2(c0−a0)2+π∑n=1N[(cn−an)2+(dn−bn)2]  ≥  M,E(T) = M + \frac{\pi}{2}(c_0-a_0)^2 + \pi\sum_{n=1}^N\Big[(c_n-a_n)^2+(d_n-b_n)^2\Big] \;\ge\; M,

with equality if and only if c0=a0c_0 = a_0 and cn=an,dn=bnc_n = a_n, d_n = b_n for every n=1,…,Nn=1,\dots,N — i.e., if and only if T=SNfT = S_N f. This proves both the minimality and the uniqueness of the minimizer, and identifies the minimum value as M=E(SNf)=∫−ππf2 dx−π(a022+∑n=1N(an2+bn2))M = E(S_N f) = \int_{-\pi}^\pi f^2\,dx - \pi\left(\frac{a_0^2}{2}+\sum_{n=1}^N(a_n^2+b_n^2)\right), exactly as claimed. ■\blacksquare

∎
TheoremBessel's Inequality

Let ff be Riemann integrable on [−π,π][-\pi,\pi] with Fourier coefficients an,bna_n, b_n. Then for every integer N≥0N \ge 0,

a022+∑n=1N(an2+bn2)  ≤  1π∫−ππf(x)2 dx.\frac{a_0^2}{2} + \sum_{n=1}^N \big(a_n^2 + b_n^2\big) \;\le\; \frac{1}{\pi}\int_{-\pi}^\pi f(x)^2\,dx.

Consequently the series a022+∑n=1∞(an2+bn2)\displaystyle \frac{a_0^2}{2} + \sum_{n=1}^\infty (a_n^2+b_n^2) converges, and

a022+∑n=1∞(an2+bn2)  ≤  1π∫−ππf(x)2 dx.\frac{a_0^2}{2} + \sum_{n=1}^\infty (a_n^2+b_n^2) \;\le\; \frac{1}{\pi}\int_{-\pi}^\pi f(x)^2\,dx.
Proof

Technique: nonnegativity of the minimal least-squares error (Pythagoras). By the preceding Theorem applied with T=SNfT = S_N f itself (the minimizer), we found

E(SNf)=∫−ππ(f−SNf)2dx=∫−ππf2 dx−π(a022+∑n=1N(an2+bn2)).E(S_N f) = \int_{-\pi}^\pi \big(f - S_N f\big)^2 dx = \int_{-\pi}^\pi f^2\,dx - \pi\left(\frac{a_0^2}{2}+\sum_{n=1}^N (a_n^2+b_n^2)\right).

The left side is an integral of a square of a real-valued Riemann integrable function (a difference of Riemann integrable functions is Riemann integrable, and a square of a Riemann integrable function is Riemann integrable), hence is ≥0\ge 0. Therefore

0  ≤  ∫−ππf2 dx−π(a022+∑n=1N(an2+bn2)),0 \;\le\; \int_{-\pi}^\pi f^2\,dx - \pi\left(\frac{a_0^2}{2}+\sum_{n=1}^N (a_n^2+b_n^2)\right),

which rearranges directly to

a022+∑n=1N(an2+bn2)  ≤  1π∫−ππf2 dx.\frac{a_0^2}{2} + \sum_{n=1}^N (a_n^2+b_n^2) \;\le\; \frac{1}{\pi}\int_{-\pi}^\pi f^2\,dx.

This holds for every NN, and the right side does not depend on NN. The partial sums of the nonnegative series a022+∑(an2+bn2)\frac{a_0^2}2+\sum(a_n^2+b_n^2) therefore form a nondecreasing sequence (each added term an2+bn2≥0a_n^2+b_n^2\ge0) bounded above by the fixed constant 1π∫f2\frac1\pi\int f^2. By the monotone convergence of bounded monotone sequences, guaranteed by the completeness of R\mathbb R via the supremum property, the sequence of partial sums converges, and its limit — the sum of the series — is at most that same bound, by taking N→∞N\to\infty in the displayed inequality (a limit of a sequence bounded above by CC is itself ≤C\le C). This proves both claims. ■\blacksquare

∎
CorollaryRiemann–Lebesgue Lemma, trigonometric case

Let ff be Riemann integrable on [−π,π][-\pi,\pi]. Then

lim⁡n→∞∫−ππf(x)cos⁡nx dx=0,lim⁡n→∞∫−ππf(x)sin⁡nx dx=0.\lim_{n\to\infty} \int_{-\pi}^\pi f(x)\cos nx\,dx = 0, \qquad \lim_{n\to\infty}\int_{-\pi}^\pi f(x)\sin nx\,dx = 0.

Equivalently, an→0a_n \to 0 and bn→0b_n \to 0 as n→∞n \to \infty.

Proof

By Bessel's Inequality, the series ∑n=1∞(an2+bn2)\sum_{n=1}^\infty (a_n^2+b_n^2) converges. A necessary condition for convergence of a series is that its terms tend to 00: if ∑nun\sum_{n} u_n converges with partial sums σN→L\sigma_N \to L, then uN=σN−σN−1→L−L=0u_N = \sigma_N - \sigma_{N-1} \to L - L = 0. Applying this with un=an2+bn2≥0u_n = a_n^2+b_n^2 \ge 0, we get an2+bn2→0a_n^2 + b_n^2 \to 0. Since 0≤an2≤an2+bn20 \le a_n^2 \le a_n^2+b_n^2 and 0≤bn2≤an2+bn20\le b_n^2\le a_n^2+b_n^2, the squeeze theorem gives an2→0a_n^2 \to 0 and bn2→0b_n^2\to 0, hence an→0a_n \to 0 and bn→0b_n \to 0 (as t↦tt\mapsto\sqrt t is continuous at 00). Multiplying back by π\pi (a fixed constant) gives ∫−ππfcos⁡nx dx=πan→0\int_{-\pi}^\pi f\cos nx\,dx = \pi a_n \to 0 and similarly for the sine integral. ■\blacksquare

∎

Worked examples

Example 1 — Bessel's inequality for an asymmetric sawtooth-type function. Let f(x)=xf(x) = x on (−π,π](-\pi,\pi], extended 2π2\pi-periodically (the standard sawtooth). Since ff is odd, an=0a_n = 0 for all n≥0n\ge0. Compute bnb_n using integration by parts:

bn=1π∫−ππxsin⁡nx dx=1π[−xcos⁡nxn]−ππ+1πn∫−ππcos⁡nx dx.b_n = \frac{1}{\pi}\int_{-\pi}^\pi x\sin nx\,dx = \frac1\pi\left[ -\frac{x\cos nx}{n}\right]_{-\pi}^\pi + \frac{1}{\pi n}\int_{-\pi}^\pi \cos nx\,dx.

The second integral is 00 for n≥1n \ge 1 (shown in the Lemma). The boundary term:

[−xcos⁡nxn]−ππ=−πcos⁡nπn−(−(−π)cos⁡(−nπ)n)=−πcos⁡nπn−πcos⁡nπn=−2πcos⁡nπn.\left[-\frac{x\cos nx}{n}\right]_{-\pi}^{\pi} = -\frac{\pi \cos n\pi}{n} - \left(-\frac{(-\pi)\cos(-n\pi)}{n}\right) = -\frac{\pi\cos n\pi}{n} - \frac{\pi \cos n\pi}{n} = -\frac{2\pi \cos n\pi}{n}.

Since cos⁡nπ=(−1)n\cos n\pi = (-1)^n, we get bn=1π⋅(−2π(−1)nn)=−2(−1)nn=2(−1)n+1nb_n = \frac1\pi \cdot \left(-\frac{2\pi(-1)^n}{n}\right) = \frac{-2(-1)^n}{n} = \frac{2(-1)^{n+1}}{n}. So b1=2,b2=−1,b3=23,b4=−12,…b_1 = 2, b_2 = -1, b_3 = \frac23, b_4 = -\frac12, \dots Now compute the right side of Bessel's inequality:

1π∫−ππx2 dx=1π[x33]−ππ=1π⋅2π33=2π23≈6.5797.\frac1\pi\int_{-\pi}^\pi x^2\,dx = \frac{1}{\pi}\left[\frac{x^3}{3}\right]_{-\pi}^\pi = \frac{1}{\pi}\cdot \frac{2\pi^3}{3} = \frac{2\pi^2}{3} \approx 6.5797.

Check Bessel's inequality at N=3N=3: since an≡0a_n \equiv 0,

∑n=13bn2=22+(−1)2+(23)2=4+1+49=5.4444…\sum_{n=1}^3 b_n^2 = 2^2 + (-1)^2 + \left(\frac23\right)^2 = 4 + 1 + \frac49 = 5.4444\ldots

Indeed 5.4444<6.57975.4444 < 6.5797, consistent with the theorem. Taking N→∞N\to\infty, Bessel's inequality asserts ∑n=1∞4n2≤2π23\sum_{n=1}^\infty \frac{4}{n^2} \le \frac{2\pi^2}{3}, i.e. 4∑1n2≤2π234\sum \frac{1}{n^2} \le \frac{2\pi^2}{3}. Using the classical value ∑n=1∞1n2=π26\sum_{n=1}^\infty \frac1{n^2} = \frac{\pi^2}{6} (a fact provable independently, e.g. via Parseval's theorem — the equality case of Bessel, treated alongside Convergence of Fourier Series), we get 4⋅π26=2π234\cdot\frac{\pi^2}6 = \frac{2\pi^2}{3} exactly, matching the right side with equality — a preview of the fact that Bessel's inequality becomes an equality (Parseval's identity) for this particular ff.

Example 2 — a non-odd, non-even function: least-squares optimal quadratic trigonometric approximation. Let f(x)=x2f(x) = x^2 on (−π,π](-\pi,\pi] shifted so that it is not symmetric about the natural comparison point — instead take

g(x)=x2+x,x∈(−π,π],g(x) = x^2 + x, \qquad x \in (-\pi,\pi],

periodically extended. This function is neither even nor odd, so both ana_n and bnb_n are generically nonzero, giving a genuinely asymmetric test case. Coefficients from x2x^2 (even part): a standard computation (integration by parts twice) gives, for n≥1n\ge1,

∫−ππx2cos⁡nx dx=4π(−1)nn2,\int_{-\pi}^\pi x^2\cos nx\,dx = \frac{4\pi(-1)^n}{n^2},

so the contribution to ana_n from x2x^2 is 1π⋅4π(−1)nn2=4(−1)nn2\frac1\pi\cdot \frac{4\pi(-1)^n}{n^2} = \frac{4(-1)^n}{n^2}. Also ∫−ππx2 dx=2π33\int_{-\pi}^\pi x^2\,dx = \frac{2\pi^3}{3} so the a0a_0 contribution is 1π⋅2π33=2π23\frac{1}{\pi}\cdot\frac{2\pi^3}3 = \frac{2\pi^2}{3}, giving constant term a0/2=π2/3a_0/2 = \pi^2/3. Coefficients from xx (odd part, computed in Example 1): contributes 00 to every ana_n, and contributes bn=2(−1)n+1nb_n = \frac{2(-1)^{n+1}}{n}. Since Fourier coefficients are linear in ff (immediate from linearity of the integral), the coefficients of g=x2+xg = x^2+x are the sums:

a0=2π23⋅2/…a_0 = \frac{2\pi^2}{3}\cdot 2/\ldots

Let us be careful and just state them directly: a0=2π23a_0 = \frac{2\pi^2}{3} (unchanged, since xx contributes 00 to a0a_0 as it is odd), and for n≥1n \ge 1,

an=4(−1)nn2,bn=2(−1)n+1n.a_n = \frac{4(-1)^n}{n^2}, \qquad b_n = \frac{2(-1)^{n+1}}{n}.

Take N=2N=2. Then a1=−4,a2=1a_1 = -4, a_2 = 1; b1=2,b2=−1b_1 = 2, b_2=-1. The degree-22 Fourier partial sum is

S2g(x)=π23−4cos⁡x+cos⁡2x+2sin⁡x−sin⁡2x.S_2 g(x) = \frac{\pi^2}{3} - 4\cos x + \cos 2x + 2\sin x - \sin 2x.

By the Least-Squares Optimality Theorem, this specific trigonometric polynomial, among all trigonometric polynomials c0/2+c1cos⁡x+d1sin⁡x+c2cos⁡2x+d2sin⁡2xc_0/2 + c_1\cos x + d_1 \sin x + c_2 \cos 2x + d_2 \sin 2x, minimizes ∫−ππ(g−T)2 dx\int_{-\pi}^\pi (g - T)^2\,dx. No other choice of the five real parameters (c0,c1,d1,c2,d2)(c_0,c_1,d_1,c_2,d_2) can do better — a claim that would be very hard to verify directly by calculus of five variables, but is immediate from the completed-square argument in the proof. Now check Bessel's inequality numerically. We need ∫−ππg(x)2 dx=∫−ππ(x2+x)2 dx=∫−ππ(x4+2x3+x2) dx\int_{-\pi}^\pi g(x)^2\,dx = \int_{-\pi}^\pi (x^2+x)^2\,dx = \int_{-\pi}^\pi (x^4 + 2x^3 + x^2)\,dx. Since x3x^3 is odd, its integral over (−π,π)(-\pi,\pi) vanishes. So

∫−ππg2 dx=∫−ππx4 dx+∫−ππx2 dx=2π55+2π33.\int_{-\pi}^\pi g^2\,dx = \int_{-\pi}^\pi x^4\,dx + \int_{-\pi}^\pi x^2\,dx = \frac{2\pi^5}{5} + \frac{2\pi^3}{3}.

Numerically, π≈3.14159265\pi \approx 3.14159265, π3≈31.00628\pi^3 \approx 31.00628, π5≈306.0197\pi^5 \approx 306.0197. So 2π55≈122.4079\frac{2\pi^5}{5}\approx 122.4079 and 2π33≈20.6709\frac{2\pi^3}{3}\approx 20.6709, total ≈143.0788\approx 143.0788. Dividing by π\pi: 1π∫g2≈45.5455\frac1\pi\int g^2 \approx 45.5455. Left side of Bessel at N=2N=2:

a022+(a12+b12)+(a22+b22)=(2π2/3)22+(16+4)+(1+1)=4π4/92+20+2.\frac{a_0^2}{2} + (a_1^2+b_1^2) + (a_2^2+b_2^2) = \frac{(2\pi^2/3)^2}{2} + (16+4) + (1+1) = \frac{4\pi^4/9}{2} + 20 + 2.

Since π4≈97.409\pi^4 \approx 97.409, 4π49≈43.293\frac{4\pi^4}{9}\approx 43.293, divided by 22 gives ≈21.6467\approx 21.6467. Total left side ≈21.6467+20+2=43.6467\approx 21.6467 + 20 + 2 = 43.6467. Indeed 43.6467<45.545543.6467 < 45.5455: Bessel's inequality holds, with a visible gap (the "energy" still uncaptured by frequencies 0,1,20,1,2 is about 1.901.90, matching exactly ∥g−S2g∥22/π\|g - S_2 g\|_2^2/\pi by the exact formula in the Optimality Theorem).

CounterexampleWhy Riemann integrability of ff (finiteness of ∫f2\int f^2) cannot be dropped

Bessel's inequality requires ff to be Riemann integrable so that ∫−ππf2 dx\int_{-\pi}^\pi f^2\,dx is a finite real number — this finiteness is used essentially in the proof, since the whole argument bounds a sum by this quantity. If we allow ff merely to be defined pointwise with an,bna_n, b_n computed by formal (divergent or undefined) integrals, the inequality's hypotheses are not even met and its conclusion can fail outright. Concretely, take

f(x)=1∣x∣,x∈(−π,π]∖{0},f(0):=0,f(x) = \frac{1}{\sqrt{|x|}}, \qquad x \in (-\pi,\pi]\setminus\{0\}, \quad f(0) := 0,

extended 2π2\pi-periodically. This ff is an improper Riemann integral in the sense that ∫−ππf dx\int_{-\pi}^\pi f\,dx converges (since ∫0πx−1/2dx=2π<∞\int_0^\pi x^{-1/2}dx = 2\sqrt\pi <\infty), so one can still define an=1π∫−ππfcos⁡nx dxa_n = \frac1\pi\int_{-\pi}^\pi f\cos nx\,dx and bnb_n as legitimate finite numbers via improper integration. But

∫−ππf(x)2 dx=∫−ππ1∣x∣ dx=2∫0πdxx,\int_{-\pi}^\pi f(x)^2\,dx = \int_{-\pi}^\pi \frac{1}{|x|}\,dx = 2\int_0^\pi \frac{dx}{x},

which diverges to +∞+\infty (∫0πx−1dx=lim⁡ε→0+[ln⁡π−ln⁡ε]=+∞\int_0^\pi x^{-1}dx = \lim_{\varepsilon\to0^+}[\ln\pi - \ln\varepsilon] = +\infty). Here ff fails to be Riemann integrable in the sense required (it is not even bounded, so it is not Riemann integrable on [−π,π][-\pi,\pi] at all — the finite quantity ∫f2\int f^2 that Bessel's inequality bounds the coefficient-sum by simply does not exist as a Riemann integral). The proof of Bessel's Inequality breaks at the very first step: the Least-Squares Optimality Theorem computes E(SNf)=∫f2 dx−π(⋯ )E(S_Nf) = \int f^2\,dx - \pi(\cdots), and if ∫f2 dx=+∞\int f^2\,dx = +\infty, this "identity" is vacuous — E(SNf)E(S_N f) itself is +∞+\infty for every NN (since ∫(f−SNf)2≥∫f2−∫(finite corrections)=∞\int (f-S_Nf)^2 \ge \int f^2 - \int(\text{finite corrections}) = \infty), so the inequality a022+∑(an2+bn2)≤1π∫f2\frac{a_0^2}2+\sum(a_n^2+b_n^2)\le \frac1\pi\int f^2 becomes the true-but-useless statement "(finite number) ≤∞\le \infty" — Bessel's inequality is not false here so much as vacuous, because its right-hand side, which is supposed to be a finite bound controlling the Fourier coefficients, no longer exists as a finite number. This is exactly why the hypothesis "ff Riemann integrable" (equivalently here, ∫f2<∞\int f^2 < \infty) must be stated: without it there is nothing for Bessel's inequality to assert.

Scope, edge cases & common traps

SituationWhat holdsWhat can fail / must be checked
ff Riemann integrable on [−π,π][-\pi,\pi]Bessel's inequality holds for every NN; series of squared coefficients convergesNothing extra needed — this is the full hypothesis
ff merely defined pointwise, ∫f2=∞\int f^2 = \inftyan,bna_n,b_n may still be individually finiteBessel's inequality's right side is +∞+\infty: statement becomes vacuous (see counterexample)
ff continuous, or even C∞C^\inftyBessel's inequality holds (continuous ⇒\Rightarrow Riemann integrable); moreover for smooth ff coefficients decay faster than any power of 1/n1/nFaster decay is a stronger fact, not proved by Bessel's inequality alone — needs extra integration by parts arguments
Wanting equality in Bessel (Parseval)Requires completeness of the trigonometric system in L2L^2, a strictly stronger factDo not assume equality without separately proving completeness — this is a distinct theorem, previewed but not established here
Wanting SNf→fS_N f \to f pointwise or uniformlyRequires further hypotheses (e.g. Dirichlet-type conditions)Bessel's inequality alone says nothing about convergence of SNfS_N f to ff — only that its coefficients form a square-summable sequence

The mathematician behind it

Origins · 1 minFriedrich Wilhelm Bessel and how this was discovered
FW
Friedrich Wilhelm Bessel
1784–1846 · Königsberg Observatory, Prussia

Bessel was an astronomer and mathematician, first apprenticed in a mercantile house in Bremen before turning to celestial mechanics through his own study of Halley's comet observations. He became director of the Königsberg Observatory, where he achieved the first reliable measurement of stellar parallax (for the star 61 Cygni, 1838), placing real numerical distances on the scale of the galaxy for the first time. His mathematical work on planetary perturbation series led him to the differential equation and function family now called Bessel functions, and to the general inequality bearing his name, which arose from estimating the error in approximating functions by finite trigonometric (and later, more general orthogonal) series — precisely the object of this article.

History
- 1784 — Friedrich Bessel born in Minden, Westphalia.
- 1804 — Bessel computes an orbit for Halley's comet from historical observations, drawing Wilhelm Olbers's attention and beginning his astronomical career.
- 1810 — Bessel appointed founding director of the Königsberg Observatory.
- 1824–1826 — In work on planetary perturbations, Bessel systematizes the functions and coefficient inequalities associated with orthogonal expansions, giving Bessel's inequality its name and its first general (non-trigonometric-specific) statement.
- 1838 — Bessel announces the first accepted stellar parallax measurement, for 61 Cygni, a landmark independent of his analytic work but emblematic of the same exacting numerical standard.
Is Bessel's inequality only about the trigonometric system, or is it more general?

Bessel's inequality is a general fact about any orthogonal (or orthonormal) system in an inner-product space, not just sines and cosines. If {φn}\{\varphi_n\} is orthonormal and ff has finite "energy" ∥f∥22=∫f2\|f\|_2^2 = \int f^2, then the generalized coefficients cn=⟨f,φn⟩c_n = \langle f,\varphi_n\rangle satisfy ∑ncn2≤∥f∥22\sum_n c_n^2 \le \|f\|_2^2, by exactly the same completed-square argument used here. The trigonometric case is the classical and most historically important instance, which is why it is treated first and in full detail, but the identical proof applies verbatim to Legendre polynomials, Hermite functions, or any orthonormal basis used in approximation theory or quantum mechanics.

Does Bessel's inequality tell us anything about whether the Fourier series converges to ff?

No — and this is the most important scope caveat. Bessel's inequality only says the sequence of Fourier coefficients is square-summable; it says nothing about whether SNf(x)S_N f(x) approaches f(x)f(x) as N→∞N \to \infty, either pointwise or uniformly. Convergence of Fourier series is a separate and considerably deeper question requiring additional hypotheses on ff (such as piecewise smoothness, bounded variation, or Hölder continuity), addressed in the study of Convergence of Fourier Series. Bessel's inequality is a necessary first step — it shows the coefficients don't blow up — but convergence needs much more machinery, such as Dirichlet kernels and localization principles.

What is the difference between Bessel's inequality and Parseval's identity?

Bessel's inequality is the ≤\le statement proved here for any Riemann integrable ff, using only orthogonality and nonnegativity of ∫(f−SNf)2\int(f-S_Nf)^2. Parseval's identity is the equality a022+∑n=1∞(an2+bn2)=1π∫−ππf2 dx\frac{a_0^2}2+\sum_{n=1}^\infty(a_n^2+b_n^2) = \frac1\pi\int_{-\pi}^\pi f^2\,dx, which holds precisely when ∥f−SNf∥2→0\|f - S_Nf\|_2 \to 0 as N→∞N\to\infty — that is, when trigonometric polynomials are dense enough to approximate ff arbitrarily well in mean square. Proving this density (completeness of the trigonometric system) is strictly harder than anything used to prove Bessel's inequality, and is not established in this article; Bessel's inequality alone never upgrades to equality without that extra completeness argument.

Why does the proof work using only finitely many terms, with no appeal to uniform convergence?

Because TN\mathcal{T}_N, the space of trigonometric polynomials up to frequency NN, is finite-dimensional for each fixed NN: any T∈TNT \in \mathcal T_N is a genuine finite linear combination of 2N+12N+1 basis functions. Expanding (f−T)2(f-T)^2 and integrating term by term is then just linearity of the (finite) integral of a finite sum — no interchange of limit and integral, and hence no need for uniform convergence hypotheses, is required at this stage. Uniform convergence becomes relevant only when one lets N→∞N \to \infty and asks whether the infinite series itself converges to ff in a strong sense — a separate question from the finite-NN optimality and Bessel bound proved here.

Can Bessel's inequality be strict, or is it always an equality in practice?

It can genuinely be strict, and generically is, for any finite NN: the gap 1π∫f2−(a022+∑n=1N(an2+bn2))\frac1\pi\int f^2 - \left(\frac{a_0^2}2+\sum_{n=1}^N(a_n^2+b_n^2)\right) equals 1π∫(f−SNf)2 dx≥0\frac1\pi\int (f-S_Nf)^2\,dx \ge 0, and this is exactly zero only if ff coincides with its own NN-th Fourier partial sum, i.e. ff is itself already a trigonometric polynomial of degree ≤N\le N (up to a set of measure zero not affecting the Riemann integral). For generic ff, such as the sawtooth or x2+xx^2+x examples worked out above, the inequality is strict for every finite NN, and only becomes equality in the limit N→∞N \to \infty if the completeness (Parseval) property holds.

Does Bessel's inequality require ff to be periodic?

The trigonometric system is naturally periodic with period 2π2\pi, so the theorem as stated is about functions on [−π,π][-\pi,\pi], implicitly extended periodically when convenient (as in both worked examples). If ff is defined only on [−π,π][-\pi,\pi] without regard to periodicity, the integrals and inequality still make perfect sense verbatim — periodicity is a convenience for interpreting SNfS_Nf as approximating ff "everywhere on the circle," not a logical requirement for the inequality's proof, which only uses integrals over the fixed interval [−π,π][-\pi,\pi].

Before this

Where this leads