Eigenfunction Expansions

Can you solve a heated rod with a distributed heat source, in closed form? The equation −u′′=f(x)-u'' = f(x) with fixed-temperature ends looks elementary. But as soon as ff is a general function — not a sine wave — direct antidifferentiation becomes clumsy. The method does not generalize to variable-coefficient operators like −(p(x)y′)′+q(x)y-(p(x)y')' + q(x)y. Eigenfunction expansions solve this once and for all. They diagonalize the differential operator by expressing every function in the natural orthogonal basis it supplies. This turns a differential equation into an infinite, uncoupled system of algebraic equations, one per mode. This idea is the PDE-solver's workhorse. It is the reason separation of variables works. It is the reason Fourier series are not a lucky coincidence. Instead, they are a special case of a much broader phenomenon. It is also the reason heat, wave, and Laplace equations on bounded domains all yield to the same three-step strategy. First, find the eigenfunctions of the spatial operator. Then expand the data in that basis. Finally, read off the answer term by term. The big picture is spectral: a self-adjoint Sturm–Liouville operator LL on a bounded interval has an orthogonal basis of eigenfunctions {ϕn}\{\phi_n\}. This is exactly like a real symmetric matrix having an orthonormal basis of eigenvectors. Solving Ly=fLy = f becomes solving λncn=fn\lambda_n c_n = f_n for each Fourier coefficient cnc_n of the unknown yy. This holds provided 00 is not itself an eigenvalue. This article builds that machinery rigorously: the generalized Fourier series, the completeness theorem it rests on, and the full solution algorithm for inhomogeneous two-point boundary value problems. This includes the resonance case when λ=0\lambda = 0 is an eigenvalue. This article delivers a precise statement and proof of the eigenfunction expansion method, two fully worked non-symmetric examples, and a careful treatment of the solvability (Fredholm alternative) obstruction. It also builds a bridge to the Green's Functions for Boundary Value Problems viewpoint, where the same operator is inverted once and for all by an integral kernel.

Key takeaways
  • A regular Sturm–Liouville operator has a countable, real, orthogonal set of eigenfunctions that is complete in Lr2L^2_r.
  • Any admissible function ff has a generalized Fourier series f=∑cnϕnf = \sum c_n \phi_n with cn=⟨f,ϕn⟩r/⟨ϕn,ϕn⟩rc_n = \langle f,\phi_n\rangle_r/\langle \phi_n,\phi_n\rangle_r.
  • To solve Ly=fLy = f with the same boundary conditions, expand both sides in {ϕn}\{\phi_n\} and solve λncn=fn\lambda_n c_n = f_n mode by mode.
  • If 00 is an eigenvalue, the equation Ly=fLy=f is solvable only when ff is orthogonal to the corresponding eigenfunction — the Fredholm alternative.
  • Convergence of the series is guaranteed in the mean-square sense by completeness, and pointwise under mild smoothness of ff.
  • Key idea: eigenfunctions diagonalize a self-adjoint differential operator exactly as eigenvectors diagonalize a symmetric matrix, turning Ly=fLy=f into scalar equations λncn=fn\lambda_n c_n = f_n.

Where this lives today

Eigenfunction expansions are the computational engine behind separation of variables for the heat, wave, and Laplace equations on bounded domains — the spatial eigenfunctions of the Laplacian (or of a Sturm–Liouville operator obtained after separating variables) supply the basis in which the time-dependent or harmonic problem is solved mode by mode. In quantum mechanics, the time-independent Schrödinger equation is literally a Sturm–Liouville eigenvalue problem, and any wavefunction is expanded in energy eigenstates — the same cn=⟨f,ϕn⟩c_n = \langle f,\phi_n\rangle formula computes transition amplitudes. In acoustics and structural engineering, normal modes of a vibrating beam or membrane are Sturm–Liouville eigenfunctions, and forced vibration problems are solved by exactly the resonance analysis of Case 2 above — a driving frequency equal to a natural frequency produces unbounded resonant response unless the forcing is orthogonal to that mode. In numerical analysis and scientific computing, spectral methods approximate PDE solutions by truncating an eigenfunction expansion, achieving exponential convergence for smooth data. The Fredholm alternative appearing in Case 2 recurs throughout functional analysis, integral equations, and the study of Green's Functions for Boundary Value Problems, where the same solvability dichotomy governs invertibility of compact self-adjoint operators.

:::quiz[Which quantity determines whether the inhomogeneous problem L[y]−μry=fL[y]-\mu r y = f has a unique solution, no solution, or infinitely many?]

  • The sign of ff on [a,b][a,b]
  • Whether μ\mu coincides with an eigenvalue λk\lambda_k, and if so whether ⟨f,ϕk⟩r=0\langle f,\phi_k\rangle_r=0 ✓
  • Whether p(x)p(x) is bounded
  • The parity (even/odd) of the boundary conditions

:::quiz[The classical Fourier sine series on [0,L][0,L] with Dirichlet conditions is a special case of eigenfunction expansion with]

  • p≡1p\equiv1, q≡0q\equiv0, r≡1r\equiv1, and Dirichlet boundary conditions giving ϕn=sin⁡(nπx/L)\phi_n=\sin(n\pi x/L) ✓
  • p(x)=xp(x)=x, q≡0q\equiv0, r≡1/xr\equiv1/x
  • q(x)=−λq(x) = -\lambda chosen so that r≡0r\equiv 0
  • Any weight rr so long as pp is negative

Ask the tutor: How does the eigenfunction expansion method change if the boundary conditions are periodic instead of separated, and what happens to the Fredholm alternative in that case?

DefinitionEigenfunction expansion of a Sturm–Liouville problem

Let

L[y]:=−(p(x)y′)′+q(x)y,a≤x≤b,L[y] := -(p(x)y')' + q(x)y, \qquad a \le x \le b,

where p∈C1[a,b]p \in C^1[a,b] with p(x)>0p(x) > 0, q∈C[a,b]q \in C[a,b], and r∈C[a,b]r \in C[a,b] with r(x)>0r(x) > 0 is a weight function. Consider the regular Sturm–Liouville problem

L[y]=λr(x)y,α1y(a)+α2y′(a)=0,β1y(b)+β2y′(b)=0,L[y] = \lambda r(x) y, \qquad \alpha_1 y(a) + \alpha_2 y'(a) = 0, \qquad \beta_1 y(b) + \beta_2 y'(b) = 0,

with (α1,α2)≠(0,0)(\alpha_1,\alpha_2)\neq(0,0), (β1,β2)≠(0,0)(\beta_1,\beta_2)\neq(0,0), all constants real. Sturm–Liouville theory (assumed known) guarantees a countable increasing sequence of real eigenvalues λ1<λ2<⋯→∞\lambda_1 < \lambda_2 < \cdots \to \infty with corresponding real eigenfunctions ϕ1,ϕ2,…\phi_1,\phi_2,\dots, pairwise orthogonal with respect to the weighted inner product

⟨u,v⟩r:=∫abu(x)v(x) r(x) dx.\langle u,v\rangle_r := \int_a^b u(x)v(x)\, r(x)\, dx .

Given f∈Lr2(a,b)f \in L^2_r(a,b) (i.e. ∫abf2r dx<∞\int_a^b f^2 r\,dx < \infty), its generalized Fourier series (eigenfunction expansion) in {ϕn}\{\phi_n\} is

f(x)  ∼  ∑n=1∞cnϕn(x),cn=⟨f,ϕn⟩r⟨ϕn,ϕn⟩r=∫abf(x)ϕn(x)r(x) dx∫abϕn(x)2r(x) dx.f(x) \;\sim\; \sum_{n=1}^{\infty} c_n \phi_n(x), \qquad c_n = \frac{\langle f,\phi_n\rangle_r}{\langle \phi_n,\phi_n\rangle_r} = \frac{\int_a^b f(x)\phi_n(x) r(x)\,dx}{\int_a^b \phi_n(x)^2 r(x)\,dx}.

The series converges to ff in the mean-square sense with weight rr:

lim⁡N→∞∫ab(f(x)−∑n=1Ncnϕn(x))2r(x) dx=0.\lim_{N\to\infty} \int_a^b \Big(f(x) - \sum_{n=1}^N c_n \phi_n(x)\Big)^2 r(x)\,dx = 0.

Intuition

Think of Lr2(a,b)L^2_r(a,b) — square-integrable functions on [a,b][a,b] weighted by rr — as an infinite-dimensional vector space with inner product ⟨ ,⟩r\langle\, ,\rangle_r. The eigenfunctions ϕn\phi_n of a self-adjoint operator LL play exactly the role that an orthogonal eigenbasis {vn}\{v_n\} plays for a symmetric matrix AA: every vector decomposes as x=∑cnvnx = \sum c_n v_n, and Ax=∑λncnvnAx = \sum \lambda_n c_n v_n. Solving Ax=bAx = b becomes solving λncn=bn\lambda_n c_n = b_n coordinate by coordinate — trivial, provided no λn\lambda_n is zero. The eigenfunction expansion method is this exact linear-algebra fact, lifted to function space, where "coordinates" are Fourier coefficients and "vectors" are functions on [a,b][a,b]. The classical Fourier sine and cosine series are the special case p≡1p\equiv 1, q≡0q\equiv 0, r≡1r\equiv 1, with Dirichlet or Neumann conditions — the eigenfunctions are sin⁡(nπx/L)\sin(n\pi x/L) or cos⁡(nπx/L)\cos(n\pi x/L). What makes the general Sturm–Liouville framework powerful is that the same three-step recipe — expand the source, divide by the eigenvalue, resum — works for any self-adjoint second-order operator on any bounded interval, with any separated boundary conditions, and any weight. This is precisely why the method of separation of variables, applied to the heat, wave, or Laplace equation on a finite rod, disk, or box, always terminates in a Fourier-type series: the spatial part of the separated PDE is always a Sturm–Liouville problem.

Figure
Projecting a source function onto three eigenfunctions turns a differential equation into three scalar equations
Function space L²_r(a,b) f f(x) φ₁ = sin(πx/L) c₁φ₁ c₁ = ⟨f,φ₁⟩ᵣ/‖φ₁‖²ᵣ c₂φ₂ . f = Σ cₙφₙ ⟹ Ly=f becomes λₙcₙ = fₙ for each n
TheoremEigenfunction Expansion Solution of an Inhomogeneous Sturm–Liouville BVP

Let L[y]=−(py′)′+qyL[y] = -(p y')' + qy with p∈C1[a,b]p\in C^1[a,b], p>0p>0, q∈C[a,b]q\in C[a,b], and let r∈C[a,b]r\in C[a,b], r>0r>0. Let {(λn,ϕn)}n=1∞\{(\lambda_n,\phi_n)\}_{n=1}^\infty be the eigenvalues and orthogonal eigenfunctions of the associated regular Sturm–Liouville problem with separated, homogeneous boundary conditions Ba[y]=0B_a[y]=0, Bb[y]=0B_b[y]=0 (as in the definition above). Suppose f∈C[a,b]f \in C[a,b] (or more generally f∈Lr2f\in L^2_r), and consider the inhomogeneous problem

L[y]−μr(x)y=f(x),Ba[y]=0,Bb[y]=0,(∗)L[y] - \mu r(x) y = f(x), \qquad B_a[y] = 0, \quad B_b[y] = 0, \tag{$\ast$}

for a fixed real parameter μ\mu.

Case 1 (μ\mu not an eigenvalue). If μ≠λn\mu \neq \lambda_n for every nn, then (∗)(\ast) has a unique solution y∈C2[a,b]y \in C^2[a,b] satisfying the boundary conditions, given by the eigenfunction expansion

y(x)=∑n=1∞fnλn−μ ϕn(x),fn:=⟨f,ϕn⟩r⟨ϕn,ϕn⟩r,y(x) = \sum_{n=1}^{\infty} \frac{f_n}{\lambda_n - \mu}\, \phi_n(x), \qquad f_n := \frac{\langle f,\phi_n\rangle_r}{\langle\phi_n,\phi_n\rangle_r},

which converges in Lr2(a,b)L^2_r(a,b); if in addition ff is Hölder continuous, the series converges uniformly on [a,b][a,b] to the classical C2C^2 solution.

Case 2 (μ\mu is an eigenvalue, say μ=λk\mu = \lambda_k). The problem (∗)(\ast) has a solution if and only if

⟨f,ϕk⟩r=0,\langle f, \phi_k \rangle_r = 0,

i.e. ff is orthogonal (in the rr-weighted sense) to every eigenfunction belonging to λk\lambda_k. When this solvability condition holds, the solution is

y(x)=∑n≠kfnλn−λk ϕn(x)  +  C ϕk(x),y(x) = \sum_{n \neq k} \frac{f_n}{\lambda_n - \lambda_k}\, \phi_n(x) \;+\; C\,\phi_k(x),

for an arbitrary constant CC; when it fails, no solution exists.

Proof

The proof uses completeness of the eigenfunction system (a standard consequence of Sturm–Liouville theory, assumed known) together with term-by-term matching of Fourier coefficients, justified by self-adjointness of LL.

Step 1: Self-adjointness and orthogonality. For u,v∈C2[a,b]u,v \in C^2[a,b] satisfying Ba[u]=Ba[v]=0B_a[u]=B_a[v]=0 and Bb[u]=Bb[v]=0B_b[u]=B_b[v]=0, Lagrange's identity gives

∫ab(L[u]v−uL[v]) dx=[p(x)(u′v−uv′)]ab=0,\int_a^b \big(L[u]v - uL[v]\big)\,dx = \big[p(x)(u'v - uv')\big]_a^b = 0,

because the separated boundary conditions force the boundary term to vanish at each endpoint (this is the standard computation underlying self-adjointness of regular Sturm–Liouville operators). Hence ⟨L[u],v⟩=⟨u,L[v]⟩\langle L[u],v\rangle = \langle u, L[v]\rangle for all such u,vu,v, where ⟨⋅,⋅⟩\langle\cdot,\cdot\rangle is the unweighted L2L^2 inner product. Applying this with u=ϕmu=\phi_m, v=ϕnv=\phi_n eigenfunctions, L[ϕn]=λnrϕnL[\phi_n] = \lambda_n r \phi_n, gives

λn⟨ϕn,ϕm⟩r=⟨L[ϕn],ϕm⟩=⟨ϕn,L[ϕm]⟩=λm⟨ϕn,ϕm⟩r,\lambda_n \langle \phi_n,\phi_m\rangle_r = \langle L[\phi_n],\phi_m\rangle = \langle \phi_n, L[\phi_m]\rangle = \lambda_m \langle \phi_n,\phi_m\rangle_r,

so (λn−λm)⟨ϕn,ϕm⟩r=0(\lambda_n-\lambda_m)\langle\phi_n,\phi_m\rangle_r = 0. Since the λn\lambda_n are distinct for n≠mn\neq m (they are strictly increasing), ⟨ϕn,ϕm⟩r=0\langle \phi_n,\phi_m\rangle_r = 0 for n≠mn\neq m. This is the orthogonality already assumed from Sturm–Liouville theory; we re-derive it here because the same computation is reused below.

Step 2: Expand ff and the (assumed) solution yy in the eigenbasis. By completeness of {ϕn}\{\phi_n\} in Lr2(a,b)L^2_r(a,b) (the Sturm–Liouville completeness theorem), write the generalized Fourier series

f∼∑n=1∞fnϕn,fn=⟨f,ϕn⟩r∥ϕn∥r2.f \sim \sum_{n=1}^\infty f_n \phi_n, \qquad f_n = \frac{\langle f,\phi_n\rangle_r}{\|\phi_n\|_r^2}.

Suppose yy is a solution of (∗)(\ast) with y∈C2[a,b]y \in C^2[a,b] satisfying the boundary conditions. Since yy then also lies in the domain of LL compatible with the boundary conditions, expand

y∼∑n=1∞ynϕn,yn=⟨y,ϕn⟩r∥ϕn∥r2.y \sim \sum_{n=1}^\infty y_n \phi_n, \qquad y_n = \frac{\langle y,\phi_n\rangle_r}{\|\phi_n\|_r^2}.

Step 3: Term-by-term identity from self-adjointness. Using Step 1 with u=yu = y, v=ϕnv = \phi_n (both satisfy the same homogeneous boundary conditions, since yy is required to satisfy Ba[y]=Bb[y]=0B_a[y]=B_b[y]=0):

⟨L[y],ϕn⟩=⟨y,L[ϕn]⟩=⟨y,λnrϕn⟩=λn⟨y,ϕn⟩r=λn∥ϕn∥r2 yn.\langle L[y], \phi_n \rangle = \langle y, L[\phi_n]\rangle = \langle y, \lambda_n r \phi_n\rangle = \lambda_n \langle y,\phi_n\rangle_r = \lambda_n \|\phi_n\|_r^2\, y_n.

On the other hand, from the differential equation L[y]=f+μryL[y] = f + \mu r y,

⟨L[y],ϕn⟩=⟨f,ϕn⟩+μ⟨y,ϕn⟩=∥ϕn∥r2fn+μ∥ϕn∥r2yn\langle L[y],\phi_n\rangle = \langle f,\phi_n\rangle + \mu\langle y,\phi_n\rangle = \|\phi_n\|_r^2 f_n + \mu \|\phi_n\|_r^2 y_n

(using ⟨y,ϕn⟩\langle y, \phi_n \rangle with weight rr absorbed into the definitions, consistent with the weighted inner product throughout — both sides carry the rr-weighted pairing since L[y]−μry=fL[y] - \mu r y = f is an identity of functions, and pairing an identity of functions against ϕn\phi_n with respect to Lebesgue measure equals pairing against ϕn\phi_n with weight rr after absorbing rr into ff appropriately; concretely, ∫(L[y]−μry)ϕn dx=∫fϕn dx\int (L[y]-\mu r y)\phi_n\,dx = \int f\phi_n\,dx gives ∫L[y]ϕn dx−μ∫yϕnr dx=∫fϕn dx\int L[y]\phi_n\,dx - \mu \int y\phi_n r\,dx = \int f \phi_n\,dx, i.e. λn∥ϕn∥r2yn−μ∥ϕn∥r2yn=∥ϕn∥r2fn\lambda_n\|\phi_n\|_r^2 y_n - \mu\|\phi_n\|_r^2 y_n = \|\phi_n\|_r^2 f_n). Equating the two expressions for ⟨L[y],ϕn⟩\langle L[y],\phi_n\rangle and simplifying by ∥ϕn∥r2≠0\|\phi_n\|_r^2 \neq 0:

λnyn=fn+μyn⟹(λn−μ) yn=fn,n=1,2,3,…(†)\lambda_n y_n = f_n + \mu y_n \quad\Longrightarrow\quad (\lambda_n - \mu)\, y_n = f_n, \qquad n = 1,2,3,\dots \tag{†}

This is the diagonalized system: the differential equation (∗)(\ast) has become an infinite, uncoupled family of scalar linear equations, one for each Fourier coefficient yny_n.

Step 4: Case 1 — μ\mu is not an eigenvalue. For every nn, λn−μ≠0\lambda_n - \mu \neq 0, so (†)(\dagger) has the unique solution

yn=fnλn−μ.y_n = \frac{f_n}{\lambda_n - \mu}.

Hence, if a C2C^2 solution yy exists, its Fourier coefficients are forced to be exactly these, so the solution is unique and its expansion must be

y(x)=∑n=1∞fnλn−μ ϕn(x).y(x) = \sum_{n=1}^\infty \frac{f_n}{\lambda_n-\mu}\,\phi_n(x).

This proves uniqueness. For existence: since λn→∞\lambda_n \to \infty, the tail coefficients fn/(λn−μ)→0f_n/(\lambda_n-\mu) \to 0 faster than fnf_n itself relative to λn\lambda_n, and one shows (by the standard Lr2L^2_r completeness/Parseval argument) that ∑(fn/(λn−μ))2∥ϕn∥r2≤C∑fn2∥ϕn∥r2<∞\sum (f_n/(\lambda_n-\mu))^2 \|\phi_n\|_r^2 \le C\sum f_n^2\|\phi_n\|_r^2 < \infty since f∈Lr2f\in L^2_r, so the series converges in Lr2(a,b)L^2_r(a,b) to some function yy; this yy satisfies (∗)(\ast) in the weak (mean-square) sense by construction, since termwise it solves (†)(\dagger). When ff is Hölder continuous, standard elliptic-regularity/Sturm–Liouville estimates on the decay of ϕn\phi_n and λn∼n2\lambda_n \sim n^2 (Weyl asymptotics for regular problems) give absolute and uniform convergence of ∑λn−1∣fnϕn(x)∣\sum \lambda_n^{-1} |f_n \phi_n(x)| and its derivatives up to order two, which upgrades the Lr2L^2_r solution to a genuine C2C^2 classical solution satisfying the boundary conditions termwise (each ϕn\phi_n individually satisfies Ba=Bb=0B_a=B_b=0, and uniform convergence of the series and its first derivative passes the boundary conditions to the limit). This establishes existence, completing Case 1.

Step 5: Case 2 — μ=λk\mu = \lambda_k is an eigenvalue. Now equation (†)(\dagger) for n=kn=k reads

0⋅yk=fk,0 \cdot y_k = f_k,

which has a solution yk∈Ry_k \in \mathbb{R} (in fact infinitely many, any real number) if and only if fk=0f_k = 0, i.e.

⟨f,ϕk⟩r=0.\langle f, \phi_k\rangle_r = 0.

This is precisely the stated solvability condition. If fk≠0f_k \neq 0 the equation 0=fk0=f_k is false, so no coefficients {yn}\{y_n\} satisfy (†)(\dagger) for all nn, hence by the forcing argument of Step 4 no C2C^2 solution of (∗)(\ast) can exist: necessity of the condition is proved. For sufficiency, suppose fk=0f_k = 0. For n≠kn \neq k, (†)(\dagger) again gives the unique value yn=fn/(λn−λk)y_n = f_n/(\lambda_n-\lambda_k), while for n=kn=k, (†)(\dagger) becomes 0=00=0, satisfied by any real number yk=:Cy_k =: C. Define

y(x)=∑n≠kfnλn−λkϕn(x)+Cϕk(x).y(x) = \sum_{n\neq k} \frac{f_n}{\lambda_n-\lambda_k}\phi_n(x) + C\phi_k(x).

By the same convergence argument as Step 4 (the sum over n≠kn\neq k converges in Lr2L^2_r, and under Hölder continuity of ff converges uniformly with two derivatives), yy is a well-defined C2C^2 function satisfying the boundary conditions (each term does, individually, and uniform convergence passes this to the sum). One checks directly, by reversing Step 3's computation, that this yy satisfies L[y]−λkry=fL[y]-\lambda_k r y = f: indeed ⟨L[y]−λkry,ϕn⟩=(λn−λk)∥ϕn∥r2yn=∥ϕn∥r2fn\langle L[y]-\lambda_k r y,\phi_n\rangle = (\lambda_n-\lambda_k)\|\phi_n\|_r^2 y_n = \|\phi_n\|_r^2 f_n for every nn by construction (including n=kn=k, where both sides are 00), and since {ϕn}\{\phi_n\} is complete, an Lr2L^2_r function with all these Fourier coefficients matching ff's must equal ff a.e., hence (both being continuous) everywhere. This proves yy solves (∗)(\ast), establishing sufficiency and the explicit family of solutions parametrized by CC. ■\blacksquare

∎

Worked examples

Example 1 (Dirichlet rod with a non-symmetric, non-resonant load). Solve

y′′+y=x(1−x)2,y(0)=0,y(1)=0,y'' + y = x(1-x)^2, \qquad y(0) = 0, \quad y(1) = 0,

on [0,1][0,1], using eigenfunction expansion, and compare to direct integration. Here L[y]=−y′′L[y] = -y'', so the equation is L[y]−μy=fL[y] - \mu y = f with μ=1\mu = 1 and f(x)=−x(1−x)2f(x)=-x(1-x)^2 (rewriting y′′+y=x(1−x)2y''+y=x(1-x)^2 as −y′′−(−1)y=−x(1−x)2-y'' - (-1)y = -x(1-x)^2, i.e. −y′′−μy=f-y'' -\mu y = f with μ=−1\mu=-1; to avoid sign bookkeeping we instead work directly with the operator as given). Take p≡1,q≡0,r≡1p\equiv1,q\equiv0,r\equiv1 on [0,1][0,1] with Dirichlet conditions. The eigenpairs of −ϕ′′=λϕ-\phi'' = \lambda \phi, ϕ(0)=ϕ(1)=0\phi(0)=\phi(1)=0, are the classical ones:

λn=n2π2,ϕn(x)=sin⁡(nπx),n=1,2,3,…,∥ϕn∥2=∫01sin⁡2(nπx) dx=12.\lambda_n = n^2\pi^2, \qquad \phi_n(x) = \sin(n\pi x), \qquad n=1,2,3,\dots, \qquad \|\phi_n\|^2 = \int_0^1 \sin^2(n\pi x)\,dx = \tfrac12.

The ODE y′′+y=x(1−x)2y''+y = x(1-x)^2 is −y′′−y=−x(1−x)2-y'' - y = -x(1-x)^2, i.e. in the form L[y]−μy=fL[y]-\mu y = f with μ=1\mu = 1 and f(x)=−x(1−x)2f(x) = -x(1-x)^2. Since μ=1\mu=1 is not of the form n2π2n^2\pi^2 for any integer nn (as π2≈9.87\pi^2\approx 9.87, so n2π2∈{9.87,39.5,… }n^2\pi^2 \in \{9.87, 39.5,\dots\}, never equal to 11), we are in Case 1: a unique solution exists. Compute the Fourier coefficients of f(x)=−x(1−x)2=−x+2x2−x3f(x) = -x(1-x)^2 = -x + 2x^2 - x^3:

fn=⟨f,ϕn⟩∥ϕn∥2=2∫01−x(1−x)2sin⁡(nπx) dx.f_n = \frac{\langle f,\phi_n\rangle}{\|\phi_n\|^2} = 2\int_0^1 -x(1-x)^2\sin(n\pi x)\,dx.

Using the standard moments ∫01xsin⁡(nπx) dx=−cos⁡(nπ)nπ=(−1)n+1nπ\int_0^1 x\sin(n\pi x)\,dx = \dfrac{-\cos(n\pi)}{n\pi} = \dfrac{(-1)^{n+1}}{n\pi}, and (by integration by parts twice more, or tables) the exact value

∫01x(1−x)2sin⁡(nπx) dx=(−1)n+1nπ−4[1−(−1)n]n3π3,\int_0^1 x(1-x)^2 \sin(n\pi x)\,dx = \frac{(-1)^{n+1}}{n\pi} - \frac{4\big[1-(-1)^n\big]}{n^3\pi^3},

(a direct computation via three integrations by parts of x(1−x)2=x−2x2+x3x(1-x)^2 = x - 2x^2+x^3 against sin⁡(nπx)\sin(n\pi x), tracking boundary terms which vanish since sin⁡(nπx)\sin(n\pi x) and its relevant antiderivative structure vanish appropriately at 0,10,1 for the polynomial parts — the algebra is routine and each step is a standard reduction formula for ∫xksin⁡(nπx) dx\int x^k \sin(n\pi x)\,dx), we get

fn=−2[(−1)n+1nπ−4[1−(−1)n]n3π3]=2(−1)nnπ+8[1−(−1)n]n3π3.f_n = -2\left[\frac{(-1)^{n+1}}{n\pi} - \frac{4[1-(-1)^n]}{n^3\pi^3}\right] = \frac{2(-1)^n}{n\pi} + \frac{8[1-(-1)^n]}{n^3\pi^3}.

By Case 1 of the theorem, with λn−μ=n2π2−1\lambda_n - \mu = n^2\pi^2 - 1,

yn=fnn2π2−1=1n2π2−1(2(−1)nnπ+8[1−(−1)n]n3π3),y_n = \frac{f_n}{n^2\pi^2 - 1} = \frac{1}{n^2\pi^2-1}\left(\frac{2(-1)^n}{n\pi} + \frac{8[1-(-1)^n]}{n^3\pi^3}\right),

and the solution is

y(x)=∑n=1∞ynsin⁡(nπx).y(x) = \sum_{n=1}^\infty y_n \sin(n\pi x).

Consistency check. For nn even, 1−(−1)n=01-(-1)^n = 0, so yn=2nπ(n2π2−1)y_n = \dfrac{2}{n\pi(n^2\pi^2-1)}, which decays like n−3n^{-3}; for nn odd, yn=−2nπ(n2π2−1)+16n3π3(n2π2−1)y_n = \dfrac{-2}{n\pi(n^2\pi^2-1)} + \dfrac{16}{n^3\pi^3(n^2\pi^2-1)}, dominant term also O(n−3)O(n^{-3}). Since ff is a polynomial vanishing at both endpoints (so effectively C∞C^\infty with matching boundary values), the coefficients decay like n−3n^{-3} as expected for a function whose second derivative does not itself vanish at the boundary — consistent with the general Fourier-decay heuristics, and the series converges absolutely and uniformly by comparison with ∑n−3\sum n^{-3}, confirming a genuine C2C^2 classical solution as guaranteed by the theorem.

Example 2 (Robin condition at one end, weight r(x)=xr(x)=x — a genuinely non-symmetric Sturm–Liouville setting, resonant case). Consider the Cauchy–Euler-type Sturm–Liouville problem coming from L[y]=−(xy′)′L[y] = -(xy')' on [1,e][1,e] with weight r(x)=1/xr(x) = 1/x, i.e. the eigenvalue problem

−(xy′)′=λyx,y(1)=0,y(e)=0.-(xy')' = \lambda \frac{y}{x}, \qquad y(1) = 0, \qquad y(e) = 0.

Substituting x=etx = e^t turns −(xy′)′-(xy')' into −ytt-y_{tt} (the standard reduction for Euler-type operators: with t=ln⁡xt=\ln x, xddx=ddtx\frac{d}{dx} = \frac{d}{dt}, and one checks (xy′)′⋅x=x2y′′+xy′=ytt(xy')' \cdot x = x^2 y'' + xy' = y_{tt} under this substitution, so −(xy′)′=−ytt/x-(xy')' = -y_{tt}/x, matching λy/x\lambda y/x exactly when −ytt=λy-y_{tt} = \lambda y), and tt ranges over [0,1][0,1] as xx ranges over [1,e][1,e]. With y(1)=0,y(e)=0y(1)=0,y(e)=0 becoming y(t=0)=0,y(t=1)=0y(t=0)=0, y(t=1)=0, we recover

λn=n2π2,ϕn(x)=sin⁡(nπln⁡x),n=1,2,3,…\lambda_n = n^2\pi^2, \qquad \phi_n(x) = \sin(n\pi \ln x), \qquad n = 1,2,3,\dots

as eigenfunctions of the original problem in xx, with weight r(x)=1/xr(x)=1/x:

∥ϕn∥r2=∫1esin⁡2(nπln⁡x) dxx=∫01sin⁡2(nπt) dt=12.\|\phi_n\|_r^2 = \int_1^e \sin^2(n\pi \ln x)\,\frac{dx}{x} = \int_0^1 \sin^2(n\pi t)\,dt = \frac12.

Now solve the resonant inhomogeneous problem at μ=λ2=4π2\mu = \lambda_2 = 4\pi^2:

−(xy′)′−4π2yx=cos⁡(πln⁡x)x,y(1)=y(e)=0.-(xy')' - 4\pi^2\frac{y}{x} = \frac{\cos(\pi \ln x)}{x}, \qquad y(1)=y(e)=0.

Here f(x)=cos⁡(πln⁡x)/xf(x) = \cos(\pi\ln x)/x; in the tt-variable f(t)=cos⁡(πt)f(t) = \cos(\pi t) (matching the weight r=1/xr=1/x correctly, since the pairing ⟨f,ϕn⟩r=∫1efϕn dxx=∫01cos⁡(πt)sin⁡(nπt) dt\langle f,\phi_n\rangle_r = \int_1^e f\phi_n\,\frac{dx}{x} = \int_0^1 \cos(\pi t)\sin(n\pi t)\,dt). Compute f2=⟨f,ϕ2⟩r/∥ϕ2∥r2f_2 = \langle f,\phi_2\rangle_r / \|\phi_2\|_r^2:

∫01cos⁡(πt)sin⁡(2πt) dt=12∫01[sin⁡(3πt)+sin⁡(πt)]dt=12(1−cos⁡3π3π+1−cos⁡ππ)=12(23π+2π)=43π.\int_0^1 \cos(\pi t)\sin(2\pi t)\,dt = \frac12\int_0^1 \big[\sin(3\pi t)+\sin(\pi t)\big]dt = \frac12\left(\frac{1-\cos 3\pi}{3\pi} + \frac{1-\cos\pi}{\pi}\right) = \frac12\left(\frac{2}{3\pi} + \frac{2}{\pi}\right) = \frac{4}{3\pi}.

So ⟨f,ϕ2⟩r=4/(3π)≠0\langle f,\phi_2\rangle_r = 4/(3\pi) \neq 0. By Case 2 of the theorem with k=2k=2: since f2≠0f_2 \ne 0 (equivalently ⟨f,ϕ2⟩r≠0\langle f, \phi_2\rangle_r \ne 0), the solvability condition ⟨f,ϕk⟩r=0\langle f,\phi_k\rangle_r = 0 fails, so this resonant problem has no solution at all — the eigenfunction expansion method correctly detects and certifies non-existence, which direct integration would only reveal after a much longer computation (or would obscure entirely). Contrast this with f(x)=sin⁡(2πln⁡x)/xf(x) = \sin(2\pi \ln x)/x, i.e. f(t)=sin⁡(2πt)=ϕ2(t)f(t) = \sin(2\pi t) = \phi_2(t) exactly: then ⟨f,ϕ2⟩r=∫01sin⁡2(2πt) dt=1/2≠0\langle f,\phi_2\rangle_r = \int_0^1 \sin^2(2\pi t)\,dt = 1/2 \ne 0 also fails, so that choice is resonant and unsolvable too — whereas f(t)=sin⁡(3πt)f(t) = \sin(3\pi t) gives ⟨f,ϕ2⟩r=∫01sin⁡(3πt)sin⁡(2πt) dt=0\langle f,\phi_2\rangle_r = \int_0^1 \sin(3\pi t)\sin(2\pi t)\,dt = 0 (orthogonal distinct modes), so the solvability condition holds, and the problem −(xy′)′−4π2y/x=sin⁡(3πln⁡x)/x-(xy')' - 4\pi^2 y/x = \sin(3\pi\ln x)/x, y(1)=y(e)=0y(1)=y(e)=0, has the family of solutions

y(x)=∑n≠2fnn2π2−4π2sin⁡(nπln⁡x)+Csin⁡(2πln⁡x),y(x) = \sum_{n\neq 2}\frac{f_n}{n^2\pi^2-4\pi^2}\sin(n\pi\ln x) + C\sin(2\pi\ln x),

with f3=1f_3 = 1 contributing the term 19π2−4π2sin⁡(3πln⁡x)=15π2sin⁡(3πln⁡x)\dfrac{1}{9\pi^2-4\pi^2}\sin(3\pi\ln x) = \dfrac{1}{5\pi^2}\sin(3\pi\ln x) and all other fn=0f_n=0, so explicitly

y(x)=15π2sin⁡(3πln⁡x)+Csin⁡(2πln⁡x),C∈R arbitrary.y(x) = \frac{1}{5\pi^2}\sin(3\pi\ln x) + C\sin(2\pi\ln x), \qquad C\in\mathbb{R}\text{ arbitrary}.
CounterexampleDropping self-adjointness (mismatched boundary conditions) breaks orthogonality and the whole expansion

The proof of the theorem rests entirely on Step 1: the boundary term [p(u′v−uv′)]ab\big[p(u'v-uv')\big]_a^b must vanish for every pair u,vu,v satisfying the same separated boundary conditions. Suppose instead we deliberately use mismatched conditions — impose y(0)=0y(0)=0 at x=0x=0 but test against functions satisfying a different condition at x=1x=1, say ψ(1)+ψ′(1)=0\psi(1) + \psi'(1) = 0 instead of ϕ(1)=0\phi(1)=0 — while still trying to expand in the "wrong" family. Concretely, on [0,1][0,1] take L[y]=−y′′L[y]=-y'', r≡1r\equiv1, and let {ϕn=sin⁡(nπx)}\{\phi_n=\sin(n\pi x)\} be the genuine Dirichlet eigenfunctions (ϕn(0)=ϕn(1)=0\phi_n(0)=\phi_n(1)=0), with λn=n2π2\lambda_n=n^2\pi^2. Now try to solve

−y′′=f(x),y(0)=0,y(1)+y′(1)=0,-y'' = f(x), \qquad y(0)=0,\qquad y(1)+y'(1)=0,

a Robin condition at x=1x=1, by (incorrectly) expanding in the Dirichlet eigenfunctions ϕn=sin⁡(nπx)\phi_n=\sin(n\pi x), since they are the "familiar" basis. Take f(x)=1f(x)=1. Formally following the Case-1 formula with the wrong eigenfunctions gives fn=2∫01sin⁡(nπx) dx=2(1−(−1)n)nπf_n = 2\int_0^1 \sin(n\pi x)\,dx = \frac{2(1-(-1)^n)}{n\pi}, hence a candidate

y~(x)=∑nfnn2π2sin⁡(nπx).\tilde y(x) = \sum_n \frac{f_n}{n^2\pi^2}\sin(n\pi x).

But y~(1)=∑nfnn2π2sin⁡(nπ)=0\tilde y(1) = \sum_n \frac{f_n}{n^2\pi^2}\sin(n\pi) = 0 termwise for every nn, so y~(1)=0\tilde y(1)=0 identically, forcing y~′(1)\tilde y'(1) to also have to satisfy y~(1)+y~′(1)=y~′(1)=0\tilde y(1)+\tilde y'(1) = \tilde y'(1) = 0 — but direct solution of −y′′=1-y''=1, y(0)=0y(0)=0 gives y(x)=12x(1−x)+Cxy(x) = \tfrac12 x(1-x) + Cx for the general solution consistent with y(0)=0y(0)=0, and imposing the true Robin condition y(1)+y′(1)=0y(1)+y'(1)=0 forces C=12⋅12C = \tfrac{1}{2}\cdot\tfrac{1}{2}-type algebra yielding C≠0C\ne 0 generically, so the true solution does not vanish at x=1x=1 in general — contradicting y~(1)=0\tilde y(1)=0 forced by using the wrong basis. The mismatch is exactly because Step 1's boundary term [p(u′v−uv′)]01[p(u'v-uv')]_0^1 fails to vanish when u=y~u=\tilde y obeys a Robin condition at x=1x=1 but v=ϕnv=\phi_n obeys Dirichlet there: p(1)(u′(1)v(1)−u(1)v′(1))=1⋅(0−u(1)v′(1))=−u(1)v′(1)≠0p(1)\big(u'(1)v(1) - u(1)v'(1)\big) = 1\cdot(0 - u(1)v'(1)) = -u(1)v'(1) \neq 0 in general, since v′(1)=nπcos⁡(nπ)≠0v'(1) = n\pi\cos(n\pi)\neq 0. Self-adjointness — and with it, orthogonality, diagonalization, and the entire method — collapses the moment the trial and test functions satisfy different boundary conditions.

Scope, edge cases & common traps

SituationWhat to checkConsequence if ignored
μ\mu equals an eigenvalue λk\lambda_kCompute ⟨f,ϕk⟩r\langle f,\phi_k\rangle_rMethod silently gives a divergent or nonexistent "0/00/0" coefficient
Boundary conditions of yy vs. of ϕn\phi_nMust be identical separated conditionsOrthogonality (self-adjointness) fails; series is meaningless
f∉Lr2f\notin L^2_rCheck ∫f2r dx<∞\int f^2 r\,dx<\inftyFourier coefficients may not even be defined
Weight rr dropped or mis-setEvery inner product, norm, and solvability test uses rrWrong coefficients, wrong orthogonality claims
Non-self-adjoint operator (mixed/periodic w/o symmetry)Confirm the Lagrange boundary term vanishesEigenfunctions need not be orthogonal at all
Pointwise vs. mean-square convergenceNeed Hölder/C1C^1 smoothness of ff for uniform convergenceSeries may converge in Lr2L^2_r but not to f(x)f(x) at a point of discontinuity

The mathematician behind it

Origins · 1 minCharles-François Sturm and how this was discovered
CS
Charles-François Sturm
1803–1855 · 19th-century France, Sturm–Liouville theory

Sturm, working alongside Joseph Liouville in the 1830s, studied the qualitative behavior of solutions to second-order linear differential equations arising from problems in heat conduction and vibrating strings. Their joint theory — what we now call Sturm–Liouville theory — established the existence of countably many real eigenvalues and orthogonal eigenfunctions for a broad class of boundary value problems, laying the foundation for every eigenfunction expansion used in physics and engineering since.

History
- 1822 — Fourier's Théorie analytique de la chaleur introduces trigonometric series to solve the heat equation, the prototype eigenfunction expansion.
- 1829-1836 — Sturm publishes his oscillation and comparison theorems for second-order linear ODEs.
- 1836-1837 — Liouville, building on Sturm's work, establishes eigenfunction expansion and completeness results for the general self-adjoint problem.
- 1894-1913 — Hilbert and Schmidt develop the theory of integral equations and self-adjoint operators, placing Sturm–Liouville expansions inside a general Hilbert-space framework.
- 1920s-1930s — von Neumann's spectral theorem for self-adjoint operators subsumes Sturm–Liouville theory as a special (discrete-spectrum) case.
What exactly makes an eigenfunction expansion "generalized" compared to an ordinary Fourier series?

An ordinary Fourier series expands ff in sines and cosines, which are the eigenfunctions of the specific operator L=−d2/dx2L=-d^2/dx^2 with periodic or Dirichlet/Neumann conditions and weight r≡1r\equiv1. A generalized (eigenfunction) expansion replaces {sin⁡,cos⁡}\{\sin,\cos\} with the eigenfunctions of any regular Sturm–Liouville operator — possibly with variable coefficients p(x),q(x)p(x),q(x) and a nontrivial weight r(x)r(x) — such as Legendre polynomials, Bessel functions, or Chebyshev polynomials. The coefficient formula, orthogonality relation, and convergence theory are structurally identical; only the specific basis functions and weight change.

Why does the method fail when μ\mu equals an eigenvalue, and what does that failure mean physically?

When μ=λk\mu=\lambda_k, the diagonalized equation for the kk-th mode becomes 0⋅yk=fk0\cdot y_k = f_k, which is either impossible (if fk≠0f_k\ne0) or satisfied by any yky_k (if fk=0f_k=0). Physically, μ=λk\mu=\lambda_k means the forcing is applied at exactly a natural frequency/mode of the system — resonance. If any component of the forcing lies along that resonant mode (fk≠0f_k\ne 0), a bounded steady-state solution cannot exist (physically, the amplitude would grow without bound over time in the corresponding time-dependent problem). If the forcing happens to be orthogonal to the resonant mode, the system tolerates the resonance and a (non-unique) bounded solution exists.

Do I need to verify completeness of the eigenfunctions every time I use this method?

No. Completeness of {ϕn}\{\phi_n\} in Lr2(a,b)L^2_r(a,b) is a general theorem for any regular Sturm–Liouville problem (self-adjoint, p>0p>0, q,rq,r continuous, separated boundary conditions on a finite interval), proved once in Sturm-Liouville Theory. You verify the hypotheses of that general theorem (regularity of p,q,rp,q,r, the interval being bounded, separated boundary conditions), not completeness itself for each new problem.

How does this method relate to solving a linear system Ax=bAx=b by diagonalizing a symmetric matrix AA?

The analogy is exact. A symmetric matrix AA has an orthonormal eigenbasis {vn}\{v_n\} with real eigenvalues λn\lambda_n; writing x=∑cnvnx=\sum c_nv_n, b=∑bnvnb=\sum b_nv_n, the equation Ax=bAx=b becomes λncn=bn\lambda_nc_n=b_n for each nn. This is invertible (unique solution) exactly when no λn=0\lambda_n=0; when some λk=0\lambda_k=0, Ax=bAx=b is solvable iff bk=0b_k=0 (Fredholm alternative in finite dimensions), matching Case 2 of the theorem exactly. Sturm–Liouville eigenfunction expansion is this finite-dimensional fact carried over to the infinite-dimensional space Lr2(a,b)L^2_r(a,b), with LL playing the role of AA.

Can this method handle boundary conditions that are inhomogeneous, e.g. y(a)=A≠0y(a)=A\ne 0?

Not directly — the theorem as stated requires yy to satisfy the same homogeneous boundary conditions as the eigenfunctions, since that is what makes the self-adjointness (Lagrange identity) argument work. The standard fix is to first subtract off any smooth function w(x)w(x) satisfying the inhomogeneous boundary data (e.g. a linear function matching y(a)=Ay(a)=A, y(b)=By(b)=B), reducing to a new unknown v=y−wv=y-w that satisfies homogeneous conditions and an inhomogeneous ODE L[v]−μrv=f−(L[w]−μrw)L[v]-\mu r v = f - (L[w]-\mu r w), which the theorem now applies to directly.

What is the connection to Green's functions?

Case 1 of the theorem gives a solution as a series y=∑fnϕn/(λn−μ)y=\sum f_n\phi_n/(\lambda_n-\mu). Writing out fnf_n as an integral and interchanging sum and integral (justified under suitable convergence) shows that y(x)=∫abG(x,s)f(s)r(s) dsy(x)=\int_a^b G(x,s)f(s)r(s)\,ds for the kernel G(x,s)=∑nϕn(x)ϕn(s)/[(λn−μ)∥ϕn∥r2]G(x,s)=\sum_n \phi_n(x)\phi_n(s)/\big[(\lambda_n-\mu)\|\phi_n\|_r^2\big]. This kernel GG is exactly the Green's function for the operator L−μrL-\mu r with the given boundary conditions: the eigenfunction expansion is the spectral (series) representation of the same inverse operator that the Green's function represents as an integral kernel.

Does the method work if q(x)q(x) or r(x)r(x) change sign, or the interval is infinite?

Not as stated. The theorem requires p>0p>0, r>0r>0 on a bounded interval [a,b][a,b] (a regular Sturm–Liouville problem), which guarantees a discrete, unbounded, increasing sequence of real eigenvalues. If the interval is infinite or pp or rr vanishes/blows up at an endpoint (a singular Sturm–Liouville problem, e.g. Bessel's or Legendre's equation on natural domains), the spectrum can become partly or wholly continuous, the sums must be replaced by integrals over a continuous spectral parameter, and separate convergence theorems (Weyl's theory of singular Sturm–Liouville problems) are required; the discrete-sum theorem proved here does not apply verbatim.

Before this

Where this leads