Let $S=\{(x, y)| x, y \text{ are positive integers }\}$ viewed as a subset of the plane. For every point $P$ in $S,$ let $d_P$ denote the sum of the distances from $P$ to the point $(8,0)$ and the point $(0,12).$ Show that the number of points $P$ in $S$ such that $d_P$ is the least among all elements in the set $S,$ is $3.$
My attempt:
If $(x,y)\in S$ then, $d_P=\sqrt{x-8)^2+y^2}+\sqrt{x^2+(y-12)^2}.$
If we were to minimize $d_P$ then we must minimize $$\left(\sqrt{(x-8)^2+y^2} \right )^2+\left(\sqrt{x^2+(y-12)^2} \right)^2,$$ as $\sqrt{(x-8)^2+y^2},\sqrt{x^2+(y-12)^2},$ are after all, positive integers.
We define, a function $$f(x,y)=(x-8)^2+y^2+x^2+(y-12)^2 ,$$ and observe, that $f(x,y)\geq 0,\forall (x,y)\in\Bbb R^2(\text{or better, S}).$
But I don't understand how to find the least possible value of the (double variable) function $f$ in it's range. I think some calculus is needed to find the local minima (, if any) of this function. But then again, I don't know multivariable calculus, as I studied only single variable calculus up until now. So, possibly, I dont know how maxima/minima works in the so called, "Multivariable Calculus". (Finally, is there at all any other way to solve this problem in a simpler manner? )
This problem can be evaluated graphically using the triangle inequality.
Consider the line joining $(0,12)$ and $(8,0)$. Clearly, the sum of distances from the fixed point is minimum and equal to the length of the line segment if it lies on the line (by triangle inequality). For verification, you may draw a point away from this line and you will see that the sum of distances is always greater than the 3rd side length. Finding the equation of the line we get, $$3x + 2y = 24$$ Clearly, this has 3 integral solutions which arise when x is some even number in the interval $(0, 8)$. For reference, the values are $$x = 2$$ $$x = 4$$ $$x = 6$$ Thus there are 3 points satisfying the given condition.