How to diagonalize $f(x,y,z)=xy+yz+xz$ Could you tell me how to diagonalize $f(x,y,z)=xy+yz+xz$.
I know I can rewrite it as $(x+ \frac{1}{2}y + \frac{1}{2}z)^2 - x^2 - \frac{1}{4}(y-z)^2$
What do I do next?
Could you help me?
 A: I have explained the general procedure in my comments in your previous thread. So, I will take this as a concrete example. Assume the characteristic of the underlying field is not $2$. The matrix in question is
$$A=\pmatrix{0&\tfrac12&\tfrac12\\ \tfrac12&0&\tfrac12\\ \tfrac12&\tfrac12&0}$$
and we want to diagonalise it by using congruence transform.
The first thing we notice is that $A$ has a zero diagonal. This is bad, because we cannot use Gaussian elimination to kill the off-diagonal entries. So, we try to "borrow" numbers from other entries so as to make the $(1,1)$-th entry nonzero. In particular,
$$
P=\pmatrix{1&1&0\\ 0&1&0\\ 0&0&1}
\Rightarrow B=PAP^T=\pmatrix{1&\tfrac12&1\\ \tfrac12&0&\tfrac12\\ 1&\tfrac12&0}.
$$
We may now use simultaneous row and column reduction to kill all entries below or on the right of the $(1,1)$-th entry of $B$:
$$
Q=\pmatrix{1&0&0\\ -\tfrac12&1&0\\ -1&0&1}
\Rightarrow D=QAQ^T=\pmatrix{1&0&0\\ 0&-\tfrac14&0\\ 0&0&-1}.
$$
It happens that $D$ is diagonal. So we may stop here and the diagonalisation is given by $D=(QP)A(QP)^T$ and
$$\pmatrix{u\\ v\\ w}=(QP)^{-T}\pmatrix{x\\ y\\ z}=\pmatrix{\tfrac12&\tfrac12&1\\ -1&1&0\\ 0&0&1}\pmatrix{x\\ y\\ z}.$$
That is, if you define $u=\frac x2+\frac y2+z,\,v=y-x$ and $w=z$, then $f(x,y,z)=u^2-\frac14v^2-w^2$.
A: If you meant the matrix of a quadratic form (a funny one as you did not define it as such), then its matrix is
$$F=\begin{pmatrix}0&\frac12&\frac12\\\frac12&0&\frac12\\\frac12&\frac12&0\end{pmatrix}\implies$$
$$\det(tI-F)=\begin{vmatrix}\;\;t&-\frac12&-\frac12\\-\frac12&\;\;t&-\frac12\\-\frac12&-\frac12&\;\;t\end{vmatrix}=t^3-\frac14-\frac34t=$$
$$=t^3-\frac{3t}4-\frac14=(t-1)\left(t+\frac12\right)^2$$
Let's see what the eigenspace of $-\,1/2\,$ is:
$$\begin{align*}-x-y-z&=0\\-x-y-z&=0\end{align*}\;\implies z=-x-y$$
and we thus get we can find two linearly independent eigenvectors for the eigenvalue $\,-\frac12\;$ which, together with one eigenvector corresponding to $\,1\,$ gives us a basis of eigenvectors and thus $\,F\,$ is diagonalizable (of course we knew this beforehand as $\;F\;$ is symmetric... )
To diagonalize $\,F\,$ just construct a matrix $\,P\,$ with its columns equal to eigenvectors of $\,F\,$ , say
$$P=\begin{pmatrix}1&0&1\\0&1&1\\\!\!-1&\!\!-1&1\end{pmatrix}\implies P^{-1}=\frac13\begin{pmatrix}2&\!\!-1&\!\!-1\\\!\!-1&2&\!\!-1\\1&1&1\end{pmatrix}$$
and now you can check that
$$P^{-1}FP=\begin{pmatrix}\!\!-\frac12&0&0\\0&\!\!\!-\frac12&0\\{}\\0&0&1\end{pmatrix}$$
