Conic matrix and diagonalization If I have the conic $C$:
$$
5x^2 - 4xy + 8y^2 = 36
$$
How would I express it as a matrix of the form:
$$
\begin{bmatrix}x&y\end{bmatrix} \begin{bmatrix}a&b/2\\b/2&c\end{bmatrix} \begin{bmatrix}x\\y\end{bmatrix} = k
$$
Also, how to find a unitary matrix $P$ such that
$$
P^* \begin{bmatrix}a&b/2\\b/2&c\end{bmatrix}P
$$
is diagonal.
Thanks for your help.

Let
$$
A\equiv\left[\begin{array}{cc}
a & \frac{1}{2}b\\
\frac{1}{2}b & c
\end{array}\right]
$$
so that
\begin{align*}
\left[\begin{array}{cc}
x & y\end{array}\right]A\left[\begin{array}{c}
x\\
y
\end{array}\right] & =\left[\begin{array}{cc}
x & y\end{array}\right]\left[\begin{array}{cc}
a & \frac{1}{2}b\\
\frac{1}{2}b & c
\end{array}\right]\left[\begin{array}{c}
x\\
y
\end{array}\right]\\
 & =\left[\begin{array}{cc}
x & y\end{array}\right]\left[\begin{array}{c}
ax+\frac{1}{2}by\\
\frac{1}{2}bx+cy
\end{array}\right]\\
 & =ax^{2}+\frac{1}{2}byx+\frac{1}{2}bxy+cy^{2}\\
 & =ax^{2}+bxy+cy^{2}.
\end{align*}
Therefore,$a=5$, $b=-4$ and $c=8$. Naturally, $k=36$. This gives us
$$
A\equiv\left[\begin{array}{cc}
a & \frac{1}{2}b\\
\frac{1}{2}b & c
\end{array}\right]=\left[\begin{array}{cc}
5 & -2\\
-2 & 8
\end{array}\right].
$$
We want to diagonalize $A$. Note that the eigenvalues of $A$ are $\lambda_{1}=4$ and $\lambda_{2}=9$ (you can verify this). Constructing $P$ by placing the corresponding eigenvectors in the columns,
$$
P\approx\left[\begin{array}{cc}
-0.89443 & -0.44721\\
-0.44721 & 0.89443
\end{array}\right].
$$
You can verify that 
$$
P^{\star}AP\approx\left[\begin{array}{cc}
\lambda_{1}\\
 & \lambda_{2}
\end{array}\right].
$$
