How can I normalize quadratic form using Lagrange method? $f=x_1^2+x_2^2+4x_3^2+x_4^2+2x_1x_2+4x_1x_3-2x_1x_4+4x_2x_3-6x_2x_4$
Any kind of help is appreciated.
Lagrange's reduction: http://www.solitaryroad.com/c138.html
How can I normalize quadratic form using Lagrange method? $f=x_1^2+x_2^2+4x_3^2+x_4^2+2x_1x_2+4x_1x_3-2x_1x_4+4x_2x_3-6x_2x_4$
Any kind of help is appreciated.
Lagrange's reduction: http://www.solitaryroad.com/c138.html
Alright, algorithm using symmetric matrices.
The direct thing that came out was $$ (x+y+2z-t)^2 -4 (\frac{y}{2}-\frac{z}{2}+\frac{t}{2})^2 + (-y+z+t)^2. $$ We can clear denominators because of the $4,$ giving the more attractive $$ (x+y+2z-t)^2 - (y-z+t)^2 + (-y+z+t)^2. $$ We need only three terms because the symmetric matrix I call "h" below has determinant $0.$
$$ H = \left( \begin{array}{rrrr} 1 & 1 & 2 & -1 \\ 1 & 1 & 2 & -3 \\ 2 & 2 & 4 & 0 \\ -1 & -3 & 0 & 1 \end{array} \right) $$
Let me add some jargon. Sylvester's Law of Inertia says that, in the matrix product below, $ P^T D P = H, $ we demand that $P$ be invertible. Then the number of positive elements in diagonal $D$ is the same as the number of positive eigenvalues of $H,$ the number of negative elements in diagonal $D$ is the same as the number ofnumber eigenvalues of $H,$ finally the number of zero elements in the diagonal of $D$ is the same as the number of zero eigenvalues of $H.$ The diagonal elements of $D$ are NOT the eigenvalues of $H,$ just the same $\pm$ signs. So, new names, $$ D = \left( \begin{array}{rrrr} 1 & 0 & 0 & 0 \\ 0 & -1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right) $$ $$ P = \left( \begin{array}{rrrr} 1 & 1 & 2 & -1 \\ 0 & 1 & -1 & 1 \\ 0 & -1 & 1 & 1 \\ 0 & -1 & 0 & 1 \end{array} \right), $$ $$ P^T = \left( \begin{array}{rrrr} 1 & 0 & 0 & 0 \\ 1 & 1 & -1 & -1 \\ 2 & -1 & 1 & 0 \\ -1 & 1 & 1 & 1 \end{array} \right), $$ then $$ \det P = 2 $$ $$ P^T D P = H $$
Description of symmetric matrix algorithm at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
parisize = 4000000, primelimit = 500509
? h = [ 1,1,2,-1; 1,1,2,-3; 2,2,4,0; -1,-3,0,1]
%1 =
[1 1 2 -1]
[1 1 2 -3]
[2 2 4 0]
[-1 -3 0 1]
? ht = mattranspose(h)
%2 =
[1 1 2 -1]
[1 1 2 -3]
[2 2 4 0]
[-1 -3 0 1]
? h - ht
%3 =
[0 0 0 0]
[0 0 0 0]
[0 0 0 0]
[0 0 0 0]
? id = [ 1,0,0,0; 0,1,0,0; 0,0,1,0; 0,0,0,1]
%4 =
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
? r1 = [ 1,-1,-2,1; 0,1,0,0; 0,0,1,0; 0,0,0,1]
%5 =
[1 -1 -2 1]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
? r1t = mattranspose(r1)
%6 =
[1 0 0 0]
[-1 1 0 0]
[-2 0 1 0]
[1 0 0 1]
? h1 = r1t * h * r1
%7 =
[1 0 0 0]
[0 0 0 -2]
[0 0 0 2]
[0 -2 2 0]
? r2 = [ 1,0,0,0; 0,1,0,0; 0,0,1,0; 0,1,0,1]
%8 =
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 1 0 1]
? r2t = mattranspose(r2)
%9 =
[1 0 0 0]
[0 1 0 1]
[0 0 1 0]
[0 0 0 1]
? h2 = r2t * h1 * r2
%10 =
[1 0 0 0]
[0 -4 2 -2]
[0 2 0 2]
[0 -2 2 0]
? r3 = [ 1,0,0,0; 0,1,1/2,-1/2; 0,0,1,0; 0,0,0,1]
%11 =
[1 0 0 0]
[0 1 1/2 -1/2]
[0 0 1 0]
[0 0 0 1]
? r3t = mattranspose(r3)
%12 =
[1 0 0 0]
[0 1 0 0]
[0 1/2 1 0]
[0 -1/2 0 1]
? h3 = r3t * h2 * r3
%13 =
[1 0 0 0]
[0 -4 0 0]
[0 0 1 1]
[0 0 1 1]
? r4 = [ 1,0,0,0; 0,1,0,0; 0,0,1,-1; 0,0,0,1]
%14 =
[1 0 0 0]
[0 1 0 0]
[0 0 1 -1]
[0 0 0 1]
? r4t = mattranspose(r4)
%15 =
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 -1 1]
? h4 = r4t * h3 * r4
%16 =
[1 0 0 0]
[0 -4 0 0]
[0 0 1 0]
[0 0 0 0]
? d = h4
%17 =
[1 0 0 0]
[0 -4 0 0]
[0 0 1 0]
[0 0 0 0]
? r = r1 * r2 * r3 * r4
%18 =
[1 0 -2 3]
[0 1 1/2 -1]
[0 0 1 -1]
[0 1 1/2 0]
? matdet(r)
%19 = 1
? q = matadjoint(r)
%20 =
[1 1 2 -1]
[0 1/2 -1/2 1/2]
[0 -1 1 1]
[0 -1 0 1]
? qt = mattranspose(q)
%21 =
[1 0 0 0]
[1 1/2 -1 -1]
[2 -1/2 1 0]
[-1 1/2 1 1]
? h
%22 =
[1 1 2 -1]
[1 1 2 -3]
[2 2 4 0]
[-1 -3 0 1]
? qt * d * q
%23 =
[1 1 2 -1]
[1 1 2 -3]
[2 2 4 0]
[-1 -3 0 1]
? q
%24 =
[1 1 2 -1]
[0 1/2 -1/2 1/2]
[0 -1 1 1]
[0 -1 0 1]
? d
%25 =
[1 0 0 0]
[0 -4 0 0]
[0 0 1 0]
[0 0 0 0]
?
Changing to $\;x,y,z,w\;$ :
$$\begin{align*}&\color{red}{x^2}+\color{red}{y^2}+\color{green}{4z^2}+w^2+\color{red}{2xy}+\color{green}{4xz}-2xw+4yz-6yw=\\{}\\ &=(x+y)^2+4\left(z+\frac12x\right)^2-x^2+w^2-2xw+4yz-6yw=\\{}\\ &=(x+y)^2+4\left(z+\frac12x\right)^2-(x+w)^2+2w^2+4yz-6yw=\\{}\\ &=(x+y)^2+4\left(z+\frac12x\right)^2-(x+w)^2+2\left(w-\frac32y\right)^2-\frac92y^2+4yz=\\{}\\ &=(x+y)^2+4\left(z+\frac12x\right)^2-(x+w)^2+2\left(w-\frac32y\right)^2-\frac92\left(y-\frac49z\right)^2+\frac89z^2\end{align*}$$