# Finding the minimum of $f(x,y)$ by simple inspection

Let $$f(x,y) = \sqrt{x^2 + y^2}+ \sqrt{x^2 + y^2-2x+1}+\sqrt{x^2 + y^2-2y+1}+\sqrt{x^2 + y^2-6x-8y +25}$$

Find minimum value of $f$.

Now, We see that we can complete the squares, but how do we proceed after that? Is there any general technique for such problems?

• There is no simple technique to find the answer. The answer is somewhere in $(x,y)\in(0.4,0.5)\times(0.5,0.6)$ but I got that by graphing with the computer. – Ian Miller Nov 30 '16 at 15:42

Let $d:\mathbb{R}^2 \rightarrow \mathbb{R}$, $((a,b),(c,d))\longmapsto\sqrt{(a-c)^2 + (b-d)^2}$ then $d((a,b),(c,d))$ means the distance between $(a,b),(c,d)$. So, we can change $f(x,y)$ to the following expression. $$f(x,y) = d((x,y),(0,0))+ d((x,y),(1,0))+ d((x,y),(0,1))+d((x,y),(3,4))$$ The answer is: $5+\sqrt2$. In case of proof, we can plot it on the two-dimensional plane to use the inequality of triangle. For any point $\color{purple}{P(x,y)}$ other than $(\frac{3}{7},\frac{4}{7})$,$$f(x,y)=\overline{\color{purple}{P}O}+\overline{\color{purple}{P}A}+\overline{\color{purple}{P}B}+\overline{\color{purple}{P}C}\\=\color{blue}{\underbrace{(\overline{\color{purple}{P}O}+\overline{\color{purple}{P}C})}_{two\, side\, of\,\triangle O\color{purple}{P}C}}+\color{red}{\underbrace{(\overline{\color{purple}{P}A}+\overline{\color{purple}{P}B})}_{two\, side\, of\,\triangle A\color{purple}{P}B}}\\>\overline{CO}+\overline{AB}\\=\overline{DO}+\overline{DC}+\overline{AD}+\overline{DB}\\=f(\frac{3}{7},\frac{4}{7})\\=5+\sqrt2$$

• Can you explain why that would be minimum? Thank you! – Max Payne Nov 30 '16 at 16:40
• Use inequality of triangle . – ttsazooc Nov 30 '16 at 16:43
• Thank you very much for such a nice explanation! – Max Payne Dec 1 '16 at 7:26

That would be the intersection of the diagonals of $ABCD$ where $A(0,0),B(0,1),C(3,4),D(1,0)$ so it's point $(3/7,4/7)$ and $f(3/7,4/7)=\sqrt 2+5$

• Can you please tell how did you conclude that the intersection of the diagonals would minimise the sum of distances from the four points? – Max Payne Nov 30 '16 at 16:42
• Why intersection of diagonals (of an irregular quadrangle)? – MarianD Nov 30 '16 at 16:44
• @MaxPayne If M is the point you need, minimum of AM+CM is when M is on AC, and minimum of BM+DM is when M is on BD... – Djura Marinkov Nov 30 '16 at 16:47
• @MarianD Isn't this simple if the quadrilateral is irregular, try also to minimise sum of distances to a 3 points – Djura Marinkov Nov 30 '16 at 16:54
• I get it now!!! – Max Payne Nov 30 '16 at 16:55

Once you complete the squares and find that the four components are centered in $$\left( {0,0} \right),\left( {1,0} \right),\left( {0,1} \right),\left( {0,1} \right),\left( {3,4} \right)$$ the next step is to realize that $$\sqrt {x^{\,2} + y^{\,2} } = r$$ that is that the value of each component corresponds to the distance from the center point (they are vertical cones). So the sum will be equal to the sum of the distances from the four points, which is minimum at ...