Minimizing the length of a pipeline between cities I have been trying to minimize piping going to two different cities.  City A is located at $(0,4)$ and city B is located at $(6,3)$.  The cities must connect to the $x$-axis (the main pipe line.)  It is allowed to connect the piping from both cities to a middle point $M$ and then connect that point to the $x$-axis.
I've been able to set up a function giving length of the pipelines $f(x,y)$ using pythagorean theorem and adding up the three individual pipe lengths, and then minimizing numerically.  I've found trying to minimize exactly with derivatives yields high-powered polynomials, and I don't believe there's a general way to solve it.  Is there a more elegant way to find the minimum?
I have a friend who used a triangle center, I forget which one, to find the point, but he was not able to give me the coordinates this way.
Thanks for your help!
 A: You are looking for the Fermat point, $M(x)$, of the triangle whose vertices are $A=(6,3)$, $B=(0,4)$, and $C=(x,0)$, and trying to minimize the value
$$d(x)=|AM|+|BM|+|CM|$$
According to this calculation, the acute angles between $\overline{AM},\overline{BM},$ and $\overline{CM}$ are all $\frac{2\pi}{3}$.  Appealing to intuition, we see that $d(x)$ will be minimized when $M(x)=(x,y)$, that is, when $M$ sits directly above $C=(x,0)$.  Using these two facts, we see that the Fermat point $M$ minimizing $d$ will be the intersection of the following two lines:
$$y=-\frac{x}{\sqrt{3}}+4\\y=\frac{x-6}{\sqrt{3}}+3$$
This is because these lines pass through the known points $A$ and $B$, and intersect each other and any vertical line at acute angles of $\frac{2\pi}{3}$.  Their intersection occurs at $M=(3+\frac{\sqrt{3}}{2},\frac{7}{2}-\sqrt{3})$.  Hence $C=(3+\frac{\sqrt{3}}{2},0)$, and a calculation shows that the minimum length of piping required is then
$$d(3+\frac{\sqrt{3}}{2})=\frac{7}{2}+3\sqrt{3}$$
Here is a picture illustrating our triangle, and the two lines given above, intersecting at the Fermat point:
$\hspace{1.75in}$
This problem is related to the Motorway problem, which can be solved using soap bubbles, as is discussed in this entertaining video.
A: Let the pipelines be $AM$, $BM$ and $MX$. Then the choice of $M$ and $X$ are such that $|AM|+|BM|+|MX|$ is minimized. So, by $M$ being the optimal choice, it must be the Fermat point of $ABX$, and since $X$ is the optimal choice on the $x$-axis, $MX$ must be vertical. So, then we get $\angle AMB = \angle BMX = \angle XMA = 120^\circ$ and $M$ and $X$ have the same $x$ coordinate. This is enough to find the points $M$ and $X$, as in Jared's answer.
