<s>[INST] If $a,b \in \mathbb R$ satisfy $a^2+2ab+2b^2=7,$ then find the largest possible value of $|a-b|$ I came across the following problem that says:  

If $a,b \in \mathbb R$ satisfy $a^2+2ab+2b^2=7,$ then the largest possible value of $|a-b|$ is which of the following?
  $(1)\sqrt 7$,  $(2)\sqrt{7/2}$ , $(3)\sqrt {35}$  $(4)7$  

My Attempt:  We notice, $(a-b)^2=7-(4ab+b^2)$ and hence $|a-b|=\sqrt {7-(4ab+b^2)}$ and so $|a-b|$ will be maximum whenever $(4ab+b^2)$ will be minimum. But now I am not sure how to progress further hereon.Can someone point me in the right direction? Thanks in advance for your time.
 [/INST] Instead of maximizing $|\,\cdot\,|$ you can equivalently maximize $|\,\cdot\,|^2$, which has the advantage of being smooth. Then you can set
\begin{align*}
f(a,b) &= a^2 - 2ab + b^2\\
g(a,b) &= a^2 + 2ab + 2b^2\\
c &= 7
\end{align*}
and solve the corresponding Lagrange problem
\begin{align*}
(d/da):&& a - b + L*(a + b) &= 0\\
(d/db):&& b - a + L*(2b + a) &= 0\\
(d/dL):&& a^2 + 2ab + 2b^2 - c &= 0
\end{align*}
If you add (d/da) and (d/db) and assume $L \ne 0$ (otherwise you obviously get the minimum), then this implies $2a+3b = 0$ and thus $b = -2/3a$. From (d/dL) it now follows that $a^2 = 63/5$ and also $b^2 = 28/5$. With $a=\sqrt{63/5}$ and $b=-\sqrt{28/5}$, we get $|a-b| = \sqrt{35} \approx 5.9$ (you can also change the sign on both $a$ and $b$ as long as you do it at the same time).
</s>