let $f$ be a function of three variables s.t $$f(X)=(X-A)^2+(X-B)^2+(X-C)^2$$ Where $X=(x,y,z)$, and those three vectors are distincs $$\cases{A=(a_1,a_2,a_3) \\ B=(b_1,b_2,b_3) \\ C=(c_1,c_2,c_3)}$$
Find the minimum and the maximum value of this function.
Since this question was in Lagrange Multipliers's section, I thought that using it is sufficient to solve the problem, but it doesn't work. $$f(x,y,z)=(x-a_1,y-a_2,z-a_3)^2+(x-b_1,y-b_2,z-b_3)^2+(x-c_1,y-c_2,z-c_3)^2$$ $$=(x-a_1)^2+(y-a_2)^2+(z-a_3)^2+(x-b_1)^2+(y-b_2)^2+(z-b_3)^2$$ $$+(x-c_1)^2+(y-c_2)^2+(z-c_3)^2$$
Define column vectors (all in lower cases) to be the transpose of its upper case counter parts:
$$x=X^t, a=A^t, b=B^t, c=C^t$$ Define inner product $(a, b)$ = sum ($j=1$ to $3$) {$a_j*b_j$}
where $a_j$, $b_j$ are $j^{th}$ components of $a$ and $b$ respectively and $j=1,2, 3$. We have scalar function of three variables: $f(x)= (x-a, x-a)+ (x-b, x-b) +(x-c, x-c)$
The critical point $x^*$ is obtained by differentiate f (.) wrt x (aka gradient) and set it equal to zero. Hence we get its derivative $\frac{df}{dx} (x^*) = 0$ which implies $2 [(x^*-a)+ (x^*-b) + (x^*-c) ] = 0$ or $x^* = \frac{(a+b+c)}{3}$
We know $f$ has a minimum at $x^*$ because its Hessian matrix $H = \text{diag}[d_1, d_2, d_3]$ is positive definite. The min value of $f$ is given by
$$f(x*) = \frac{2}{3}[||a||^2 +||b||^2 +||c||^2] -\frac{2}{3} [(a,b)+(b,c)+(c,a)]$$
$$= \frac{2}{3}{ (a, a)+(b, b)+(c,c)- [(a,b)+(b,c)+(c,a)]}$$