= Solution
The <Fermat principle> makes the <optical path length> stationary. For a graph $y=\xi(x)$ the variational integrand is
$$
\mathcal L(x,\xi,\xi')=n(x,\xi)\sqrt{1+\xi'^2}.
$$
The <Euler-Lagrange equation> is
$$
\frac d{dx}\left[\frac{n(x,\xi)\xi'}{\sqrt{1+\xi'^2}}\right]-n_y(x,\xi)\sqrt{1+\xi'^2}=0.
$$
Use the <chain rule> $d n(x,\xi(x))/dx=n_x+n_y\xi'$ and differentiate $\xi'/\sqrt{1+\xi'^2}$ to obtain
$$
\frac{(n_x+n_y\xi')\xi'}{\sqrt{1+\xi'^2}}+\frac{n\xi''}{(1+\xi'^2)^{3/2}}-n_y\sqrt{1+\xi'^2}=0.
$$
Multiplying through and combining the $n_y$ terms gives the required second-order <ordinary differential equation> with no derivatives in denominators:
$$
\boxed{n(x,\xi)\xi''=(1+\xi'^2)[n_y(x,\xi)-\xi'n_x(x,\xi)].}
$$
All partial <derivatives> of the <refractive index> are evaluated along the ray.
Back to article page