Quadratic forms: matrix form, evaluation and eigenvalue classification
What a quadratic form is
A quadratic form on ℝn is a function in which every term has total degree exactly 2, for example Q(x, y) = 3x2 − 4xy + 6y2. There are no linear terms and no constant. Every such form can be written as
Q(x) = xTAx, with A a symmetric n × n matrix.
Many matrices produce the same polynomial, but exactly one of them is symmetric, and the symmetric one is the matrix whose eigenvalues carry the classification information. That is why the convention is always to use it.
From polynomial to symmetric matrix
- The coefficient of xi2 goes on the diagonal entry aii.
- The coefficient c of the cross term xixj (i ≠ j) is split in half: aij = aji = c/2.
The split is needed because xTAx contains both aijxixj and ajixjxi, which add to 2aijxixj.
Example. For Q(x, y) = 3x2 − 4xy + 6y2, the diagonal is 3 and 6 and the cross coefficient −4 is split into −2 and −2:
A = rows (3, −2) and (−2, 6).
From symmetric matrix to polynomial
Reverse the rule: diagonal entries give squared-term coefficients, and each off-diagonal pair aij = aji gives the cross term 2aijxixj. A zero diagonal entry simply means that squared term is absent.
Evaluating a quadratic form
Either substitute into the polynomial or compute xT(Ax). Doing both is a good check. For the example at (x, y) = (1, 2):
- Polynomial: 3(1) − 4(1)(2) + 6(4) = 3 − 8 + 24 = 19.
- Matrix: A(1, 2) = (3 − 4, −2 + 12) = (−1, 10); then (1, 2)·(−1, 10) = −1 + 20 = 19.
Classifying with eigenvalues
By the spectral theorem (a prerequisite), a symmetric A has real eigenvalues λ1, …, λn and an orthonormal eigenbasis. In the coordinates y of that eigenbasis the form has no cross terms:
Q = λ1y12 + λ2y22 + … + λnyn2,
where yi = ui·x for unit eigenvectors ui. The signs of the eigenvalues therefore decide the signs Q can take:
Eigenvalues of A | Classification of Q | Meaning |
|---|---|---|
all > 0 | positive definite | Q(x) > 0 for every x ≠ 0 |
all < 0 | negative definite | Q(x) < 0 for every x ≠ 0 |
some > 0 and some < 0 | indefinite | Q takes both positive and negative values |
all ≥ 0, at least one equal to 0 | positive semidefinite (not definite) | Q ≥ 0, and Q = 0 for some x ≠ 0 |
all ≤ 0, at least one equal to 0 | negative semidefinite (not definite) | Q ≤ 0, and Q = 0 for some x ≠ 0 |
For the example, trace A = 9 and det A = 18 − 4 = 14. The eigenvalues satisfy λ2 − 9λ + 14 = 0, so λ = 7 and 2. Both are positive, so Q is positive definite.
Two common traps. Positive diagonal entries do not make a form positive definite; the cross terms can still make it negative in some direction.
And if you forget to halve the cross coefficient, you are working with a different matrix whose eigenvalues belong to a different form. (Determinant-based and pivot-based definiteness tests, and the full diagonalization procedure, are developed in sibling lessons.)
Consider Q(x, y) = x2 + 6xy + 2y2. Its symmetric matrix A has characteristic polynomial λ2 − 3λ − 7.
How should Q be classified?
Mark Yourself Question
- Grab a piece of paper and try this problem yourself.
- When you're done, check the "I have answered this question" box below.
- View the solution and report whether you got it right or wrong.
Let A be the symmetric matrix with rows (4, −1, 2), (−1, 0, 3), (2, 3, −2), and let Q(x) = xTAx for x = (x1, x2, x3).
- Give the coefficients of x1x2, x1x3 and x2x3 in Q.
- Evaluate Q(1, 2, −1).
- Evaluate Q(0, 1, 1).
- Based on parts 2 and 3, state whether Q can be positive definite, negative definite, or must be indefinite.