---
title: Boundary value problems and standing waves
heading: Conditions at both ends
eyebrow: A8 · Lesson 50 · Boundary value problems
xp: 40
---

::: hook
A guitar string is pinned at both ends, so it can vibrate only in shapes that are zero at both ends: half a wave, a whole wave, a wave and a half. A length of transmission line shorted at both ends resonates only at frequencies where a whole number of half-wavelengths fit. These are **boundary value problems**: instead of starting values at one point, there are conditions at two. They behave very differently from the problems so far. Usually there's no solution at all except zero, and only at special values, the **eigenvalues**, does a real vibration appear.
:::

::: play
- The curve is the $n$th mode shape of a string or line of length $L$ held at zero at both ends: $\sin\frac{n\pi x}{L}$.
- Raise $n$. Count the points inside where it stays at zero (the nodes).
- The readout gives the mode's frequency for a wave speed $v$.
:::
:::

```sim plot
view: graph
x: x = 0..2 m
y: y = -1.2..1.2
slider: n = 1..6 step 1 = 2
slider: L = 0.5..2 step 0.1 = 1 m
slider: v = 50..300 step 10 = 100 m/s
plot: sin(n*pi*x/L)*(1 - step(x - L)) | label: mode n | samples: 1200
marker: x = L | label: far end
readout: frequency = n*v/(2*L) Hz | digits: 4
readout: nodes inside = n - 1
```

::: predict
## Solve $y'' + y = 0$ with $y(0) = 0$ and $y(\pi) = 1$. How many solutions are there?

- [ ] Exactly one
- [x] None
- [ ] Two
- [ ] Infinitely many

::: reveal
None. Every solution with $y(0) = 0$ is $c\sin x$, and $c\sin\pi = 0$, never 1. With $y(\pi) = 0$ instead, every $c\sin x$ works: infinitely many. Boundary value problems can have no solution, one, or infinitely many, unlike starting-value problems, which (lesson 11) have exactly one.
:::
:::

::: nameit
## Boundary value problems

A **boundary value problem** gives conditions at two points, such as $y(0) = a$, $y(L) = b$. You solve the equation in general, then try to fit both conditions. Whether that works depends on the equation and the interval.

**Steady heat flow** in a rod with ends held at temperatures $T_0$ and $T_L$ and no internal heat obeys $y'' = 0$: a straight line between them. With uniform internal heating $q$ (in suitable units), $y'' = -q$ with $y(0) = y(L) = 0$ gives a parabola, $y = \frac{q}{2}x(L - x)$, hottest in the middle at $\frac{qL^2}{8}$.

## The eigenvalue problem

For $y'' + \lambda y = 0$ with $y(0) = y(L) = 0$, the zero solution always works. A nonzero solution exists only for

$$\lambda_n = \left(\frac{n\pi}{L}\right)^2, \qquad y_n = \sin\frac{n\pi x}{L}, \qquad n = 1, 2, 3, \ldots$$

the **eigenvalues** and **eigenfunctions**: the same idea as $A\mathbf{x} = \lambda\mathbf{x}$, with a differential operator in place of a matrix. Mode $n$ has $n - 1$ nodes inside the interval.

## Standing waves

For a wave with speed $v$ on a string or a transmission line shorted at both ends, mode $n$ fits $n$ half-wavelengths: $\lambda_\text{wave} = \frac{2L}{n}$ and

$$f_n = \frac{nv}{2L}$$

These are the harmonics of a string and the resonances of a cavity or a shorted line (C10, S6). The eigenfunctions $\sin\frac{n\pi x}{L}$ are orthogonal on $[0, L]$, which is what lets A10 and A12 build any shape out of them as a Fourier series.
:::

::: example
## A transmission line 1.5 m long, with signals traveling at $2 \times 10^8$ m/s, is shorted at both ends. What are its lowest resonances?

::: solution
1. **Resonances of a line shorted at both ends.**
   $$\begin{aligned} f_n &= \frac{nv}{2L} \\ &= n \times \frac{2 \times 10^8}{3}\ \text{Hz} \\ &= n \times 66.7\ \text{MHz} \end{aligned}$$
2. **The lowest few.** $n = 1, 2, 3$ give 66.7, 133 and 200 MHz, and so on.

**Answer:** 66.7, 133 and 200 MHz, and on up in steps of 66.7 MHz.
:::
:::

::: example
## A rod of length 2 m with both ends at 0 °C has uniform heating giving $y'' = -5$ (°C/m²). How hot is the middle?

::: solution
1. **Temperature profile.**
   $$y = \frac{5}{2}x(2 - x)$$
2. **At the middle.** It peaks at $x = 1$:
   $$\begin{aligned} y(1) &= \frac{5}{2} \times 1 \times 1 \\ &= 2.5\ \text{°C} \end{aligned}$$
3. **Check.** The formula $\frac{qL^2}{8} = \frac{5 \times 4}{8}$ agrees.

**Answer:** the middle is at 2.5 °C.
:::
:::

::: example
## For which $\lambda$ does $y'' + \lambda y = 0$ with $y(0) = 0$ and $y'(1) = 0$ have a nonzero solution?

::: solution
1. **Use the first condition.** For $\lambda > 0$, $y(0) = 0$ leaves $y = \sin(\sqrt\lambda x)$.
2. **Use the second condition.** It needs $\cos\sqrt\lambda = 0$, so $\sqrt\lambda = \frac\pi2, \frac{3\pi}{2}, \ldots$, and
   $$\lambda_n = \left(\frac{(2n - 1)\pi}{2}\right)^2$$
3. **The lowest one.**
   $$\begin{aligned} \lambda_1 &= (\pi/2)^2 \\ &= 2.467 \end{aligned}$$
4. **What the modes are.** The modes are quarter waves, three-quarter waves and so on: a line shorted at one end and open at the other, or a pipe closed at one end.

**Answer:** $\lambda_n = \left((2n - 1)\pi/2\right)^2$, starting at $\lambda_1 = 2.467$.
:::
:::

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

## What is the {n}th eigenvalue of $y'' + \lambda y = 0$, $y(0) = y(\given{L}) = 0$?

::: right
Right. $\left(\frac{n\pi}{L}\right)^2$ = {answer}.
:::

::: misses
- [n*pi/L] That's the wavenumber; $\lambda$ is its square.
- [(n*pi*L)^2] Divide by $L$: longer intervals give smaller eigenvalues.
- [any] Not yet. Fit $\sin(\sqrt\lambda x)$ to zero at $x = L$.
:::
:::

::: check
given: v = 100 | 340; L = 0.65 | 2; n = 1 | 2
answer: n*v/(2*L)
unit: Hz
tolerance: 0.5%

## A string {L} m long, with waves traveling at {v} m/s, is fixed at both ends. What is the frequency of mode {n}?

::: right
Right. $\frac{nv}{2L}$ = {answer}.
:::

::: misses
- [n*v/L] Mode 1 fits half a wavelength, not a whole one.
- [n*v/(4*L)] That's a pipe or line open at one end.
- [any] Not yet. Mode $n$ fits $n$ half-wavelengths.
:::
:::

::: check
given: n = 3 | 5 | 8
answer: n - 1

## How many nodes does mode {n} have strictly inside the interval?

::: right
Right. $\sin\frac{n\pi x}{L}$ is zero at $x = \frac{kL}{n}$ for $k = 1, \ldots, n - 1$: {answer}.
:::

::: misses
- [n] Don't count the ends.
- [n + 1] That counts both ends.
- [any] Not yet. Count the zeros of $\sin\frac{n\pi x}{L}$ between 0 and $L$.
:::
:::

::: check
given: q = 4 | 10; L = 1 | 3
answer: q*L^2/8
tolerance: 0.5%

## $y'' = -\given{q}$ on $[0, \given{L}]$ with $y(0) = y(L) = 0$. What is the largest value of $y$?

::: right
Right. $y = \frac{q}{2}x(L - x)$ peaks at the middle with $\frac{qL^2}{8}$ = {answer}.
:::

::: misses
- [q*L^2/4] Evaluate $\frac{q}{2}x(L - x)$ at $x = L/2$.
- [q*L^2/2] That's not the peak of the parabola.
- [any] Not yet. Integrate twice and fit both ends.
:::
:::

::: check
given: L = 0.5 | 3; v = 2e8 | 1.5e8
answer: v/(2*L)/1e6
unit: MHz
tolerance: 0.5%

## A transmission line {L} m long is shorted at both ends, with a wave speed of {v} m/s. What is its lowest resonance?

::: right
Right. $\frac{v}{2L}$ = {answer}.
:::

::: misses
- [v/L/1e6] The lowest mode fits half a wavelength.
- [any] Not yet. $f_1 = \frac{v}{2L}$.
:::
:::

::: check
kind: choice

## For which right-end value $b$ does $y'' + y = 0$, $y(0) = 0$, $y(\pi) = b$ have infinitely many solutions?

- [x] $b = 0$
- [ ] $b = 1$
- [ ] Any $b$
- [ ] No $b$

::: right
Right. With $b = 0$, every $c\sin x$ fits both ends; for $b \ne 0$, none does.
:::

::: misses
- [2] $c\sin\pi = 0$ for every $c$, so 1 is out of reach.
- [3] Only one value of $b$ can be reached.
- [any] What is $c\sin\pi$?
:::
:::

::: check
kind: parts
given: L = 1 | 1.5 | 3; v = 2 | 3

## A line {L} m long carries signals at {v}e8 m/s and is shorted at both ends.

::: part
answer: v*1e8/(2*L)/1e6
unit: MHz
tolerance: 0.5%

### What is its lowest resonant frequency?

::: misses
- [v*1e8/(4*L)/1e6] Shorted at both ends, it holds a half wave, not a quarter.
- [any] $f_1 = \frac{v}{2L}$.
:::
:::

::: part
answer: 3*v*1e8/(2*L)/1e6
unit: MHz
tolerance: 0.5%

### What is its third?

::: misses
- [any] $f_n = nf_1$.
:::
:::
:::

::: check
kind: derivation
vars: q = 1..10, L = 0.5..3, x = 0..0.5

## Solve $y'' = -q$ on $[0, L]$ with $y(0) = y(L) = 0$.

::: step
answer: q*x*(L - x)/2

### What is $y(x)$?
:::

::: step
answer: q*L^2/8

### What is $y$ at the middle?
:::

::: right
Right. A parabola: uniform heating or a uniform load gives $\frac{qL^2}{8}$ at the center.
:::
:::

::: explain
## Why does $y'' + \lambda y = 0$ with $y(0) = y(L) = 0$ have nonzero solutions only for special values of $\lambda$?

::: model
The condition at $x = 0$ forces the solution to be $c\sin(\sqrt\lambda x)$ (for $\lambda > 0$; other signs give only zero). That curve then has to come back to zero exactly at $x = L$, which happens only when $\sqrt\lambda L$ is a whole multiple of $\pi$. For any other $\lambda$, the only way to satisfy both ends is $c = 0$. Physically, a string pinned at both ends can only vibrate in shapes that fit a whole number of half-waves between the pins, and each such shape has its own frequency.
:::
:::

::: practice

::: check
given: n = 2 | 4; L = 1 | 2
answer: 2*L/n
unit: m
tolerance: 0.5%

## What is the wavelength of mode {n} on a string {L} m long, fixed at both ends?

::: misses
- [L/n] Each half-wavelength is $L/n$.
- [any] $\frac{2L}{n}$.
:::
:::

::: check
given: T0 = 20 | 50; TL = 80 | 100; L = 2 | 4; x = 1 | 0.5
answer: T0 + (TL - T0)*x/L
unit: °C
tolerance: 0.5%

## A rod of length {L} m with no internal heat has its ends at {T0} °C and {TL} °C. What is the temperature at $x$ = {x} m?

::: misses
- [any] $y'' = 0$: a straight line between the ends.
:::
:::

::: check
given: f1 = 110 | 82.4; n = 2 | 5
answer: n*f1
unit: Hz
tolerance: 0.5%

## A string's lowest mode is {f1} Hz. What is the frequency of mode {n}?

::: misses
- [any] $f_n = nf_1$.
:::
:::
:::
