This is a very interesting calculus word problem that I came across in an old textbook of mine. So I know its got something to do with minimising distance, but other than that, the textbook gave no hints really and I'm really not sure about how to approach it. However, I did manage to make a picture or diagram of it.

enter image description here

Any guidance hints or help would be truly greatly appreciated. Thanks in advance :) So anyway, here the problem goes:

A power house, $P$, is on one bank of a straight river $200\textrm{ m}$ wide, and a factory, $F$, is on the opposite bank $400\textrm{ m}$ downstream from $P$.

The cable has to be taken across the river, under water at a cost of $\text{\$}6/\textrm{m}$.

On land the cost is $\text{\$}3/\textrm{m}$.

What path should be chosen so that the cost is minimized?

Edit: Thanks guys, I think I found out the answer. I shall post it on MSE.

  • $\begingroup$ @ZevChonoles Wow! Thanks so much for the edits! Unfortunately I'm a noob at MSE too. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:30

6 Answers 6


Let me just get you started on the problem.

Let $x$ be the length of the cable on land, and $y$ be the length of the underwater cable.

Then, the cost, obviously, is $$C(x,y)=3x+6y$$

Can we find any other connection between $x$ and $y$? Of course we can! We know that $y$ is the hypothenuse of a right angled triangle. One of its sides is the width of the river, and the other is $400 - x$, meaning that $$y^2=200^2 + (400-x)^2$$

From these two equations (and the fact that $y>0$), you can determine the cost of the cable as a function of $x$, i.e. you get $C(x)$ which is a nice function of $x$. Then, all you have to do is find its minimum.

  • $\begingroup$ Oh ok thanks so much that helps a lot. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:37
  • 1
    $\begingroup$ Find angle as a function of q/w and, w/ FP' and cost ratio, where w is river width.That will give solution for all such problems. $\endgroup$
    – Narasimham
    Jun 18, 2015 at 8:22
  • $\begingroup$ @Narasimham Yes of course, thank you. $\endgroup$
    – anonymous
    Jun 18, 2015 at 9:51

We can borrow the optical refraction formula

Here the cost of cable can be considered to be the cost of time for light to go through water. Light always takes the fastest route.

let $\theta$ be the angel between cable and the banks, then we must have $\cos{\theta}=\frac{3}{6}*\cos{0}=\frac{1}{2}$. So $\theta=\frac{\pi}{6}$.

  • $\begingroup$ This just goes to show that there appear to many different ways to approach this problem, although I do not know the optical refraction formula. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:48
  • $\begingroup$ But my solution is the best.:) I did try all those analytical with differentiation approaches. They all give the correct answer, but they are all tedious and lack natural beauty. $\endgroup$
    – Indominus
    Jun 18, 2015 at 7:50
  • 7
    $\begingroup$ There is no such thing as "your solution is the best." They are simply different ways to approach the problem. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:51
  • 4
    $\begingroup$ I quite like the use of optical laws here. A more common problem is that of a lifeguard on a beach trying to reach a swimmer needing help at $P$ starting from his watchtower at $F$ and minimizing the time he needs. But calling it "the best" method may be a bit cocky :-) After all, what is best for the reader depends on the reader's background. $\endgroup$ Jun 18, 2015 at 7:57
  • 2
    $\begingroup$ Yes, you are right. $\endgroup$
    – Indominus
    Jun 18, 2015 at 9:10

Let $\theta$ be angle $P'PQ$. Then $PQ = 200\sec\theta$, and $FQ = 400 - 200\tan\theta$. We want to minimise the cost, which is $$C(\theta)=6PQ+3FQ = 1200\sec\theta+1200-600\tan\theta$$ The derivative is $$\frac{dC}{d\theta} = 1200\sec\theta\tan\theta - 600\sec^2\theta$$ and setting this to zero gives $2\tan\theta=\sec\theta$, or $\sin\theta=\frac12$.


So here is the diagram:

Please note the difference between P and P'

Let's look at the extreme cases first:

Straight across the river is $ \$200 m \cdot \$ 6m = \$1200$

$+ 400 m \ \text{on land} \cdot \$ 3m = \$1200$

Total: $ \$ 2400$

If we go diagonal, then by Pythagoras, it's $200 \sqrt 5 m \cdot \$6m = 1200 \sqrt 5 \approx \$2683$

Let the point straight across from P be P'.

Let's choose a landfall point Q, somewhere P' and F.

Let distance from P' to Q be q.

So total distance is

$\sqrt{200² + q²}$ (diagonal under the river) + 400 - q (on land)

Cost is $6 \cdot \sqrt{200² + q²} + 3 \cdot (400 - q)$

We want to minimize that.

First we can divide by 3 -- same value for q will be maximum.

$2 \cdot \sqrt{200² + q²} + 400 - q$

Derivative is

$2q \cdot \sqrt{200² + q²} - 1$

We set that to 0

$2q \cdot \sqrt{40000+q²} = 1$

$2q = \sqrt{40000+q²}$


$4 q² = 40000 + q^2$

$3 q² = 40000$

$q = 200 \sqrt 3$

Length under water is then $400 \sqrt 3 \approx 231$

and length on land is $400 - 200 \sqrt 3 \approx 284$

Cost is $6 \cdot 400\sqrt 3 + 3 (400 - 200\sqrt 3) = \$2239.23$

The triangle $P-P'-Q$ has sides $200 - 200\sqrt 3 - 400 \sqrt 3$

and therefore it is a 30-60-90 triangle.

The angle QPQ' = 30°.

  • 1
    $\begingroup$ I have done my last edit. Now you can replace the asterixs. $\endgroup$ Jun 18, 2015 at 8:22
  • $\begingroup$ @calculus thank you so much. $\endgroup$
    – anonymous
    Jun 18, 2015 at 8:43

The length between P and Q is $\sqrt{q^2+200^2}$ (pythagorean theorem)

And the distance between F and Q is $400-q$

Therefore the cost function is $C(q)=6 \cdot \sqrt{q^2+200^2}+3\cdot (400-q)$

Take the derivative and set it equal to zero. Then solve for q.

  • $\begingroup$ Yes that is what I did...see my answer to my own question above. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:42
  • 1
    $\begingroup$ I see. Your q is right. $\endgroup$ Jun 18, 2015 at 7:46
  • $\begingroup$ Thank you...However, because I am a noob, I do not know how to use the square root signs...If possible, could you edit my answer to use the appropriate symbols? $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:47
  • $\begingroup$ Kindly, thank you for your edits. $\endgroup$
    – anonymous
    Jun 18, 2015 at 7:57
  • 1
    $\begingroup$ You are welcome. $\endgroup$ Jun 18, 2015 at 8:04

You want to minimise the sum of the line across the water and the line along the river bank, each weighted by the unit cost for each section. Assuming the cable can only be run in a straight line across the river, your objective function would be:

$$Cost=6\times\sqrt{200^2+q^2}+3\times(400-q)$$ To minimise, take the first derivative with respect to q and let it equal zero. Solve for q. Note the constraint that $q>=0$. Check for a minimum turning point using the second derivative with respect to q.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .