Originally Posted by

**HallsofIvy** your quadratic form can be written as a matrix multiplication as

$\displaystyle

x^2+5xy+2y^2 = \begin{bmatrix}x & y\end{bmatrix}\begin{bmatrix}1 & \frac{5}{2} \\ \frac{5}{2} & 2\end{bmatrix}\begin{bmatrix}x \\ y\end{bmatrix}

$

We can diagonalize that matrix by finding its eigenvalues and eigenvectors. Its characteristic equation is $\displaystyle \left|\begin{array}{cc}1-\lambda & \frac{5}{2} \\ \frac{5}{2} & 2-\lambda\end{array}\right|= \lambda^2- 3\lambda+ 2- \frac{25}{4}$$\displaystyle = \lambda^2- 3\lambda- \frac{17}{4}= 0$

You can find the eigenvalues by solving that equation using the quadratic formula. They are not, as already pointed out, "easy" numbers: something like, I think $\displaystyle \frac{3}{2}\pm \frac{\sqrt{37}}{4}$. Find the eigenvectors corresponding to that and construct the matrix P having those eigenvectors as columns. $\displaystyle P^{-1}AP$ will be the diagonal matrix having the eigenvallues as entries.