# Enigmatic optimization problem

My problem, which I proposed to myself months ago is based on the simple optimization problem

in which you find the best path for a lifeguard to rescue a drowning victim. Obviously the

shortest path is a straight line, but the catch is he swims more slowly than he runs. I

solved the problem and then attempted with 3 different speeds (beach, water, and weeds, or

something of the sort). The difficulty didn't set in until I allowed the difficulty of

traversing a point in the plane vary continuously. How do I find an optimal path?

-
A related question that occurred to me is if the lifeguard is working against (or with) a vector field, in which case I suppose you would use variational calculus to minimize the line integral from point a to b... Or is that incorrect? – Platonix Apr 13 '13 at 7:47
Think of the diffraction of light at the surface between air and water, and about the law that is valid there. – Christian Blatter Apr 13 '13 at 8:25
I'm afraid I was never much good at physics, how could I set up a differential equation for this? Also, isn't there a big difference b/w one change in medium and continuous variation? – Platonix Apr 13 '13 at 8:36

At time $t=0$ the life guard is at $(0,0)$ in the $(x,y)$-plane, and the drowning swimmer is at the point $(a,b)$ in the first quadrant. The speed of the life guard is a given function $x\mapsto v(x)$ $\ (0\leq x\leq a)$ of $x$ alone.
Then one can set up the following variational problem with a constraint: Denote by $p(x)$ the slope of the life guard's orbit when his abscissa is $x$. Then $dt$ and $dx$ are related by $$dt={ds\over v(x)} ={\sqrt{1+p^2(x)}\over v(x)}\ dx\ .$$ Therefore we should minimize $$T:=\int_0^a {\sqrt{1+p^2(x)}\over v(x)}\ dx$$ under the constraint $$\int_0^a p(x)\ dx=b\ .$$ This is a standard variational problem. The constraint is dealt with using a Lagrange multiplier.
For the discontinuous version of this, meaning $v(x)=v_1$ for $0\leq x\leq c$ and $v(x)=v_2$ for $c\leq x\leq a$, see Snell's law at Wikipedia.