Prove that Snell's law of refraction follows from Fermat's principle by using the geometry illustrated in part (b) of the figure below. Let $x$ be the unknown location of the point where the ray from $P_{1}$ to $P_{2}$ refracts at a horizontal surface. See the hint for Problem 1.
(a)
(b)