Answer
See the detailed answer below.
Work Step by Step
$$\color{blue}{\bf [a]}$$
We know that the speed is given by $v=d/t$, so the time it takes to travel a distance of $d$ is given by
$$t=\dfrac{d}{v}$$
We have here two trips with two different speeds, the speed of light in air and the speed of light in liquid.
The speed of light is given by $v=c/n$ where $c$ is the absolute speed of light in vacuum and $n$ is the index of refraction of the material that the light goes through it.
So the time interval of the first trip is given by $t_1=d_1n_1/c$, and the time interval of the second trip is given by $t_2=d_2n_2/c_2$.
Thus the total time of the whole journey is given by
$$t=t_1+t_2=\dfrac{d_1n_1}{c}+\dfrac{d_2n_2}{c}\tag 1$$
From the geometry of the given figure, it is obvious that
$$d_1=\sqrt{x^2+a^2}$$
and that
$$d_2=\sqrt{(w-x)^2+b^2}$$
Plug these two equations into (1),
$$t =\dfrac{ n_1\sqrt{x^2+a^2}}{c}+\dfrac{ n_2\sqrt{(w-x)^2+b^2}}{c} $$
Thus,
$$\boxed{t=\dfrac{1}{c}\left[ n_1\sqrt{x^2+a^2}+ n_2\sqrt{(w-x)^2+b^2}\right]}$$
$$\color{blue}{\bf [b]}$$
We can take the derivative of the previous equation with respect to $x$ where $dt/dt=0$ to find the minimum value of $x$.
Hence,
$$ \dfrac{d }{dx}\left( \dfrac{1}{c}\left[ n_1\sqrt{x^2+a^2}+ n_2\sqrt{(w-x)^2+b^2}\right] \right)=0$$
$$ \dfrac{d }{dx} \left[ n_1\sqrt{x^2+a^2}+ n_2\sqrt{(w-x)^2+b^2}\right] =0\tag 2$$
where
$$\frac{d}{dx}\sqrt{x^2+b^2} = \frac{2x}{2\sqrt{x^2+b^2}} = \frac{x}{\sqrt{x^2+b^2}}$$
and,
$$\frac{d}{dx}\sqrt{(w-x)^2+b^2} = \frac{-2(w-x)}{2\sqrt{(w-x)^2+b^2}} =- \frac{w-x}{\sqrt{(w-x)^2+b^2}}$$
Plugging the last two results into (2),
$$ \boxed{ \frac{n_1x}{\sqrt{x^2+b^2}}-\frac{n_2(w-x)}{\sqrt{(w-x)^2+b^2}} =0} $$
The solution of this formula will give us $x_{\rm min}$ but the author told us that there is no need to solve it and you will know why is part c below.
$$\color{blue}{\bf [c]}$$
From the geometry of the given graph, it is obvious that
$$\sin\theta_1=\dfrac{x}{d_1}=\dfrac{x}{\sqrt{x^2+a^2}}$$
and that
$$\sin\theta_2=\dfrac{w-x}{d_2}=\dfrac{w-x}{\sqrt{(w-x)^2+b^2}}$$
Plugging these two results into the last boxed formula above,
$$n_1\left[ \frac{x}{\sqrt{x^2+b^2}}\right]-n_2\left[\frac{(w-x)}{\sqrt{(w-x)^2+b^2}} \right]=0 $$
$$n_1\sin\theta_1-n_2\sin\theta_2=0 $$
Therefore,
$$\boxed{n_1\sin\theta_1=n_2\sin\theta_2} $$
which is Snell's law.