Find the points whose sum of the square of the distances to the following points is the minimum. The points are $(0,0), (0,3), (3,3)$.
I know that square of distances are: $$x^2+y^2\ \text{for} \  (0,0)$$ $$x^2+(y-3)^2\ \text{for}\ (0,3)$$ $$(x-3)^2+(y-3)^2\ \text{for}\ (3,3)$$
And if i sum all of them i have $f(x,y)=3x^2+3y^2-12y-6x+27$ 
whose partials derivatives are $f_x=6x-6$ and $f_y=6y-12$
finally, if a solve them i end with a single critical point: $(1,2)$
The problem is that with the second derivative test i do not have information about whether it is a maximum or minimum point. I also believe that there must be other points, maybe i could find them with Lagrange multipliers considering that they should be inside the triangle? Or would this end here?
 A: $f(x,y)=3x^2+3y^2-12y-6x+27=3(x-1)^2+3(y-2)^2+12$. When this expression is minimal?
A: Alternative geometric solution: let $G$ be the centroid of the triangle with vertices $A(0,0)$, $B(0,3)$, $C(3,3)\,$. By the definition of the centroid, the coordinates of $G$ will be $(\frac{0+0+3}{3}, \frac{0+3+3}{3})=(1,2)\,$.
Let $P(x,y)$ be an arbitrary point, then (see here or here for example):
$$
PA^2+PB^2+PC^2=GA^2+GB^2+GC^2+3PG^2
$$
It follows that $PA^2+PB^2+PC^2 \ge GA^2+GB^2+GC^2\,$, and the minimum is attained iff $\,P \equiv G\,$ i.e. $(x,y) = (1,2)\,$.
A: $f(x,y)=3x^2+3y^2−12y−6x+27$
The critical point cannot be a maximum, because it is clear that the maximum distance if it would exists would be realized for points being at infinity as far as possible of the $3$ given points (i.e outside of any ball of arbitrary radius $n\gg 1$).
Now $f(1,2)=12$ is a minimum because $f(1+u,2+v)=f(1,2)+\underbrace{3u^2+3v^2}_{\ge 0}$
A: In fact, you can use a second-derivative test to classify the critical point. You just have to use the right one. For a multivariable function, you must examine the Hessian matrix, which is the matrix of all of the second-order partial derivatives. For this function, this is $$H = \begin{bmatrix}f_{xx}&f_{xy}\\f_{yx}&f_{yy}\end{bmatrix} = \begin{bmatrix}6&0\\0&6\end{bmatrix}.$$ This is obviously positive-definite, so the critical point is a minimum.
A: You want to minimize $f(x,y)$ (maybe the minimum doesn't exist.
Notice that we can work only inside $B$ where $B$ is a closed ball of big radius, because $f$ is large outside $B$.
We conclude that the minimum does exist because $B$ is compact.
We know that the minimum occurs in the interior of $B$. And hence the partial derivatives must be $0$.

In fact this problem is easier because we can minimize $3x^ 2-6x$ and $3y^2 -12y$ independently.
