Finding two matrices that permit a change of variable eliminating the crossed term. Learning about eigenvalues/vectors. Here is an exercise which I guess is about that, but I am not really sure how to get started with it:

For $5x_1^2-4x_1x_2+5x_2^2=21$ find a diagonal matrix $D$ an an
  orthogonal matrix $C$ that permit making a change of variable that
  eliminates the crossed term.

I imagine that $5x_1^2-4x_1x_2+5x_2^2=21$ is the characteristic polynomial for some matrix $A$. I also know the definition of diagonal and orthogonal matrix. But, I don't have the faintest idea what do they mean by "making a change of a variable that eliminates the crossed term" - what is a change of a variable, and what is "the crossed term"?
Seeking help, I was told that, for starters,
$$A = \begin{bmatrix} 5 & -2\\ -2 & 5 \end{bmatrix}$$
Cool, but I don't even know how did they calculate that. The most I can make out of it is that its eigenvalues are $7$ and $3$ (now what?)
So my question essentially is how to solve that exercise. Any pointers?
 A: $5x_1^2 - 4x_1 x_2 + 5x_2^2 = q(x)$ (say) is a quadratic form. If you define $x = \begin{bmatrix}x_1\\x_2\end{bmatrix}$, and $A = \begin{bmatrix}5 & -2 \\ -2 & 5\end{bmatrix}$, then $q(x)$ can be written as $q(x) = x^T A x$ (verify this, and check out the Wikipedia page to so how this can be done in general).
The "crossed term" is the term $x_1x_2$. When you carry out the matrix multiplication $x^TAx$, you see that this term arises from the non-diagonal elements of $A$. If we could write a diagonal matrix, say $D$, in place of $A$, the crossed term would be eliminated. But how can we replace $A$ by $D$ without changing the value of $q(x)$? We could simultaneously change the variables $x_1$ and $x_2$ to two new variables, say $y_1$ and $y_2$ and write $q(x)$ as $y^TDy$.
So you need to diagonalize $A$. This is certainly possible, because $A$ is a real symmetric matrix. You have already found the eigenvalues of $A$: $3$ and $7$. The corresponding eigenvectors are $\begin{bmatrix}1 \\ 1\end{bmatrix}$ and $\begin{bmatrix}1 \\ -1\end{bmatrix}$ respectively. Normalizing these (dividing by their respective magnitudes), we get $\begin{bmatrix}1/\sqrt 2 \\ 1/\sqrt 2\end{bmatrix}$ and $\begin{bmatrix}1/\sqrt 2 \\ -1/ \sqrt 2\end{bmatrix}$. Let $P$ be the matrix with these two vectors as its columns:
$P = \begin{bmatrix}1/\sqrt 2 & 1/\sqrt 2 \\ 1/\sqrt 2 & -1/\sqrt 2\end{bmatrix}$
and let $D$ be the diagonal matrix with the respective eigenvalues of $A$ as its diagonal entries:
$D = \begin{bmatrix}3 & 0\\0 & 7\end{bmatrix}$
Then $A = PDP^T$ (verify this, and see Orthogonal Diagonalization)
So now, $q(x) = x^TAx = x^TPDP^Tx = (P^Tx)^TD(P^Tx) = y^TDy$, where $y = P^Tx = \begin{bmatrix}y_1\\y_2\end{bmatrix}$ (calculate this).
I think the question wants you to define $C = P^T$, so the required change of variables is $y = Cx$.
Verify that $y^TAy$ has no crossed term ($y_1y_2$).
