\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\newcommand{\undb}{\underbrace}
\newcommand{\pl}{\partial}
\parindent=0pt
\begin{document}
In what follows you may assume that the following notation applies

$$y=y(x),\ y'=\ds\frac{dy}{dx}.$$

You may also assume that, unless otherwise stated, $y$ is a
sufficiently continuously differentiable function.

{\bf Question}

The speed of light in a medium depends on a quantity $\epsilon$
and is given by $v=\ds\frac{C}{\sqrt{\epsilon}}$ where $c$ is
constant. A ray of light travels from $A=(a,\alpha)$ to
$B=(b,\beta)$ is a medium where the speed varies with height only,
i.e. $\epsilon=\epsilon(y)$.

Justify briefly that the time taken for the ray to travel an
infinitesimal distance $ds$ at height $y$ is given by
$dt=\ds\frac{ds}{v(y)}$. Hence show that the total time taken to
travel between $A$ and $B$ is

$$t=\ds\int_A^B
\ds\frac{ds}{v(y)}=\ds\int_a^b\,dx\sqrt{1+{y'}^2}\left(\ds\frac
{\sqrt{\epsilon(y)}}{c}\right)=\ds\int_a^b\,dxF(y,y')$$

If the ray travels in the least possible time between these
points, using the appropriate special case of the Euler equation
show that the ray's path $y=y(x)$ satisfies
$K^2(1+{y'}^2)=\epsilon$ for some constant $K$. Deduce that if
$\epsilon=\epsilon(y)$, the ray travels in a parabola with the
axis vertical.



\medskip

{\bf Answer}

In general for distance travelled $ds$ in $dt$ we have
$\ds\frac{ds}{dt}=V$ where $V$ is the speed

$\Rightarrow dt=\ds\frac{ds}{V(y)}$ is $V$ just depends on $y$
explicitly

Thus we have total time of flight

$\begin{array} {crcl} & \ds\int_0 ^t \, dt & = & \ds\int_A ^B
\ds\frac{ds}{V(y)}-\\ \Rightarrow & t & = & \ds\int_A ^B
\ds\frac{ds}{V(y)}=\ds\int_{x=a}^{x=b} \,dx
\ds\frac{\sqrt{1+{y'}^2}}{V(y)}\\ \Rightarrow & t & = &
\ds\int_a^b dx \underbrace{
\sqrt{1+{y'}^2}\left(\ds\frac{\sqrt{\epsilon(y)}}{c}\right)}
\end{array}$

Clearly this is only an explicit function of $F=F(y,y')$

if the rays follow the path of least time, use the E-L equation
for $F=F(y,y')$:

\newpage
$y'\ds\frac{\pl F}{\pl y'}-F=const$

$\ds\frac{\pl F}{\pl
y'}=\ds\frac{y'}{\sqrt{1+{y'}^2}}\ds\frac{\sqrt{\epsilon(y)}}{c}$

Therefore $\ds\frac{{y'}^2\sqrt{\epsilon(y)}}{\sqrt{1+{y'}^2}}{c}-
\sqrt{1+{y'}^2}\ds\frac{\sqrt{\epsilon(y)}}{c}=const$

$\Rightarrow \ds\frac{\sqrt{\epsilon(y)}}{c\sqrt{1+{y'}^2}}=const$

$\Rightarrow \un{\epsilon(y)=(1+{y'}^2)K^2}$ for some constant
$K$.

Thus $\epsilon(y)=(1+{y'}^2)K^2=y$ from question

$\Rightarrow Ky'=\pm\sqrt{y-K^2}$

$\Rightarrow \un{y=K^2+\ds\frac{(x+c)^2}{4K^2}}$ (by standard
integrals)

which as a parabola as required.

\end{document}
