0

I'd like to write $2xy+2xz+2yz$ in the form $a(\cdots)^2+b(\cdots)^2+c(\cdots)^2$ where each blank space is a linear combination of $x,y,z$. The closest I have is:

$$(x+y+z)^2-(x-z)^2-y^2=2xy+4xz+2yz$$ Working: Spotting something didn't work so I've noted that:

$$\mathbf{x}^{\text{T}}M\mathbf{x}=2xy+2xz+2yz;\quad M=\begin{pmatrix} 0 & 1 & 1 \\ 1 & 0 & 1 \\ 1 & 1 &0 \end{pmatrix}$$ I found eigenvalues $2,-1,-1$ and the eigenvectors $(1,1,1),\;(-1,1,0),\;(-1,0,1)$.

So in the eigenbasis the expression becomes $2u^2-v^2-w^2$. But I'm having trouble writing $u,v,w$ in terms of $x,y,z$. Can someone help?

If it is of any help:

$$P=\begin{pmatrix} -1 & -1 & 1 \\ 0 & 1 & 1 \\ 1 & 0 & 1\end{pmatrix}\quad P^{-1}=\frac{1}{3}\begin{pmatrix} -1 & -1 & 2 \\ -1 & 2 & -1 \\ 1 & 1 & 1\end{pmatrix}$$

Give $M=PDP^{-1}$ where $D$ is diagonal with entries $-1,-1,2$.

user118224
  • 1,509

3 Answers3

3

You’re on the right track by finding the matrix for this quadratic form and diagonalizing it. Take $\langle-1,2,-1\rangle$ as an eigenvector instead of $\langle-1,1,0\rangle$ so that after normalizing you end up with a rotation: $$ R=\pmatrix{ \frac1{\sqrt3} & \frac1{\sqrt2} & -\frac1{\sqrt6} \\ \frac1{\sqrt3} & 0 & \frac2{\sqrt6} \\ \frac1{\sqrt3} & -\frac1{\sqrt2} & -\frac1{\sqrt6} } \\ M=R\pmatrix{4&0&0\\0&-1&0\\0&0&-1}R^{-1}. $$ Noting that $R^{-1}=R^T$, the terms you’re looking for are then given by $$ R^T\pmatrix{x\\y\\z}=\pmatrix{\frac1{\sqrt3}(x+y+z) \\ \frac1{\sqrt2}(x-z) \\ -\frac1{\sqrt6}(x-2y+z)}. $$ Putting it all together, $$\begin{align} 2xy+2xz+2yz &= 2\left(\frac1{\sqrt3}(x+y+z)\right)^2-\left(\frac1{\sqrt2}(x-z)\right)^2-\left(-\frac1{\sqrt6}(x-2y+z)\right)^2 \\ &= \frac{2}{3}\left(x+y+z\right)^2-\frac1{2}\left(x-z\right)^2-\frac1{6}\left(x-2y+z\right)^2. \end{align}$$ By symmetry, any permutation of the variables in the above expression will also work.

Addendum: The alert reader will have noticed that the squared terms are the dot products of the corresponding normalized eigenvectors with $(x,y,z)$, so the sum-of-squares expression can be written down directly once the eigenvalues and orthonormal eigenvectors are known.

amd
  • 53,693
  • 1
    not necessary to find eigenvalues, although that is an option for this problem. See http://math.stackexchange.com/questions/329304/bilinear-form-diagonalisation answer and posted algorithm "Congruence Diagonalization" at http://math.stackexchange.com/questions/395634/given-a-4-times-4-symmetric-matrix-is-there-an-efficient-way-to-find-its-eige These methods are all equivalent to Hermite's reduction method for quadratic forms. Guaranteed to use only rational numbers. – Will Jagy Nov 06 '15 at 18:41
1

This is the method shown at this answer: Given a $4\times 4$ symmetric matrix, is there an efficient way to find its eigenvalues and diagonalize it?

What I did in following the algorithm was to take symmetric $M$ and find an $R$ of determinant $1$ such that $R^T M R = D.$ Now, as it happens, the task you settled on is better served by taking $Q = R^{-1},$ after which we have $Q^T D Q = M,$ with $D$ diagonal. I got $$ D = \left( \begin{array}{ccc} 2 & 0 & 0 \\ 0 & \frac{-1}{2} & 0 \\ 0 & 0 & -2 \end{array} \right) $$ and $$ Q = \left( \begin{array}{ccc} \frac{1}{2} & \frac{1}{2} & 1 \\ -1 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right) $$ It is the diagonal elements of $D$ and the rows of $Q$ that give your expression, $$ 2 \left(\frac{x}{2} + \frac{y}{2} + z \right)^2 - \frac{1}{2} \left( -x + y \right)^2 - 2 z^2 \; \; = \; \; 2 yz + 2zx + 2xy.$$

PARI/GP is free software, covered by the GNU General Public License


? m = [ 0,1,1; 1,0,1; 1,1,0]
%1 = 
[0 1 1]

[1 0 1]

[1 1 0]

? 
? m = [ 0,1,1; 1,0,1; 1,1,0]
%1 = 
[0 1 1]

[1 0 1]

[1 1 0]

? r1 = [ 1,0,0; 1,1,0; 0,0,1 ]
%2 = 
[1 0 0]

[1 1 0]

[0 0 1]

? m1 = mattranspose(r1) * m * r1
%3 = 
[2 1 2]

[1 0 1]

[2 1 0]

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

[0 1 0]

[0 0 1] 


? m2 = mattranspose(r2) * m1 * r2 
%5 = 
[2 0 0]

[0 -1/2 0]

[0 0 -2]


? r = r1 * r2
%6 = 
[1 -1/2 -1]

[1 1/2 -1]

[0 0 1]


? 
?  diagonal  = mattranspose(r) * m * r 
%7 = 
[2 0 0]

[0 -1/2 0]

[0 0 -2]



? 
? matdet(r)
%8 = 1
? 
?  q = matadjoint(r)
%9 = 
[1/2 1/2 1]

[-1 1 0]

[0 0 1]

? 
?  diagonal 
%10 = 
[2 0 0]

[0 -1/2 0]

[0 0 -2]

? 
? expression = mattranspose(q) *  diagonal  *  q 
%11 = 
[0 1 1]

[1 0 1]

[1 1 0]

? 
Will Jagy
  • 139,541
  • @arthur, well, this quadratic form is indefinite, it can take positive values or negative depending on $x,y,z.$ As a result it cannot be the sum of three squares without the coefficients (some negative) we found, in various ways. There is no, well, closed form way, given integer $n > 0,$ to predict integers $w,x,y,z$ such that $w^2 + x^2 + y^2 + z^2 = n.$ Some methods of searching are faster than others. Also, Jacobi found a way to count all possible such quadruples $(w,x,y,z)$ that work, without actually finding them; but it is not easy. – Will Jagy Nov 06 '15 at 22:49
  • @ Will Jagy - accidentally deleted my comment. "Any integer is a sum of four squares". –  Nov 06 '15 at 22:53
0

$$\mathbf{x}^TM\mathbf{x} = 0$$ $$\mathbf{x}^TPDP^{-1}\mathbf{x}=0$$

$$\mathbf{y} = P^{-1}\mathbf{x} $$ $$ \mathbf{y}^TD\mathbf{y} = 0$$

$$ \displaystyle \sum_{k=1}^ny_k^2d_k = 0$$

$$ M = \begin{bmatrix}0 & 1 &1 \\1 & 0 & 1 \\1 & 1 & 0 \end{bmatrix}$$

$$ [P\ D] = eig(M)\ \ \ (octave)$$

$$ P = \begin{bmatrix} -0.715240 & 0.393825 & 0.577350 \\ 0.016557 & -0.816329 & 0.577350 \\ 0.698683 & 0.422503 & 0.577350 \end{bmatrix}$$

$$ D = \begin{bmatrix} -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 2 \end{bmatrix}$$

$$ P^{-1} = \begin{bmatrix} -0.715240 & 0.016557 & 0.698683 \\ 0.393825 & -0.816329 & 0.422503 \\ 0.577350 & 0.577350 & 0.577350 \end{bmatrix}$$

$$ \mathbf{y}_1 = -0.715240 x + 0.016557 y + 0.698683 z$$ $$ \mathbf{y}_2 = 0.393825 x + -0.816329 y + 0.422503 z$$ $$ \mathbf{y}_3 = 0.577350 x + 0.577350 y + 0.577350 z$$

$$ -y_1^2 -y_2^2 + 2y_3^2 = 2yz + 2 xz + 2xy$$

sanity check with maxima:

$$ expand(-(-0.715240 *x + 0.016557 *y + 0.698683* z)^2 + -(0.393825 *x + -0.816329* y + 0.422503* z)^2 + \\ 2*(0.577350 *x + 0.577350 *y + 0.577350* z)^2); $$

$$ = -6.744980000639167e-7 z^2 + 1.999998804112 y z + 1.99999965989 x z -1.125489999951462e-6 y + 1.99999808421 x y - 3.432249999768544e-7 x^2$$

Rounding off:

$$ 2yz + 2 xz + 2xy$$

  • Can we get something simpler by using $$P=\begin{pmatrix} -1 & -1 & 1 \ 0 & 1 & 1 \ 1 & 0 & 1\end{pmatrix}\quad P^{-1}=\frac{1}{3}\begin{pmatrix} -1 & -1 & 2 \ -1 & 2 & -1 \ 1 & 1 & 1\end{pmatrix}?$$ The method doesn't seem to work... – user118224 Nov 06 '15 at 04:54
  • det(P) = -3 , octave's eig() normalizes P so det(P) = 1. I'll see if $\frac{1}{3^{\frac{1}{3}}}P$ works? –  Nov 06 '15 at 05:15
  • 1
    You need $P^T=P^{−1}$ so that $y^T = x^TP = (P^Tx)^T = (P^{-1}x)^T = y^T$ –  Nov 06 '15 at 06:08
  • 1
    not necessary to find eigenvalues, although that is an option for this problem. See http://math.stackexchange.com/questions/329304/bilinear-form-diagonalisation answer and posted algorithm "Congruence Diagonalization" at http://math.stackexchange.com/questions/395634/given-a-4-times-4-symmetric-matrix-is-there-an-efficient-way-to-find-its-eige These methods are all equivalent to Hermite's reduction method for quadratic forms. Guaranteed to use only rational numbers. – Will Jagy Nov 06 '15 at 18:42
  • posted answer by the algorithm; Because of the direction the question wanted, it was necessary to find a matrix inverse. However, given that it was a three by three with rational entries and determinant $1,$ this could also have been done by hand. – Will Jagy Nov 06 '15 at 22:18