0

If one has a symmetric matrix $A$, one can diagonalize it with an orthonormal change of basis vectors, e.g. $S^TAS$ is diagonal. Now lets consider the following matrix $$A=\begin{bmatrix} 1&1\\ 1&2 \end{bmatrix}. $$ This matrix corresponds to the symmetric form $$x_1^2+2x_1x_2+2x_2^2=(x_1+x_2)^2+x_2^2.$$

For me this looks like there has to be a way of determining some $S$ as above (without having to diagonalize etc., just by completing of the square) by taking some change of variables $x_1\leadsto x_1+x_2,\ x_2\leadsto x_2$. This would be done by the matrix $$S=\begin{bmatrix} 1&1\\ 0&1 \end{bmatrix}$$ but this doesn't work out for me...

Any help will be gratefully appreciated.

Edit: Let me reformulate my question. By Sylvester's law of inertia there exists for every symmetric matrix $A$ some basis such that $S^TAS$ is diagonal with only 1,-1 and 0 on the diagonal, where $S$ is a (not necessarily orthogonal) invertible matrix. I want to determine $S$ without having to calculate all the eigenvalues and diagonalize $A$, because the eigenvalues dont occur in the wanted form.

  • Generally the method of completing squares may not deduce the same result as orthogonal diagonalization. Maybe you could try another way to complete squares. – xbh Aug 05 '18 at 11:22
  • Why not? Isnt there any way to find $S$ by this procedure? – Luke Mathwalker Aug 05 '18 at 11:43
  • Completing squares you remain in the same field containing the coefficients, since you only need to divide by $2$ sometimes, take squares, add and multiply. On the other hand, in some cases, and your example is one of those, the eigenvalues don't belong to the same field. In your example, the coefficients are all rational numbers, while the eigenvalues are not. The algorithm will need to have some step that takes you out of the same field. –  Aug 05 '18 at 12:10
  • Ok I see. I dont want to get the eigenvalues, just some diagonal matrix, I'm interested in the signature of the form and a change of basis vectors, so that $S^TAS$ is in the "signature form" with 1,-1 and 0 on the diagonal, so we can reduce modulo square numbers which we write in $S$ to leave the field in the last step. I still believe that this should be possible without having to calculate all the eigenvalues. – Luke Mathwalker Aug 05 '18 at 12:29
  • Your $S$ isn't orthogonal. The special thing about symmetric matrices is that they are orthogonally (or unitarily) diagonalizable (that's why you see $S^TAS$, not $S^{-1}AS$). – Arthur Aug 05 '18 at 12:40
  • @Arthur thats right. But I dont want $S$ to be necessarily orthogonal. If $S^TAS$ is diagonal then so is $B^TAB$ where $B$ is chosen to be the same as $S$ with some columns scaled. – Luke Mathwalker Aug 05 '18 at 13:27
  • I edited my question. I hope it is clearer now. Sorry for confusing... – Luke Mathwalker Aug 05 '18 at 13:33
  • If $S=I$ is the identity matrix and $S^TAS$ is diagonal, then $A=I^TAI$ is diagonal, say $A=diag(a_1,\ldots,a_n)$. Surely $B^TAB=(\lambda I)^Tdiag(a_1,\ldots,a_n)(\lambda I)=diag(\lambda^2a_1,\ldots,\lambda^2a_n)$ is again diagonal. I dont get your point. – Luke Mathwalker Aug 05 '18 at 13:40

1 Answers1

1

We can, given a symmetric matrix of integers or rational numbers, construct $P^THP = D$ with rational $P$ and $\det P = \pm 1.$ If it is imperative to have diagonal elements restricted to $\pm 1, 0,$ we may take the final $D$ and construct a further diagonal $F$ with elements the reciprocals of some square roots to get $FDF$ the way you want. In this particular problem, no need.

Algorithm discussed at http://math.stackexchange.com/questions/1388421/reference-for-linear-algebra-books-that-teach-reverse-hermite-method-for-symmetr
https://en.wikipedia.org/wiki/Sylvester%27s_law_of_inertia
$$ H = \left( \begin{array}{rr} 1 & 1 \\ 1 & 2 \\ \end{array} \right) $$ $$ D_0 = H $$ $$ E_j^T D_{j-1} E_j = D_j $$ $$ P_{j-1} E_j = P_j $$ $$ E_j^{-1} Q_{j-1} = Q_j $$ $$ P_j Q_j = Q_j P_j = I $$ $$ P_j^T H P_j = D_j $$ $$ Q_j^T D_j Q_j = H $$

$$ H = \left( \begin{array}{rr} 1 & 1 \\ 1 & 2 \\ \end{array} \right) $$

==============================================

$$ E_{1} = \left( \begin{array}{rr} 1 & - 1 \\ 0 & 1 \\ \end{array} \right) $$ $$ P_{1} = \left( \begin{array}{rr} 1 & - 1 \\ 0 & 1 \\ \end{array} \right) , \; \; \; Q_{1} = \left( \begin{array}{rr} 1 & 1 \\ 0 & 1 \\ \end{array} \right) , \; \; \; D_{1} = \left( \begin{array}{rr} 1 & 0 \\ 0 & 1 \\ \end{array} \right) $$

==============================================

$$ P^T H P = D $$ $$\left( \begin{array}{rr} 1 & 0 \\ - 1 & 1 \\ \end{array} \right) \left( \begin{array}{rr} 1 & 1 \\ 1 & 2 \\ \end{array} \right) \left( \begin{array}{rr} 1 & - 1 \\ 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rr} 1 & 0 \\ 0 & 1 \\ \end{array} \right) $$ $$ Q^T D Q = H $$ $$\left( \begin{array}{rr} 1 & 0 \\ 1 & 1 \\ \end{array} \right) \left( \begin{array}{rr} 1 & 0 \\ 0 & 1 \\ \end{array} \right) \left( \begin{array}{rr} 1 & 1 \\ 0 & 1 \\ \end{array} \right) = \left( \begin{array}{rr} 1 & 1 \\ 1 & 2 \\ \end{array} \right) $$

Will Jagy
  • 139,541
  • Excellent answer! There actually was some link you referenced where you did exactly what I meant. Thanks, that's really a lot easier to compute than to diagonalize. – Luke Mathwalker Aug 06 '18 at 09:51