The curve is an ellipse, but its axes are tilted, and the term hides which way they point. Changing to perpendicular coordinates along the eigenvectors of its symmetric matrix removes that term and leaves a weighted sum of squares. The signs of the weights then settle a question that the signs of the entries cannot, namely whether the expression is positive for every nonzero input. This lesson writes quadratic forms with symmetric matrices, explains the factor in a cross term, and classifies forms as definite, semidefinite or indefinite by the signs of their eigenvalues. Tuples such as stand for column vectors.
Key terms
Quadratic form
Definition A quadratic form on is a function from to of the form
for some real matrix . The product is a vector, and its dot product with is a single number, so assigns a scalar to each vector, unlike the linear map . Every term has degree exactly in the entries of , so for every real . In particular and . A quadratic form is generally not linear.
In plain words A quadratic form is a polynomial in the coordinates in which every term is a constant times the square of one coordinate or times the product of two. It takes a vector and returns one number.
Example With and
the product is , and its dot product with is
Doubling the input multiplies the value by four, since and . The form is not linear, because while .
Matrix of a quadratic form
Definition Every quadratic form can be written as with symmetric, and this symmetric matrix is unique. It is called the matrix of the quadratic form. If for some real square matrix , split into its symmetric part and its skew-symmetric part . The skew part contributes nothing, because the number equals its own transpose and is therefore . The symmetric matrix is unique because its entries are determined by values of , namely and, for ,
A cross term of is a term with . In the symmetric matrix its coefficient is split equally between two positions, , while the coefficient of is . In two variables,
In plain words The diagonal holds the coefficients of the squares. Each cross-term coefficient is cut in half and placed on both sides of the diagonal, because the product picks up once from and once from .
Example The form has the matrix
There is no term, so , and there is no term, so . As a check, , and . The nonsymmetric matrix with rows and gives the same form as its symmetric part, the matrix with rows and . Copying the full coefficient into both places is a common mistake. The matrix with rows and gives , a different form.
Principal axes of a quadratic form
Definition Let with real symmetric, and let be an orthogonal diagonalization with orthonormal eigenvectors and eigenvalues . The lines through the origin spanned by are the principal axes of . When an eigenvalue is repeated, the axes inside its eigenspace can be chosen in many ways, and any orthonormal choice works. In the coordinates along these axes, so that and , the form has no cross terms,
Because is orthogonal, the new coordinates measure lengths and angles exactly as the old ones do, so a level set keeps its shape and size and is only described differently. When and , the level curve is an ellipse with semi-axes of length along and along .
In plain words Measure along the eigenvector directions instead of along the standard axes. In those coordinates the form is a weighted sum of squares, and the weights are the eigenvalues.
Example For , the matrix from the first example has , with eigenvectors for and for . These are perpendicular and have length , so the principal-axis coordinates are
and . Expanding confirms this, since
which is . The ellipse has semi-axis along and semi-axis along . For instance the unit vector gives .
Positive definite and negative definite
Definition A real symmetric matrix , and its quadratic form , are positive definite if for every nonzero in , and negative definite if for every nonzero . The zero vector is excluded because always. The eigenvalue test says that is positive definite if and only if all its eigenvalues are positive, and negative definite if and only if all its eigenvalues are negative. To prove the first statement, write with . Since is invertible, exactly when . If every , all terms are nonnegative and at least one is positive, so . Conversely, a unit eigenvector gives
so a positive definite form has every . The negative case follows by applying this to .
In plain words A definite form has the same strict sign in every direction. The test looks at every eigenvalue, and the signs of the entries do not decide it.
Example The form is positive definite, because its eigenvalues and are positive. The symmetric matrix
has and , so its eigenvalues are and , and it is negative definite even though two of its entries are positive. Indeed
which is negative unless and , that is, unless .
Positive and negative semidefinite
Definition A real symmetric matrix , and its form , are positive semidefinite if for every in , and negative semidefinite if for every . The same argument in eigen-coordinates shows that is positive semidefinite if and only if all its eigenvalues are nonnegative, and negative semidefinite if and only if all are nonpositive. The classes are inclusive. A positive definite matrix is also positive semidefinite, and the zero matrix is both positive and negative semidefinite but neither positive nor negative definite. For a positive semidefinite , the value is exactly when . Indeed with every forces whenever , so is a combination of eigenvectors for the eigenvalue , and these lie in . As a consequence, a positive semidefinite matrix is positive definite exactly when it is invertible.
In plain words A semidefinite form never changes sign, but it may be flat in some directions. For a positive semidefinite form the flat directions are exactly the null space of its matrix.
Example The form has the matrix
with and , so its eigenvalues are and . It is positive semidefinite but not positive definite. Its zeros are the solutions of , the multiples of , and these make up . The form is negative semidefinite, with the same flat line.
Indefinite form
Definition A real symmetric matrix , and its form , are indefinite if takes both signs, that is, and for some vectors and . This happens if and only if has at least one positive and at least one negative eigenvalue. The signs of the eigenvalues therefore classify every real symmetric matrix.
| Eigenvalues | Class |
|---|---|
| all | positive definite |
| all | negative definite |
| all and some | positive semidefinite, not definite |
| all and some | negative semidefinite, not definite |
| some and some | indefinite |
The zero matrix belongs to both semidefinite rows. Two vectors with values of opposite signs prove that a form is indefinite without computing any eigenvalue. For an indefinite form, does not mean , since positive and negative terms can cancel.
In plain words An indefinite form rises in some directions and falls in others, like a saddle. In two variables its nonzero level curves are hyperbolas rather than ellipses.
Example The form has the matrix and is indefinite, since and . Its value at is , yet the matrix sends to , not to . Positive entries do not prevent indefiniteness either. The matrix with rows and has only positive entries, but its eigenvalues are and , and its form gives and .
Check yourself
- Write the symmetric matrix of and classify the form. What goes wrong if the coefficient is placed in both off-diagonal positions?
Show the answer
Half of the cross-term coefficient goes in each off-diagonal position, so
Since and , the eigenvalues are and . Both are positive, so is positive definite. In the principal-axis coordinates and the form is , and indeed .
The matrix with rows and belongs to the different form . Its eigenvalues are and , and its form takes the value at , where the true form has . The copying mistake would turn a positive definite form into an indefinite one.
- For which real numbers is positive definite, positive semidefinite, negative semidefinite or indefinite?
Show the answer
The matrix has rows and . It sends to and to , so for every the eigenvalues are and , and
with and .
When , both eigenvalues are positive and is positive definite.
When or , the eigenvalues are and , so is positive semidefinite but not positive definite. For the form is , which is on the line , the null space of its matrix.
Since the classes are inclusive, is positive semidefinite exactly when .
When or , one eigenvalue is positive and the other negative, so is indefinite. For example gives and .
The form is never negative semidefinite, and so never negative definite, because for every . Alternatively, the eigenvalues add up to , so they cannot both be nonpositive.
- Classify and find every vector with .
Show the answer
Each cross-term coefficient is , so each off-diagonal entry is , and
The th entry of is , where . So , and every nonzero vector of the plane , such as , is an eigenvector for . The eigenvalues are , and , all nonnegative with one equal to , so is positive semidefinite but not positive definite.
By the semidefinite case, exactly when is in , which is the line of multiples of . The identity
confirms both conclusions, since a sum of squares is never negative and is exactly when .