Find the minimum value of $x_1^2+x_2^2+x_3^2+x_4^2$ subject to $x_1+x_2+x_3+x_4=a$ and $x_1-x_2+x_3-x_4=b$. Question: Find the minimum value of $x_1^2+x_2^2+x_3^2+x_4^2$ subject to $x_1+x_2+x_3+x_4=a$ and $x_1-x_2+x_3-x_4=b$.
My attempt: It can be easily seen that $x_1+x_3=\frac{a+b}{2}$ and $x_2+x_4=\frac{a-b}{2}$. Further, the expression $[x_1^2+x_2^2+x_3^2+x_4^2]$ can be written as $[(x_1+x_3)^2+(x_2+x_4)^2-2(x_1x_3+x_2x_4)].$ I'm having trouble eliminating $(x_1x_3+x_2x_4)$ from this expression. Failing to make any sense out of this, I manipulated the existing expressions to deduce $$x_1x_2+x_1x_4+x_2x_3+x_3x_4=\frac{a^2-b^2}{4}$$and $$(x_1^2+x_3^2)-(x_2^2+x_4^2)+2(x_1x_3-x_2x_4)=a\cdot b$$Beyond this, I cannot make sense of the expressions anymore. I have no idea how to proceed with simplifying the expressions further, and would appreciate hints in the same direction.

Using algebra.
Use the two equality constraints to get $x_3$ and $x_4$ as linear functions of $x_1$ and $x_2$.
This makes
$$x_1^2+x_2^2+x_3^2+x_4^2=x_1^2+x_2^2+\frac{1}{4} (a+b-2 x_1)^2+\frac{1}{4} (-a+b+2 x_2)^2$$
Compute the partial derivatives wrt $x_1$ and $x_2$ and set them equal to $0$. This would give $x_1=\frac {a+b}4$ and $x_2=\frac {a+b}4$. So, for the minimum
$$x_1^2+x_2^2+x_3^2+x_4^2=\frac {a^2+b^2}4$$
