# Quadratic polynomial/R/3 variables/Change of variables/1/Example

We consider the quadratic form
    ${\frac {3}{2}}x^{2}+2y^{2}+2xy-2yz.$
The corresponding symmetric matrix is
    ${\begin{pmatrix}{\frac {3}{2}}&1&0\\1&2&-1\\0&-1&0\end{pmatrix}}.$
We want to find an orthonormal basis of $\mathbb {R} ^{3}$ such that, with respect to the new basis, the form is described by a diagonal matrix. For this, we have to determine the eigenvalues (principal values) of the matrix. The characteristic polynomial of the matrix is
    ${\begin{aligned}\det {\begin{pmatrix}X-{\frac {3}{2}}&-1&0\\-1&X-2&1\\0&1&X\end{pmatrix}}&={\left(X-{\frac {3}{2}}\right)}{\left(X^{2}-2X-1\right)}-X\\&=X^{3}-{\frac {7}{2}}X^{2}+X+{\frac {3}{2}}\\&=(X-1){\left(X^{2}-{\frac {5}{2}}X-{\frac {3}{2}}\right)}\\&=(X-1)(X-3){\left(X+{\frac {1}{2}}\right)};\end{aligned}}$
hence, the eigenvalues are
    $1,3,-{\frac {1}{2}}.$
The corresponding principal axes can be determined in the following way.
For $x=1$, the kernel of the matrix
    ${\begin{pmatrix}-{\frac {1}{2}}&-1&0\\-1&-1&1\\0&1&1\end{pmatrix}}$
equals ${\begin{pmatrix}2\\-1\\1\end{pmatrix}}$, a normed generator is
    ${\begin{pmatrix}{\frac {2}{\sqrt {6}}}\\-{\frac {1}{\sqrt {6}}}\\{\frac {1}{\sqrt {6}}}\end{pmatrix}}.$
For $x=3$, the kernel of the matrix
    ${\begin{pmatrix}{\frac {3}{2}}&-1&0\\-1&1&1\\0&1&3\end{pmatrix}}$
equals ${\begin{pmatrix}2\\3\\-1\end{pmatrix}}$, a normed generator is
    ${\begin{pmatrix}{\frac {2}{\sqrt {14}}}\\{\frac {3}{\sqrt {14}}}\\-{\frac {1}{\sqrt {14}}}\end{pmatrix}}.$
For $x=-{\frac {1}{2}}$, the kernel of the matrix
    ${\begin{pmatrix}-2&-1&0\\-1&-{\frac {5}{2}}&1\\0&1&-{\frac {1}{2}}\end{pmatrix}}$
equalsh ${\begin{pmatrix}-{\frac {1}{2}}\\1\\2\end{pmatrix}}$, a normed generator is
    ${\begin{pmatrix}-{\frac {1}{4{\sqrt {21}}}}\\{\frac {1}{2{\sqrt {21}}}}\\{\frac {1}{\sqrt {21}}}\end{pmatrix}}.$
We denote these eigenvectors by $u_{1},u_{2},u_{3}$, they form an orthonormal basis. In the new coordinates $y_{1},y_{2},y_{3}$, given by the new orthonormal basis, the quadratic form is written as
    $y_{1}^{2}+3y_{2}^{2}-{\frac {1}{2}}y_{3}^{2}.$
This is clear already just by looking at the eigenvalues; for this, the computation of the eigenvectors not necessary.
Between the two bases, we have the relation
    ${\begin{pmatrix}u_{1}\\u_{2}\\u_{3}\end{pmatrix}}={\begin{pmatrix}{\frac {2}{\sqrt {6}}}&-{\frac {1}{\sqrt {6}}}&{\frac {1}{\sqrt {6}}}\\{\frac {2}{\sqrt {14}}}&{\frac {3}{\sqrt {14}}}&-{\frac {1}{\sqrt {14}}}\\-{\frac {1}{4{\sqrt {21}}}}&{\frac {1}{2{\sqrt {21}}}}&{\frac {1}{\sqrt {21}}}\end{pmatrix}}{\begin{pmatrix}e_{1}\\e_{2}\\e_{3}\end{pmatrix}}\,.$
Due to fact, we have the relation
    ${\begin{pmatrix}x_{1}\\x_{2}\\x_{3}\end{pmatrix}}={\begin{pmatrix}{\frac {2}{\sqrt {6}}}&{\frac {2}{\sqrt {14}}}&-{\frac {1}{4{\sqrt {21}}}}\\-{\frac {1}{\sqrt {6}}}&{\frac {3}{\sqrt {14}}}&{\frac {1}{2{\sqrt {21}}}}\\{\frac {1}{\sqrt {6}}}&-{\frac {1}{\sqrt {14}}}&{\frac {1}{\sqrt {21}}}\end{pmatrix}}{\begin{pmatrix}y_{1}\\y_{2}\\y_{3}\end{pmatrix}}={\begin{pmatrix}{\frac {2}{\sqrt {6}}}y_{1}+{\frac {2}{\sqrt {14}}}y_{2}-{\frac {1}{4{\sqrt {21}}}}y_{3}\\-{\frac {1}{\sqrt {6}}}y_{1}+{\frac {3}{\sqrt {14}}}y_{2}+{\frac {1}{2{\sqrt {21}}}}y_{3}\\{\frac {1}{\sqrt {6}}}y_{1}-{\frac {1}{\sqrt {14}}}y_{2}+{\frac {1}{\sqrt {21}}}y_{3}\end{pmatrix}}\,$
between the coordinates $x_{1},x_{2},x_{3}$ (the dual bases of the standard basis; these coordinates were denote $x,y,z$ in the beginning) and the coordinates $y_{1},y_{2},y_{3}$ of the new orthogonal basis.