All the lettered points in Fig. P17-1 lie in one plane. The line $C D$ separates the plane into two regions: on the left, a wave has the speed $w$; and on the right, the speed $w^{\prime}$. Show by the method of Lagrangian multipliers that the time for the wave to travel the path $A P B$ is a minimum when $w / w^{\prime}=\sin \phi / \sin \phi^{\prime}$.