diagonalization of quadratic form
A quadratic form^{} may be diagonalized by the following procedure:

1.
Find a variable $x$ such that ${x}^{2}$ appears in the quadratic form. If no such variable can be found, perform a linear change of variable so as to create such a variable.

2.
By completing the square, define a new variable ${x}^{\prime}$ such that there are no crossterms involving ${x}^{\prime}$.

3.
Repeat the procedure with the remaining variables.
Example Suppose we have been asked to diagonalize the quadratic form
$$Q={x}^{2}+xy3xz{y}^{2}/4+yz9{z}^{2}/4$$ 
in three variables. We could proceed as follows:

•
Since ${x}^{2}$ appears, we do not need to perform a change of variables.

•
We have the cross terms $xy$ and $3xz$. If we define ${x}^{\prime}=x+y/23z/2$, then
$$x^{\prime}{}^{2}={x}^{2}+xy3xz+{y}^{2}/4+9{z}^{2}/43yz/2$$ Hence, we may reexpress $Q$ as
$$Q=x^{\prime}{}^{2}yz/2$$ 
•
We must now repeat the procedure with the remaining variables, $y$ and $z$. Since neither ${y}^{2}$ nor ${z}^{2}$ appears, we must make a change of variable. Let us define ${z}^{\prime}=z+2y$.
$$Q=x^{\prime}{}^{2}{y}^{2}y{z}^{\prime}/2$$ 
•
We have a cross term $y{z}^{\prime}/2$. To eliminate this term, make a change of variable ${y}^{\prime}=y+{z}^{\prime}/4$. Then we have
$$y^{\prime}{}^{2}={y}^{2}+y{z}^{\prime}/2+z^{\prime}{}^{2}/16$$ and hence
$$Q=x^{\prime}{}^{2}y^{\prime}{}^{2}+z^{\prime}{}^{2}/16$$ The quadratic form is now diagonal, so we are done. We see that the form has rank 3 and signature^{} 2.
Title  diagonalization of quadratic form 

Canonical name  DiagonalizationOfQuadraticForm 
Date of creation  20130322 14:49:34 
Last modified on  20130322 14:49:34 
Owner  rspuzio (6075) 
Last modified by  rspuzio (6075) 
Numerical id  7 
Author  rspuzio (6075) 
Entry type  Algorithm 
Classification  msc 15A03 
Related topic  DiagonalQuadraticForm 