Completing the square How might I find linear combinations $$\begin{align*}
A&=a_1x+a_2y+a_3z\\
B&=b_1x+b_2y+b_3z\\
C&=c_1x+c_2y+c_3z
\end{align*}$$
Such that I can transform the two polynomials
$$2x^2+3y^2-2yz+3z^2\text{ and }x^2+6xy+3y^2+2yz-6zx+3z^2$$
into
$A^2+B^2+C^2$ and $\alpha A^2+\beta B^2+\gamma C^2$ respectively for some $\alpha, \beta,\gamma\in \mathbb R$?
I think I should be completing the square, but I can't see how to. 
 A: Your question is equivalent to finding a matrix $S$ such that $S^\top XS=I$ and $S^\top YS$ is diagonal, where
$$
X=\begin{pmatrix}2&0&0\\ 0&3&-1\\ 0&-1&3\end{pmatrix},
Y=\begin{pmatrix}1&3&-3\\ 3&3&1\\ -3&1&3\end{pmatrix}.
$$
In a related question (BTW, the $X,Y$ here are exactly the same as the matrices $A,B$ in that question; is this a homework question or something else?), I have explained how to find a matrix $M$ such that both $M^\top XM=\Lambda_1$ and $M^\top YM=\Lambda_2$ for some diagonal matrices $\Lambda_1$ and $\Lambda_2$. Concretely,
$$
M=\frac{1}{\sqrt{\lambda+4}}
\begin{pmatrix}
2&1&0\\
-1&1&1\\
1&0&1
\end{pmatrix}
\begin{pmatrix}1&0&0\\0&\lambda-4&-2\\0&2&\lambda-4\end{pmatrix},
\quad \lambda=\frac{9+\sqrt{17}}{2}.
$$
Now you may take $S=M\Lambda_1^{-1/2}$. The coefficients of $A$ can be read off from the first row of $S^\top$, and vice versa for $B$ and $C$. The coefficients $\alpha,\beta,\gamma$ are the diagonal entries of $S^\top YS$.
Another way of solving the problem is to find the square root of $X$, then orthogonally diagonalize $(\sqrt{X}^\top)^{-1}Y\sqrt{X}^{-1}$. In other words, if $\sqrt{X}$ is a matrix such that $\sqrt{X}^\top\sqrt{X}=X$, and $Q$ is an orthogonal matrix such that $Q^\top(\sqrt{X}^\top)^{-1}Y\sqrt{X}^{-1}Q$ is diagonal, then you may set $S=\sqrt{X}^{-1}Q$.
