On completing the square and symmetry The quadratic form $f(x,y)=x^2+xy+y^2$ appears quite often on the site here. It is provably positive definite by completing the square: $$f(x,y)=\left(x+\frac y2\right)^2+\frac {3y^2}{4}$$
and this is the only analysis ever really given. I have never seen the symmetric version $$f(x,y)=\frac 34(x+y)^2+\frac 14(x-y)^2$$quoted in an answer (either to the expression being positive, or to any other question on the site). This refers the original expression to principal axes and retains the symmetry between the two variables, so in principle ought to be preferred.
Clearly the first version is adequate for many purposes - but is there a reason why the symmetric version does not feature?
Note: This is related to other questions on quadratic forms - the general theory identifies canonical decomposition, but pragmatic methods seem to dodge this, and find other expressions adequate.
 A: It is revealing to recast both expressions in terms of linear algebra. We may write $$f(x,y)=x^2+xy+y^2 \equiv v^\top A v = \begin{pmatrix} x & y \end{pmatrix} \begin{pmatrix} 1 & 1/2 \\ 1/2 & 1 \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}.$$
If we look to the expression $f(x,y)=(x+y/2)^2+\dfrac34 y^2$, this may be expressed in matrix form as
$$f(x,y)= \begin{pmatrix} x & y \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 1/2 & \sqrt{3}/2  \end{pmatrix} \begin{pmatrix} 1 & 1/2 \\ 0 & \sqrt{3}/2  \end{pmatrix} \begin{pmatrix} x \\ y \end{pmatrix}\equiv v^\top L L^\top v.$$ This corresponds to the Cholesky decomposition $A=LL^\top$. By contrast, the spectral decomposition $$A=VDV^\top = \begin{pmatrix} 1/\sqrt{2} & 1/\sqrt{2} \\ 1/\sqrt{2} & -1/\sqrt{2}\end{pmatrix}
\begin{pmatrix} 3/2 & 0 \\ 0 & 1/2 \end{pmatrix} \begin{pmatrix} 1/\sqrt{2} & 1/\sqrt{2} \\ 1/\sqrt{2} & -1/\sqrt{2}\end{pmatrix}$$ yields the second formula. So the two expressions simply reflect different decompositions of the matrix $A$, and both establish that $A$ is positive-definite.
