Find the transitional matrix that would transform this form to a diagonal form.

Let the quadratic form $F(x,y,z)$ be given as below

$F(x,y,z)=2x^2+3y^2+5z^2-xy-xz-yz$

Find the transitional matrix that would transform this form to a diagonal form.

I got the symmetric coefficient matrix to be:

$\begin{pmatrix}2 & -\frac{1}{2} & -\frac{1}{2} \\-\frac{1}{2} & 3 & -\frac{1}{2} \\-\frac{1}{2} & -\frac{1}{2} & 5\end{pmatrix}$

i then got the characteristic polynomial :

$λ^3-10λ^2+\frac{121}{4}λ-30$

is it even possible to solve for λ?


Solution 1:

Completing the square gives $2x^2+3y^2+5z^2-xy-xz-yz$

$=2\big(x^2-\frac{1}{2}(y+z)x+\frac{1}{16}(y+z)^2\big)+3y^2+5z^2-yz-\frac{1}{8}y^2-\frac{1}{8}z^2-\frac{1}{4}yz$

$=2\big(x-\frac{1}{4}(y+z)\big)^2+\frac{23}{8}y^2-\frac{5}{4}yz+\frac{39}{8}z^2$

$=2(x-\frac{1}{4}y-\frac{1}{4}z)^2+\frac{23}{8}\big(y^2-\frac{10}{23}yz+\frac{25}{23^2}z^2\big)+\frac{109}{23}z^2$

$=2(x-\frac{1}{4}y-\frac{1}{4}z)^2+\frac{23}{8}(y-\frac{5}{23}z)^2+\frac{109}{23}z^2$,

so letting $x^{\prime}=x-\frac{1}{4}y-\frac{1}{4}x, \;\;y^{\prime}=y-\frac{5}{23}z, \;\;z^{\prime}=z$

gives the transitional matrix

$\begin{pmatrix}1&-\frac{1}{4}&-\frac{1}{4}\\0&1&-\frac{5}{23}\\0&0&1\end{pmatrix}^{-1}=\begin{pmatrix}1&\frac{1}{4}&\frac{7}{23}\\0&1&\frac{5}{23}\\0&0&1\end{pmatrix}$


As shown in Will Jagy's answer, the transitional matrix can also be found by matrix reduction:

$\begin{pmatrix}2&-\frac{1}{2}&-\frac{1}{2}\\-\frac{1}{2}&3&-\frac{1}{2}\\-\frac{1}{2}&-\frac{1}{2}&5\end{pmatrix}\overset{\frac{1}{4}r_1+r_2}{\underset{\frac{1}{4}c_1+c_2}{\longrightarrow}}\begin{pmatrix}2&0&-\frac{1}{2}\\0&\frac{23}{8}&-\frac{5}{8}\\-\frac{1}{2}&-\frac{5}{8}&5\end{pmatrix}\overset{\frac{1}{4}r_1+r_3}{\underset{\frac{1}{4}c_1+c_3}{\longrightarrow}}\begin{pmatrix}2&0&0\\0&\frac{23}{8}&-\frac{5}{8}\\0&-\frac{5}{8}&\frac{39}{8}\end{pmatrix}\overset{\frac{5}{23}r_2+r_3}{\underset{\frac{5}{23}c_2+c_3}{\longrightarrow}}\begin{pmatrix}2&0&0\\0&\frac{23}{8}&0\\0&0&\frac{109}{23}\end{pmatrix}$

Performing the same row operations on the identity matrix gives

$\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}\longrightarrow\begin{pmatrix}1&0&0\\\frac{1}{4}&1&0\\0&0&1\end{pmatrix}\longrightarrow\begin{pmatrix}1&0&0\\\frac{1}{4}&1&0\\\frac{1}{4}&0&1\end{pmatrix}\longrightarrow \begin{pmatrix}1&0&0\\\frac{1}{4}&1&0\\\frac{7}{23}&\frac{5}{23}&1\end{pmatrix}=S$,

so the transitional matrix is given by $S^{T}=\begin{pmatrix}1&\frac{1}{4}&\frac{7}{23}\\0&1&\frac{5}{23}\\0&0&1\end{pmatrix}$

Solution 2:

this is code from gp-pari, free software I was able to download to my home computer. There is a rather compact depiction of this way of writing things at the question Finding $P$ such that $P^TAP$ is a diagonal matrix From what I can see, the only "advantage" of this is a rather cookbook description, and the fact there is no need to ever explicitly invert a matrix. I am interested, though, never seen this "matrix reduction" way of writing the thing. Probably in some books from 100 years ago or so, time of Hermite and Minkowski.

This may help, the example of a two by two symmetric matrix, the easy case where both diagonal entries are nonzero: $$ A = \left( \begin{array}{cc} C & T \\ T & W \end{array} \right) $$ where we want to change $T$ to zero. We take an elementary matrix, upper triangular in the easy cases,
$$ E = \left( \begin{array}{cc} 1 & \lambda \\ 0 & 1 \end{array} \right), $$ where we are going to choose $\lambda$ so that $E^T A E$ is diagonal. Well,

$$ \color{red}{\left( \begin{array}{cc} 1 & 0 \\ \lambda & 1 \end{array} \right) \left( \begin{array}{cc} C & T \\ T & W \end{array} \right) \left( \begin{array}{cc} 1 & \lambda \\ 0 & 1 \end{array} \right)= \left( \begin{array}{cc} C & T + C \lambda \\ T + C \lambda & W + 2 T \lambda + C \lambda^2 \end{array} \right).} $$ We want $T + C \lambda = 0,$ so we choose $ \lambda = -T /C.$ If the matrix is actually 3 by 3, sometimes the number $\lambda$ is in position 12, or position 13, or position 23. When there are premature zeroes on the diagonal, sometimes $\lambda$ needs to be below the diagonal; not for this problem, though.

parisize = 4000000, primelimit = 500509
? a = [ 2, -1/2, -1/2; -1/2, 3, -1/2; -1/2, -1/2, 5]
%1 = 
[2 -1/2 -1/2]

[-1/2 3 -1/2]

[-1/2 -1/2 5]

? e1 = [ 1, 1/4 , 0; 0,1,0; 0,0,1]
%2 = 
[1 1/4 0]

[0 1 0]

[0 0 1]

?  a1 = mattranspose(e1) * a * e1 
%3 = 
[2 0 -1/2]

[0 23/8 -5/8]

[-1/2 -5/8 5]

? p1 = e1
%4 = 
[1 1/4 0]

[0 1 0]

[0 0 1]

? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

? e2 = [ 1, 0 , 1/4; 0,1,0; 0,0,1]
%5 = 
[1 0 1/4]

[0 1 0]

[0 0 1]

?  a2 = mattranspose(e2) * a1 * e2 
%6 = 
[2 0 0]

[0 23/8 -5/8]

[0 -5/8 39/8]

? p2 = e1 * e2
%8 = 
[1 1/4 1/4]

[0 1 0]

[0 0 1]

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

? e3 = [ 1, 0 , 0; 0,1,5/23; 0,0,1]
%9 = 
[1 0 0]

[0 1 5/23]

[0 0 1]

?  a3 = mattranspose(e3) * a2 * e3 
%10 = 
[2 0 0]

[0 23/8 0]

[0 0 109/23]

? p3 = p2 * e3
%11 = 
[1 1/4 7/23]

[0 1 5/23]

[0 0 1]

? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

? p = p3
%12 = 
[1 1/4 7/23]

[0 1 5/23]

[0 0 1]

? a
%13 = 
[2 -1/2 -1/2]

[-1/2 3 -1/2]

[-1/2 -1/2 5]

?  d = mattranspose(p) * a * p 
%14 = 
[2 0 0]

[0 23/8 0]

[0 0 109/23]

? 

 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=