<s>[INST] If $a+b+c=k$ and $a^2+b^2+c^2 =2k$ what is the maximum value of $k$? $a,b,c$ are real numbers and they satisfy the following equations.
$a+b+c=k$
$a^2+b^2+c^2=2k$
Find the maximum value of $k$.
I tried substituting for k in the second equation from the first and got
$a^2+b^2+c^2=2(a+b+c)$
Rearranging the terms I got
$a^2-2a+b^2-2b+c^2-2c=0$
Adding 3 to both sides we get
$a^2-2a+1+b^2-2b+1+c^2-2c+1=3$
This can be simplified to the following
$(a-1)^2+(b-1)^2+(c-1)^2=3$
Therefore,
$0\leq(a-1)^2,(b-1)^2,(c-1)^2\leq3$
From here we can deduce the range of values that a,b,c can take as
$1-\sqrt{3}\leq a,b,c\leq1+\sqrt{3}$
I don't know know if this helps to answer the question.
 [/INST] Since $c=k-(a+b)$ both inequalities are fulfilled iff the set of points $(a;b)$ such that
$$ a^2 + b^2 + (k-(a+b))^2 = 2k $$
is non-empty. This equation can be written as
$$ 2a^2+2ab+2b^2-2ka-2kb+(k^2-2k) = 0 $$
or, by letting $a=A+\frac{k}{3},b=B+\frac{k}{3}$, as
$$ 2A^2+2AB+2B^2 = 2k-\frac{k^2}{3}.$$
The matrix $\left(\begin{smallmatrix}2 & 1 \\ 1 & 2\end{smallmatrix}\right)$ is positive definite, hence this is the equation of an ellipse provided that $2k-\frac{k^2}{3}>0$.
It follows that the maximum value of $k$ is $\color{red}{6}$.
</s>