Let A=[0,0], B=[1,0], C=[c,d]. We are looking for such point M=[x,y]
that the value of expression V(x,y)=|AM|2+|BM|2+|CM|2 be
minimal. The distance of two points K=[x1,y1],
L=[x2,y2] is
d=sqrt((x1-x2)2+(y1-y2)2).
Then
V(x,y)=x2+y2+(1-x)2+y2+(x-c)2+(y-d)2
which is equivalent to:
V(x,y)=3x2-2x(c+1)+3y2-2yd+(1+c2+d2)
Last member of the sum is constant and because x and y are independent,
the expression V(x,y) is minimal when the contribution of members with x is minimal
and at the same time the contribution of members with y is minimal.
Therefore, we are looking for minimums of functions
v1(x)=3x2-2x(c+1) and v2(y)=3y2-2yd.
We rearrange the formulas:
v1(x)=3[x2-(2/3x(c+1))]=3([x-(c+1)/3]2-((c+1)/9)2) =
3(x-(c+1)/3)2-(c+1)2/3
v2(y)=3(y2-(2yd)/3)=3[(y-d/3)2-d2/9]=3(y-d/3)2-d2/3
The right member is constant and the left one is nonnegative in both expressions.
That's why both expressions are minimal, when the left member is 0, so
x=(c+1)/3 and y=d/3. Now we note that the centre of gravity of
a triangle ABC has the coordinates
T=[(0+1+c)/3,(0+0+d)/3]=[(c+1)/3,d/3]=[x,y]=M.