Bilinear & Quadratic Forms

diagonalization of a quadratic form

To diagonalize a quadratic form means to change variables so that it becomes a pure sum and difference of squares with no cross terms: Q = d_1 y_1^2 + d_2 y_2^2 + ... + d_n y_n^2. In matrix language you find an invertible P with P^T B P diagonal. The cross terms x_i x_j are exactly the off-diagonal entries of B, so killing them is the same as diagonalizing the matrix by congruence.

The hands-on method is completing the square, the same trick from high-school algebra extended to many variables. Group all terms containing x_1, force them into a perfect square (x_1 + something)^2, subtract the leftover, rename, and repeat on the remaining variables. Each step is an invertible change of variables, and the running product of those changes is the matrix P.

This is genuinely different from diagonalizing an operator. There you demand P^-1 B P diagonal (similarity, eigenvectors, eigenvalues); here you demand P^T B P diagonal (congruence). The diagonal entries you land on are NOT the eigenvalues of B — they can be scaled freely by squares of nonzero numbers. Only their signs are forced, which is the content of Sylvester's law of inertia.

Because you have freedom to rescale, the diagonal form is far from unique: y -> y/sqrt(|d|) turns each nonzero coefficient into +1 or -1, giving the canonical sum-of-squares with entries +1, -1, 0. The number of each kind is the one thing you cannot change — see signature. A symmetric form over any field of characteristic not 2 can always be diagonalized this way; an orthonormal (rigid) version is the principal axis theorem.

Q = x^2 + 4xy + y^2 = (x + 2y)^2 - 3y^2, set u=x+2y, v=y -> u^2 - 3v^2

Completing the square removes the cross term; the result is a signed sum of squares.

The diagonal entries from completing the square are NOT eigenvalues — only their signs are fixed. Use congruence here, never similarity.

Also called
reduction to a sum of squarescompleting the square