<s>[INST] Given $a + b = c + d$ and $a^2 + b^2 = c^2 + d^2$ prove $a=c, b=d$ or $a=d, b=c$ 
Given $$a + b = c + d\space \text{and}\space a^2 + b^2 = c^2 + d^2\quad\forall\space a,b,c,d \in \mathbb{R}$$ Prove: $$a=c, b=d\space \text{or} \space a=d, b=c $$


*

*I managed to get $ab=cd$. Don't know how to proceed further.

 [/INST] Introduce $x$, $y$, $\alpha$ and $\delta$, so
$$x=\frac {a+b} 2$$
$$y=\frac {c+d} 2$$
$$\alpha=\frac {a-b} 2$$
$$\delta=\frac {c-d} 2$$
Now
$$a=x-\alpha$$
$$b=x+\alpha$$
$$c=y-\delta$$
$$d=y+\delta$$
Rewrite $a+b=c+d$ using $x$, $y$, $\alpha$ and $\delta$:
$$x-\alpha+x+\alpha=y-\delta+y+\delta$$
$$2x=2y$$
$$x=y$$
Similarly rewrite $a^2+b^2=c^2+d^2$:
$$(x-\alpha)^2+(x+\alpha)^2=(y-\delta)^2+(y+\delta)^2$$
$$x^2-2x\alpha+\alpha^2+x^2-2x\alpha+\alpha^2=y^2-2y\delta+\delta^2+y^2+2y\delta+\delta^2$$
$$2x^2+2\alpha^2=2y^2+2\delta^2$$
We already know $x=y$, therefore
$$\alpha^2=\delta^2$$
This means $\alpha=\delta$ or $\alpha=-\delta$. The former case leads to $a=c,b=d$; the latter case leads to $a=d,b=c$.
</s>