On this page
Take x² + 4xy + y². Every coefficient is positive, yet x = 1, y = −1 gives 1 − 4 + 1 = −2. Sylvester's law of inertia settles questions like this, and explains why the answer cannot depend on your method.
What does Sylvester's law of inertia say?
A real quadratic form can be written as xᵀSx with S symmetric. For x² + 4xy + y², S has rows (1, 2) and (2, 1): square coefficients on the diagonal, half the cross coefficient off it (matrix representation of conic sections).
Any real quadratic form can be brought by an invertible change of variables to a sum of squares with coefficients +1, −1 and 0, and the number of each kind does not depend on the change chosen (Sylvester's law of inertia). In matrix terms, S and PSPᵀ have the same counts for every invertible P.
The counts (n₊, n₋, n₀) are the inertia of the form. Many books call n₊ − n₋ the signature; others use the word for the whole triple, so check your textbook.
James Joseph Sylvester (1814–1897) published the proof in August 1852 in the Philosophical Magazine, volume 4, pages 138–142 (the 1852 paper; MacTutor biography).
How do you diagonalise x² + 4xy + y² by completing squares?
Gather the x terms and complete the square:
x² + 4xy + y² = (x + 2y)² − 4y² + y² = (x + 2y)² − 3y².
Set u = x + 2y and v = √3·y. The form becomes u² − v²: one +1, one −1, no zeros. The inertia is (1, 1, 0) and the signature is 0. The substitution is invertible, because y = v/√3 and x = u − 2v/√3.
That explains the surprise: y = 0 gives x², which is positive, while x = −2y gives −3y², which is negative. A form that takes both signs is called indefinite.
Another route: x² + 4xy + y² = (3/2)(x + y)² − (1/2)(x − y)²; expand to check. The coefficients differ from 1 and −3, but the pattern is again one plus, one minus. A change of variables can change the sizes of the coefficients, never the count of each sign.
Why do eigenvalue signs give the same answer?
S is symmetric, so an orthogonal change of basis makes it diagonal with its eigenvalues on the diagonal (see our guide to the spectral theorem for symmetric matrices). A rotation is one more invertible change of variables, so the numbers of positive, negative and zero eigenvalues are exactly n₊, n₋ and n₀ (statement in terms of eigenvalues).
Here (1 − λ)² − 4 = 0 gives λ = 3 or λ = −1, with eigenvectors along (1, 1) and (1, −1). One positive, one negative: the same (1, 1, 0). The second identity above is this rotation in disguise.
A quicker check: when the leading principal minors are all non-zero, the number of sign changes in 1, Δ₁, Δ₂, … equals n₋, by the same source. Here 1, 1, −3 has one sign change, so n₋ = 1. These minors also drive a test in how to tell if a matrix is positive definite.
How does the signature classify conics?
For a non-degenerate conic Ax² + Bxy + Cy² + Dx + Ey + F = 0, the sign of AC − B²/4 decides the type: positive gives an ellipse, zero a parabola, negative a hyperbola (matrix representation of conic sections). That determinant is the product of the two eigenvalues, so only the eigenvalue signs matter:
inertia (2, 0, 0) or (0, 2, 0): an ellipse (or a point, or no real points)
inertia (1, 1, 0): a hyperbola (or two crossing lines)
one zero eigenvalue: a parabola (or parallel lines, which may coincide or not be real)
So x² + 4xy + y² = 1 is a hyperbola. In eigen-coordinates it reads 3u² − v² = 1, with axes along y = x and y = −x, as drawn above. Since only signs matter, (x + 2y)² − 3y² already told you the type.
A four-step routine for any quadratic form
Write the symmetric matrix.
Complete squares one variable at a time, so the substitution is triangular and invertible. If no squared term is left, as in xy, first put x = s + t, y = s − t.
Count the plus, minus and zero coefficients: that is the inertia.
Check another way. For 2×2: negative determinant means (1, 1, 0); positive determinant with positive trace means (2, 0, 0); with negative trace, (0, 2, 0); zero determinant means one zero.
If two methods disagree, look for a substitution that was not invertible; how a change of basis matrix works shows why that matters.
To see how quadratic forms connect to eigenvalues and conics, the Fermi Concept Library gives every concept in mathematics its own lesson and its place in the map. For practice, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



