Hello, Jukixel!

Town A is 11 miles from a straight river and town B is 6 miles from the same river.

The distance from town A to town B is 13 miles.

A pumping station is to be built along the river to supply water to both towns.

Where should the pumping station be built so that the sum of the distances

from the pumping station to the towns is a minimum?

There are two stages to this problem . . .

First, find the "horizontal" distance between the two towns.

In the diagram below, right triangle $\displaystyle ABE$ has side 5 and hypotenuse 13.

. . Hence: .$\displaystyle AB \,=\,CD \,=\,12$ Code:

A * - - - - - - - - - - - - - * B
| :
| * : 5
| 13 * :
11 | * E
| |
| |
| | 6
| |
- * - - - - - - - - - - - - - * -
C D

Then the diagram looks like this . . . Code:

A *
| *
| *
| *
11 | * * E
| * * |
| * * |
| * * | 6
| * * |
* - - - - - - - - *- - - - *
C x P 12-x D

The pumping station is at $\displaystyle P.$

Let $\displaystyle CP \,=\,x \quad\Rightarrow\quad PD \,=\,12-x $

In right triangle $\displaystyle ACP\!:\;\;AP \,=\,\sqrt{x^2+11^2}$

In right triangle $\displaystyle EDP\!:\;\;PE \,=\,\sqrt{(12-x)^2+6^2}$

The total distance from $\displaystyle P$ to the towns is:

. . $\displaystyle D \:=\:\sqrt{x^2+121} + \sqrt{x^2 - 24x + 180}$

And __that__ is function you must minimize . . .