I'm currently studying Numerical Linear Algebra, and stumbled upon this question of Matrix Diagonalization.
Given a quadratic form of $q = x_1^2 - 4x_1x_2 + x_2^2$ , convert the equation into quadratic form of $q = ay_1^2 - by_2^2$. Find $a$ and $b$
Here's what I've done so far.
from the initial quadratic form, the matrix expression is
$q = \begin{bmatrix} x_1 & x_2 \end{bmatrix} \begin{bmatrix} 1 & -2 \\ -2 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} $
Let $A = \begin{bmatrix} 1 & -2\\ -2 & 1 \end{bmatrix}$
then, by diagonalizing $A$, we get
$A = P DP^{-1}$
with
$P = \begin{bmatrix} -1 & 1 \\ 1 & 1 \end{bmatrix}$ and $D = \begin{bmatrix} 3 & 0 \\ 0 & -1 \end{bmatrix} $
I'm not sure how to continue from this step, any help and insight would be really appreciated, thank you in advance.
Without introducing any matrix notation, an efficient way to solve this problem is "completing squares", as follows: \begin{align*} & x_1^2 - 4x_1x_2 + x_2^2 \\ = & x_1^2 - 4x_2x_1 + 4x_2^2 - 3x_2^2 \\ = & (x_1 - 2x_2)^2 - (\sqrt{3}x_2)^2. \end{align*} Therefore $y_1 = x_1 - 2x_2, y_2 = \sqrt{3}x_2$ is the desired transformation, with $a =1, b = 1$.