---
title: Sturm–Liouville problems and eigenfunction expansions
heading: Why sines, cosines and their cousins always come out orthogonal
eyebrow: A12 · Lesson 34 · Sturm–Liouville problems and eigenfunction expansions
xp: 40
---

::: hook
Every separation of variables so far ended in the same place: a second-order equation in space, boundary conditions at the two ends, and a list of special values λ for which it has a nonzero solution. With both ends held at zero the answers were sines; with insulated ends, cosines. Change one end to a surface cooled by air and the answers are still sine-like shapes, at frequencies that come from a transcendental equation instead of a formula. **Sturm–Liouville theory** says what all these problems share: real eigenvalues that march off to infinity, and eigenfunctions that are orthogonal, so any reasonable initial condition can be expanded in them, just like a Fourier series.
:::

::: play
- A rod has one end held at 0 and the other cooled by convection: $X'(1) + hX(1) = 0$. With $X = \sin\mu x$, that condition reads $g(\mu) = \mu\cos\mu + h\sin\mu = 0$. Each zero of the curve gives an eigenvalue $\lambda = \mu^2$.
- Set h to 0 (an insulated end): the first zero sits at $\pi/2$. Raise h toward large values (an end held at 0): it slides up toward π. Every real end lies between those two limits.
- The higher zeros behave the same way, each trapped in its own interval of width π.
:::
:::

```sim plot
view: graph
x: mu = 0..10
y: g = -12..12
slider: h = 0..30 step 0.1 = 1
plot: (mu*cos(mu) + h*sin(mu))/sqrt(1 + h^2/25) | label: g(μ), scaled
marker: mu = pi/2 | label: π/2
marker: mu = pi | label: π
marker: mu = 3*pi/2 | label: 3π/2
marker: mu = 2*pi | label: 2π
readout: g at π/2 (positive once h > 0) = h/sqrt(1 + h^2/25)
readout: g at π (always negative) = -pi/sqrt(1 + h^2/25)
```

::: predict
## A rod has one end held at 0 and the other insulated. What's its lowest eigenvalue λ₁ for $X'' + \lambda X = 0$ on $0 < x < L$?

- [ ] $(\pi/L)^2$
- [x] $(\pi/2L)^2$
- [ ] 0
- [ ] $(2\pi/L)^2$

::: reveal
$(\pi/2L)^2$: the shape $\sin(\pi x/2L)$ is zero at 0 and flat at L, a quarter of a sine wave. That's a quarter of the fixed-ends eigenvalue, so this rod's slowest mode decays four times more slowly than one held at 0 at both ends.
:::
:::

::: nameit
## The Sturm–Liouville form

$$\big(p(x)\,y'\big)' + q(x)\,y + \lambda\,w(x)\,y = 0 \quad\text{on } a < x < b$$

with $p > 0$ and the **weight** $w > 0$, and at each end a condition $\alpha y + \beta y' = 0$ (Dirichlet, Neumann or Robin). $X'' + \lambda X = 0$ is the case $p = w = 1$, $q = 0$; Bessel's equation (lesson 39) is $p = x$, $w = x$.

## What's guaranteed

1. The eigenvalues are real and can be ordered $\lambda_1 < \lambda_2 < \cdots \to \infty$.
2. The n-th eigenfunction has $n - 1$ zeros inside the interval.
3. Eigenfunctions for different eigenvalues are **orthogonal with weight w**: $\int_a^b \phi_m\phi_n w\,dx = 0$ for $m \ne n$.
4. They're complete: a piecewise smooth f expands as $f = \sum c_n\phi_n$ with

$$c_n = \frac{\int_a^b f\,\phi_n\,w\,dx}{\int_a^b \phi_n^2\,w\,dx}$$

## Common end conditions for $X'' + \lambda X = 0$ on $(0, L)$

| Ends | $\lambda_n$ | $\phi_n$ |
|---|---|---|
| fixed, fixed | $(n\pi/L)^2$ | $\sin(n\pi x/L)$ |
| insulated, insulated | $(n\pi/L)^2$, n = 0, 1, ... | $\cos(n\pi x/L)$ |
| fixed, insulated | $\left(\frac{(2n - 1)\pi}{2L}\right)^2$ | $\sin\frac{(2n - 1)\pi x}{2L}$ |
| fixed, convective $X' + hX = 0$ | roots of $\mu\cos\mu L + h\sin\mu L = 0$ | $\sin\mu_n x$ |

## The Rayleigh quotient

For fixed ends, $\lambda_1 \le \frac{\int_0^L u'^2\,dx}{\int_0^L u^2\,dx}$ for any trial u that's zero at both ends, with equality only for the true eigenfunction. A rough guess gives a close upper bound.
:::

::: example
## A rod's end at x = 1 loses heat by convection with $h = 1$, and its end at 0 is held at 0. Find $\lambda_1$.

::: solution
1. **The equation for μ.** Solve
   $$\mu\cos\mu + \sin\mu = 0$$
   that is $\tan\mu = -\mu$, between $\pi/2$ and π.
2. **Bisect.** Bisection gives $\mu_1 = 2.0288$, so
   $$\begin{aligned} \lambda_1 &= \mu_1^2 \\ &= 4.116 \end{aligned}$$
3. **Check.** It lies between the insulated value $(\pi/2)^2 = 2.47$ and the fixed value $\pi^2 = 9.87$, as it must.

**Answer:** $\lambda_1 = 4.116$.
:::
:::

::: example
## Estimate $\lambda_1$ for $X'' + \lambda X = 0$ on (0, 1) with fixed ends, using the trial function $u = x(1 - x)$.

::: solution
1. **The two integrals.**
   $$\int_0^1 (1 - 2x)^2dx = \frac13$$
   $$\int_0^1 x^2(1 - x)^2dx = \frac{1}{30}$$
2. **The quotient.**
   $$\frac{1/3}{1/30} = 10$$
3. **Compare.** The true value is $\pi^2 = 9.870$: a parabola guess lands within 1.3%.

**Answer:** the estimate is $\lambda_1 \approx 10$, within 1.3% of the true $\pi^2 = 9.870$.
:::
:::

::: example
## On (0, 1) with $X(0) = 0$ and $X'(1) = 0$, the eigenfunctions are $\sin k_nx$ with $k_n = \frac{(2n - 1)\pi}{2}$. Expand $f(x) = x$ in them.

::: solution
1. **The coefficient formula.** The eigenfunctions are orthogonal, each with $\int_0^1\sin^2k_nx\,dx = \frac12$, so
   $$c_n = 2\int_0^1x\sin k_nx\,dx$$
2. **Integrate by parts.**
   $$\int_0^1x\sin kx\,dx = \frac{\sin k - k\cos k}{k^2}$$
   and at $k_n$, $\cos k_n = 0$ and $\sin k_n = (-1)^{n+1}$.
3. **The coefficients.**
   $$\begin{aligned} c_n &= \frac{2(-1)^{n+1}}{k_n^2} \\ &= \frac{8(-1)^{n+1}}{(2n - 1)^2\pi^2} \end{aligned}$$
   so $c_1 = 0.811$ and $c_2 = -0.0901$, falling as $1/n^2$.
4. **Check at x = 1.** Every $\sin k_n = \pm1$ matches the sign of $c_n$, and the sum
   $$\begin{aligned} \frac{8}{\pi^2}\sum\frac{1}{(2n - 1)^2} &= \frac{8}{\pi^2}\cdot\frac{\pi^2}{8} \\ &= 1 \end{aligned}$$
   is exactly f(1). The series converges at the insulated end too, because these eigenfunctions don't vanish there.

**Answer:** $c_n = \frac{8(-1)^{n+1}}{(2n - 1)^2\pi^2}$, so $c_1 = 0.811$ and $c_2 = -0.0901$.
:::
:::

::: check
given: L = 0.1 | 0.5 | 2; n = 1 | 2 | 3
answer: ((2*n - 1)*pi/(2*L))^2
unit: m^-2
tolerance: 0.5%

## A rod of length {L} m has one end held at 0 and the other insulated. What's eigenvalue $\lambda_{\given{n}}$?

::: right
Right. $\left(\frac{(2n - 1)\pi}{2L}\right)^2$ = {answer} m⁻².
:::

::: misses
- [(n*pi/L)^2] That's for two fixed ends; with one insulated end the modes are odd quarter-waves.
- [any] Not yet. $\phi_n = \sin\frac{(2n - 1)\pi x}{2L}$.
:::
:::

::: check
given: L = 0.02 | 0.05 | 0.1; a = 0.0001 | 0.00002
answer: 4*L^2/(a*pi^2)
unit: s
tolerance: 0.5%

## A fin of length {L} m (diffusivity {a} m²/s) has its base held at a fixed temperature and its tip insulated. What's its slowest time constant?

::: right
Right. $\frac{1}{\alpha\lambda_1} = \frac{4L^2}{\alpha\pi^2}$ = {answer} s.
:::

::: misses
- [L^2/(a*pi^2)] That's for both ends fixed; the insulated tip makes the slow mode four times slower.
- [any] Not yet. $\tau = 1/(\alpha\lambda_1)$ with $\lambda_1 = (\pi/2L)^2$.
:::
:::

::: check
given: n = 1 | 2 | 3 | 4
answer: 4/((2*n - 1)*pi)
tolerance: 0.5%

## On (0, L), expand $f = 1$ in the eigenfunctions $\sin\frac{(2n - 1)\pi x}{2L}$. What's $c_{\given{n}}$?

::: right
Right. $\frac{4}{(2n - 1)\pi}$ = {answer}.
:::

::: misses
- [2/((2*n - 1)*pi)] The norm $\int_0^L\phi_n^2dx$ is $L/2$, which doubles the result.
- [any] Not yet. $c_n = \int_0^L\phi_n\,dx\Big/\int_0^L\phi_n^2\,dx$.
:::
:::

::: check
given: L = 1 | 2 | 0.5
answer: 10/L^2
unit: m^-2
tolerance: 0.5%

## For fixed ends on (0, {L}), what's the Rayleigh quotient of the trial function $u = x(L - x)$?

::: right
Right. $\frac{L^3/3}{L^5/30} = 10/L^2$ = {answer}, just above the true $\pi^2/L^2$.
:::

::: misses
- [pi^2/L^2] That's the exact eigenvalue; this trial function gives a slightly higher number.
- [any] Not yet. $\int_0^L(L - 2x)^2dx = L^3/3$ and $\int_0^L x^2(L - x)^2dx = L^5/30$.
:::
:::

::: check
given: L = 1 | 3; m = 1 | 2; n = 3 | 4
answer: 0*L
tolerance: 0.001

## What's $\int_0^{\given{L}}\sin\frac{\given{m}\pi x}{L}\sin\frac{\given{n}\pi x}{L}\,dx$?

::: right
Right. 0: different eigenfunctions of the same problem are orthogonal.
:::

::: misses
- [L/2] That's the integral of one of them squared.
- [any] Not yet. Different eigenvalues, so orthogonal.
:::
:::

::: check
kind: choice

## Bessel's equation, $(xy')' + \left(\lambda x - \frac{m^2}{x}\right)y = 0$, is in Sturm–Liouville form. With what weight are its eigenfunctions orthogonal?

- [ ] 1
- [x] x
- [ ] $x^2$
- [ ] $1/x$

::: misses
- [1] The weight is the factor multiplying λ.
- [3] λ multiplies $x$, not $x^2$.
- [4] That's the factor on the $m^2$ term; the weight goes with λ.
:::
:::

::: check
kind: parts
given: L = 0.5 | 1 | 2

## On (0, {L}) with $u(0) = 0$ and $u'(L) = 0$, try $u = x(2L - x)$ in the Rayleigh quotient $\frac{\int u'^2}{\int u^2}$.

::: part
answer: 2.5/L^2
tolerance: 0.5%

### What estimate of $\lambda_1$ does it give?

::: misses
- [any] $\int_0^L(2L - 2x)^2\,dx = \frac{4L^3}{3}$ and $\int_0^Lx^2(2L - x)^2\,dx = \frac{8L^5}{15}$.
:::
:::

::: part
answer: pi^2/(4*L^2)
tolerance: 0.5%

### What is the exact $\lambda_1$?

::: misses
- [pi^2/L^2] That's for two fixed ends; an insulated end fits a quarter wave.
- [any] $\left(\frac{\pi}{2L}\right)^2$.
:::
:::
:::

::: check
kind: derivation
vars: L = 0.5..2

## Check the trial function $u = x(2L - x)$ step by step.

::: step
answer: 4*L^3/3

### What is $\int_0^Lu'^2\,dx$?
:::

::: step
answer: 8*L^5/15

### What is $\int_0^Lu^2\,dx$?
:::

::: step
answer: 5/(2*L^2)

### What is the Rayleigh quotient?
:::

::: right
Right. $\frac{2.5}{L^2}$ against the exact $\frac{2.467}{L^2}$: 1.3% high, and never below, since the Rayleigh quotient of any trial function is at least $\lambda_1$.
:::
:::

::: explain
## Why must a convectively cooled end give a first eigenvalue between the insulated and the fixed cases?

::: model
The end condition $X' + hX = 0$ interpolates between the two: at $h = 0$ it's the insulated end ($X' = 0$), and as h grows without bound it forces $X \to 0$, the fixed end. The first zero of $\mu\cos\mu + h\sin\mu$ moves continuously and steadily upward with h, from $\pi/2$ at h = 0 toward π as h → ∞. Physically, cooling through the end is easier than through no end but harder than through an end clamped to the cold temperature, so the slowest decay rate lies between the two.
:::
:::

::: practice

::: check
given: L = 0.3 | 1.5; n = 2 | 4
answer: ((2*n - 1)*pi/(2*L))^2
unit: m^-2
tolerance: 0.5%

## $\lambda_{\given{n}}$, fixed and insulated ends, L = {L} m?

::: misses
- [any] $\left(\frac{(2n - 1)\pi}{2L}\right)^2$.
:::
:::

::: check
given: L = 0.03 | 0.2; a = 0.00005 | 0.0001
answer: 4*L^2/(a*pi^2)
unit: s
tolerance: 0.5%

## Slowest τ, base fixed, tip insulated, L = {L} m, α = {a}?

::: misses
- [any] $4L^2/(\alpha\pi^2)$.
:::
:::

::: check
given: n = 1..9 int
answer: 4/((2*n - 1)*pi)
tolerance: 0.5%

## $c_{\given{n}}$ for f = 1 in quarter-wave sines?

::: misses
- [any] $\frac{4}{(2n - 1)\pi}$.
:::
:::
:::
