So I was trying to solve a problem I saw in a practice set for a 6th-grade math competition, as far as I can remember it. It was a story problem, but I think the solution is the minimum value of
$$ \sqrt{x^2 + 25} + \sqrt{(5-x)^2 + 49} $$
for $x$ in the interval $[0,5]$. I know the derivative at a minimum should be zero, so
$$ {x \over \sqrt{x^2+25}} + {x-5 \over \sqrt{(5-x)^2 + 49}} = 0 $$
I can see by experimentation that the answer is close to $13$, with $x$ close to $2.08$. However, I get stuck after that. If I write as
$$ {x \over \sqrt{x^2+25}} = {5-x \over \sqrt{(5-x)^2 + 49}} $$
can I multiply both sides by the product of the denominators? Can I square both sides? When I do that, I get a fourth-degree polynomial on each side, but the fourth-degree and third-degree term cancel out; and the I'm left with a quadratic equation whose roots are nowhere near the interval I need.
More generally, is there an analytical solution for
$$ \min\left(\sqrt{x^2+y_0^2} + \sqrt{(x_0-x)^2+y_1^2}\right) $$
where $y_0$, $y_1$, and $x_0$ are positive constants?