Pool of acid, optimal path Evil Dr.Friendless have kidnapped Gregors family and attached them with a bomb.
this bomb will is impossible to unwire unless you use a special key. Which of course Dr.Friendless have placed on inside a monkey at the bottom of a swimming pool he dumped acid into. 
The pool is given by the equation 
$$ f(x,y) = - \frac{2}{5}x - 1, \quad x,y \in (0,10) $$
And after a certain time the amount of acid at the point $x,y,z$ is given by the vectorfunction 
$$ A(x,y,z) = 10- \frac{x}{10} - y - \frac{z}{5} $$
As pointed out Gregor needs to swim from the end of the pool at $(0,0,0)$ to the bottom $(10,10,-5)$ to retrieve the key. If the tries anything fancy as walking around the pool, or using a diving mask Dr.Friendless instantly fries his family. 


*

*The question now is: What is the optimal path Gregor can swim from $(0,0,0)$ to $(10,10,-5)$ to obtain the least amount of poison? 


That is to say to minimize the line integral 
$$ \int_{(0,0,0)}^{(10,10,-5)} A(\overrightarrow{r}(t)) \overrightarrow{\mathbf{r'}}(t)\,\mathrm{d}t $$
by finding the optimal parametrization. 
I tried a few paths, like a straight line and going along the edge, but was unable to see how I could work out the path which contained the least amount of acid. 

 A: The path which minimizes the integral
$$\int_{(0,0,0)}^{(10,10,-5)} A(\overrightarrow{r}(t)) |\overrightarrow{\mathbf{r'}}(t)|\,\mathrm{d}t = \int_{(0,0,0)}^{(10,10,-5)} A(\overrightarrow{r}(s)) ds$$
is given by the differential equation
$$\frac{d^2}{d s^2} \overrightarrow{r}(s) = \frac{1}{2}\overrightarrow{\nabla}[A(\overrightarrow{r}(s))^2] = \left(\frac{x}{100}+\frac{y}{10}+\frac{z}{50}-1,\frac{x}{10}+ y+\frac{z}{5}-10,\frac{x}{50}+\frac{y}{5}+\frac{z}{25}-2\right)$$
where $s$ is an arc length parameter, which I choose to normalize such that the above integral corresponds to $s=0$ to $s=1$.  The equation results from Fermat's Principle and is equivalent to the Principle of Least Action, which in classical mechanics results in Newton's law.  In optics, the acid distribution is equivalent to an index of refraction, and the equation for ray-tracing in a variable index (known as gradient index) medium results from this equation.
We may solve this set of couple differential equations with the boundary conditions
$$\overrightarrow{r}(0)=(0,0,0)$$
$$\overrightarrow{r}(1)=(10,10,-5)$$
The result is (obtained with Mathematica):
$$[x(s),y(s),z(s)]=\left[\frac{10 \left(-19 s-2 e^{-\frac{1}{2} \sqrt{\frac{21}{5}} (s-2)}+2
   e^{\frac{1}{2} \sqrt{\frac{21}{5}} s}+e^{\sqrt{\frac{21}{5}}} (19
   s+2)-2\right)}{21 \left(e^{\sqrt{\frac{21}{5}}}-1\right)},\frac{10 \left(-s-20
   e^{-\frac{1}{2} \sqrt{\frac{21}{5}} (s-2)}+20 e^{\frac{1}{2} \sqrt{\frac{21}{5}}
   s}+e^{\sqrt{\frac{21}{5}}} (s+20)-20\right)}{21
   \left(e^{\sqrt{\frac{21}{5}}}-1\right)},\frac{5 \left(e^{\sqrt{\frac{21}{5}}}
   (8-29 s)-8 e^{-\frac{1}{2} \sqrt{\frac{21}{5}} (s-2)}+8 e^{\frac{1}{2}
   \sqrt{\frac{21}{5}} s}+29 s-8\right)}{21
   \left(e^{\sqrt{\frac{21}{5}}}-1\right)}\right]$$
remembering that $s \in [0,1]$.  You can compute how much acid is absorbed along this path by integrating the acid distribution along this path.  
