Calculus problem - swimmer on a beach - MIT OCW problemset I'm trying to solve this problem from MIT OCW :
A swimmer is on the beach at a point A. The closest point on the straight shoreline to A is called P. There is a platform in the water at B, and the nearest point on the shoreline to B is called Q. Suppose that the distance from A to P is 100 meters, the distance from B to Q is 100 meters and the distance from P to Q is a meter. Finally, suppose that the swimmer can run at 5 meters per second on the beach and swim at 2 meters per second in the water.

Show that the path the swimmer should take to get to the platform in the least time has the property that the ratio of the sines of the angles the path makes with the shoreline is the reciprocal of the ratio of the speeds in the two regions: sin(α)/sin(β)=5/2
I end up with this equation : $\frac{x}{5\sqrt{100^2+x^2}}-\frac{(a-x)}{2\sqrt{100^2+(a-x)^2}}$,
and the first part is cos(α) not sin(α).
can anyone tell me from this equation how we move to reach the desired proof?
thanks in advance.
 A: Note that in the original source, it is stated:
$$\frac{\sin \vec{a}}{\sin \vec{b}}=\frac52.$$ 
and here it is stated that $\alpha$ is the angle between the normal and the boundary:

Hence, the time function is:
$$f(x)=\frac{\sqrt{x^2+100^2}}{5}+\frac{\sqrt{(a-x)^2+100^2}}{2}$$
whose derivative must be set equal to zero:
$$f'(x)=\frac{x}{5\sqrt{x^2+100^2}}-\frac{a-x}{2\sqrt{(a-x)^2+100^2}}=0 \Rightarrow \\
\frac15\cos \alpha=\frac12\cos \beta \Rightarrow \\
\frac15\sin (90^\circ-\alpha)=\frac12\sin (90^\circ-\beta) \Rightarrow \\
\frac{\sin \vec{a}}{\sin \vec{b}}=\frac52. $$
So, it is a matter of which angle to consider for $\vec{a}$ and $\vec{b}$.
A: DISCLAIMER: I know you were looking for a mathematical proof of the statement..but I just wanted to share this solution which I found interesting..
There is an ingenious solution to this problem which uses Snell's law from optics..
Assuming that the question requires the quickest path for the swimmer...by Fermat's principle, we know that light always takes the quickest path when it travels between any two points..so we just take the speed of light to be $5m/s$ in land and $2m/s$ in water.
Here the angle of incidence is $\alpha$ and the angle of refraction is $\beta$. We know that refractive index of a medium is inversely proportional to the absolute speed of light in that medium..Thus by Snell's law, we have..
$$n_1\sin(\alpha)=n_2\sin(\beta)$$
Here $n_1$ and $n_2$ are the "refractive indices" of the land and water respectively. Thus we have
$$\frac{k}{5}\sin(\alpha)=\frac{k}{2}\sin(\beta)$$ 
Here $k$ is the constant of proportionality. And hence we have
$$\frac{\sin(\alpha)}{\sin(\beta)}=\frac{5}{2}$$
