# Computing rank and signature of a quadratic form

I don't understand the 'completing the square' method for computing the rank and signature of a quadratic form. The rank and signature are defined to be $p + q$ and $p - q$ respectively, where $p$ and $q$ are the maximum dimensions of positive (resp. negative) definite subspaces of the space the quadratic form is defined on, but I just can't see how this method works.

Could anyone please explain?

Thanks.

-
Try diagonalizing the form, which you can do when the form is non-degenerate. Then substract the negative eigenvalues from the positive eigenvalues. Sylvester's theorem guarantees the signature is independent of the choice of basis. –  gary May 31 '11 at 1:44
Sorry, I just realized you were referring to the method of 'completing the square', which I don't recognize by name, and not just finding the signature. Can you describe it for us? –  gary May 31 '11 at 1:46
add comment