<s>[INST] With $x_1^2+3x_2^2+2x_1x_2=32$, find max value of $|x_1-x_2|$ 
With $x_1^2+3x_2^2+2x_1x_2=32$, find the maximum of $|x_1-x_2|$.


I have tried with AM-GM, but can't solve it. With $d = |x_1-x_2|$ and $d^2 = 2x_1^2 + 4x_2^2 - 32$, then I wonder how to do next.
Thank a lot for helping!

 [/INST] $(x_1+x_2)^2+2(x_2)^2=32.$
We are finding the value of $\max(|x_1-x_2|)=\max(|x_1+x_2-2x_2|)$.
Let $x_1+x_2=X, x_2=Y.$
Then, we can rewrite the problem:

If $X^2+2Y^2=32$, Find the maximum of $|X-2Y|$.

Let $\sin(A)=\dfrac{X}{4\sqrt{2}}.$
Then, $\cos(A)=\dfrac{Y}{4}.$
So, the problem changes:

Find the maximum of $|4\sqrt{2}\sin{A}-8\cos{A}|.$

Let $\sin(B)=-\dfrac{\sqrt{2}}{\sqrt{3}}, \cos(B)=\dfrac{1}{\sqrt{3}}$.
Then, $|4\sqrt{2}\sin{A}-8\cos{A}| = |4\sqrt{6}(\cos{B}\sin{A}+\sin{B}\cos{A})| =|4\sqrt{6}\sin(A+B)| \leq 4\sqrt{6}.$
So, the answer will be $4\sqrt{6}.$
</s>