1

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

Cap
  • 117

2 Answers2

2

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]

? 
Will Jagy
  • 139,541
1

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*}$$

DonAntonio
  • 211,718
  • 17
  • 136
  • 287
  • Thanks. But, now I am fully confused. Shouldn't at the end i have $y_1, y_2, y_3, y_4$, which will be represented in terms of variables? – Cap May 22 '17 at 21:25
  • @Cap Yes, of course. You can either deduce it from the above, or to carry on the whole Lagrange's Method without "cuts" . For example, the first step would have to be $;(x+(y+2z-w))^2;$ , since we should/would complete the square for each variable at a whole. First, I didn't remember that, but now, after seeing the above, I think you can do it by yourself. It is messy, sometimes lots of work, but not that hard...and many times is much better to do by symmetric \matrices, diagonalization and stuff. – DonAntonio May 22 '17 at 21:30
  • am I right, I have got $(x+(y+2z-w))^2+(w+2(z-y))^2-4(z-y)^2+w^2$? – Cap May 22 '17 at 22:04
  • @Cap That can't be right just by looking at the terms of $;w^2;$ : you have one from the first term, another one from the second term and even one more from the last term, making that $;3w^2;$ . That's not what you have in the original expression. Perhaps you messed one sign...? – DonAntonio May 22 '17 at 22:10
  • Don, here is an algorithmic method i asked about, which is pretty much the reverse of this repeated completing the square; I, somewhat mistakenly, associated it with Hermite: http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr – Will Jagy May 22 '17 at 22:13
  • @DonAntonio yes, I have messed the sign at the end - it's $-w^2$ – Cap May 22 '17 at 22:16
  • @WillJagy Thanks for the link. I shall check it later, hopefully. It is too long for me to get into it now. – DonAntonio May 22 '17 at 22:17
  • $(x+(y+2z-w))^2+(w+2(z-y))^2-4(z-y)^2-w^2$ – Cap May 22 '17 at 22:17
  • @Cap That looks better and, perhaps, correct. I need to go in a minute but I'll try to take a peek to this later. – DonAntonio May 22 '17 at 22:19
  • ordered xyzt gives $$ (x+y+2z-t)^2 - (y-z+t)^2 + (-y+z+t)^2. $$ – Will Jagy May 22 '17 at 22:38
  • associated symmetric matrix has determinant zero, two positive irrational and one negative irrational eigenvalues. – Will Jagy May 22 '17 at 22:44