Example (Fermat's principle)

Fermat's principle states that light travels along paths between two points that minimise time taken.

See also example sheet 1 Q7.

Suppose in $\R^2$, light travels along a ray $y=y(x)$ and at $(x,y)$, its speed is $c(x,y)$. The time taken is $$ \begin{align*} F[y] = \int_{\alpha}^{\beta} \underbrace{ \frac{\sqrt{1+(y')^2}}{c(x,y)}}_{f(x,y,y')}\, dx. \end{align*} $$

If we assume $c$ to only depend on $x$, then $f$ does not depend on $y$, so we can use the first integral: $$ \begin{align*} \text{const.} = \pdfd{f}{y'} = \frac{y'}{\sqrt{1+(y')^2}} \frac{1}{c(x)}. \end{align*} $$

This is Snell's law: $$ \begin{align*} \frac{\sin(\theta_1)}{c(x_1)} = \frac{\sin(\theta_2)}{c(x_2)}. \end{align*} $$