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
$\begingroup$ Generally the method of completing squares may not deduce the same result as orthogonal diagonalization. Maybe you could try another way to complete squares. $\endgroup$
Commented Aug 5, 2018 at 11:22 $\begingroup$ Why not? Isnt there any way to find $S$ by this procedure? $\endgroup$ Commented Aug 5, 2018 at 11:43$\begingroup$ 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. $\endgroup$
– user580373 Commented Aug 5, 2018 at 12:10$\begingroup$ 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. $\endgroup$
Commented Aug 5, 2018 at 12:29$\begingroup$ 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^AS$). $\endgroup$