Skip to main content

Section 4.3 Quadratic forms

If you’ve done a couple of calculus courses, you’ve probably encountered conic sections, like the ellipse x2a2+y2b2=1 or the parabola yb=x2a2. You might also recall that your instructor was careful to avoid conic sections with equations including “cross-terms” like xy. The reason for this is that sketching a conic section like x2+4xy+y2=1 requires the techniques of the previous section.
A basic fact about orthogonal matrices is that they preserve length. Indeed, for any vector x in Rn and any orthogonal matrix P,
Px2=(Px)(Px)=(Px)T(Px)=(xTPT)(Px)=xTx=x2,
since PTP=In.
Note also that since PTP=In and detPT=detP, we have
det(P)2=det(PTP)=det(In)=1,
so det(P)=±1. If detP=1, we have what is called a special orthogonal matrix. In R2 or R3, multiplication by a special orthogonal matrix is simply a rotation. (If detP=1, there is also a reflection.)
We mentioned in the previous section that the Real Spectral Theorem is also referred to as the principal axes theorem. The name comes from the fact that one way to interpret the orthogonal diagonalization of a symmetric matrix is that we are rotating our coordinate system. The original coordinate axes are rotated to new coordinate axes, with respect to which the matrix A is diagonal. This will become more clear once we apply these ideas to the problem of conic sections mentioned above. First, a definition.

Definition 4.3.1.

A quadratic form on variables x1,x2,,xn is any expression of the form
q(x1,,xn)=ijaijxixj.
For example, q1(x,y)=4x24xy+4y2 and q2(x,y,z)=9x24y24xy2xz+z2 are quadratic forms. Note that each term in a quadratic form is of degree two. We omit linear terms, since these can be absorbed by completing the square. The important observation is that every quadratic form can be associated to a symmetric matrix. The diagonal entries are the coefficients aii appearing in Definition 4.3.1, while the off-diagonal entries are half the corresponding coefficients aij.
For example the two quadratic forms given above have the following associated matrices:
A1=[4224] and A2=[921240101].
The reason for this is that we can then write
q1(x,y)=[xy][4111][xy]
and
q2(x,y,z)=[xyz][921240101][xyz].
Of course, the reason for wanting to associate a symmetric matrix to a quadratic form is that it can be orthogonally diagonalized. Consider the matrix A1.
We find distinct eigenvalues λ1=2 and λ2=6. Since A is symmetric, we know the corresponding eigenvectors will be orthogonal.
The resulting orthogonal matrix is P=12[1111], and we find
PTAP=[2006], or A=PDPT,
where D=[2006]. If we define new variables y1,y2 by
[y1y2]=PT[x1x2],
then we find that
[x1x2]A[x1x2]=([x1x2]P)D(PT[x1x2])=[y1y2][2006][y1y2]=2y12+6y22.
Note that there is no longer any cross term.
Now, suppose we want to graph the conic 4x124x1x2+4x22=12. By changing to the variables y1,y2 this becomes 2y12+6y22=12, or y126+y222=1. This is the standard from of an ellipse, but in terms of new variables. How do we graph it? Returning to the definition of our new variables, we find y1=12(x1+x2) and y2=12(x1+x2). The y1 axis should be the line y2=0, or x1=x2. (Note that this line points in the direction of the eigenvector [11].) The y2 axis should be the line y1=0, or x1=x2, which is in the direction of the eigenvector [11].
This lets us see that our new coordinate axes are simply a rotation (by π/4) of the old coordinate axes, and our conic section is, accordingly, an ellipse that has been rotated by the same angle.

Remark 4.3.2.

One reason to study quadratic forms is the classification of critical points in calculus. You may recall (if you took Calculus 1) that for a differentiable function f(x), if f(c)=0 and f(c)>0 at some number c, then f has a local minimum at c. Similarly, if f(C)=0 and f(c)<0, then f has a local maximum at c.
For functions of two or more variables, determining whether a critical point is a maximum or minimum (or something else) is more complicated. Or rather, it is more complicated for those unfamiliar with linear algebra! The second-order partial derivatives of our function can be arranged into a matrix called the Hessian matrix. For example, a function f(x,y) of two variables has first-order partial derivatives fx(x,y) and fy(x,y) with respect to x and y, respectively, and second-order partial derivatives fxx(x,y) (twice with respect to x), fxy(x,y) (first x, then y), fyx(x,y) (first y, then x), and fyy(x,y) (twice with respect to y).
The Hessian matrix at a point (a,b) is
Hf(a,b)=[fxx(a,b)fxy(a,b)fyx(a,b)fyy(a,b)].
As long as the second-order partial derivatives are continuous at (a,b), it is guaranteed that the Hessian matrix is symmetric! That means that there is a corresponding quadratic form, and when the first-order derivatives fx(a,b) and fy(a,b) are both zero (a critical point), it turns out that this quadratic form provides the best quadratic approximation to f(x,y) near the point (a,b). This is true for three or more variables as well.
The eigenvalues of this matrix then give us some information about the behaviour of our function near the critical point. If all eigenvalues are positive at a point, we say that the corresponding quadratic form is positive-definite, and the function f has a local minimum at that point. If all eigenvalues are negative at a point, we say that the corresponding quadratic form is negative-definite, and the function f has a local maximum at that point. If all eigenvalues are nonzero at a point, with some positive and some negative, we say that f has a saddle point. The corresponding quadratic form is called indefinite, and this term applies even if some eigenvalues are zero.
If a quadratic form corresponds to a symmetric matrix whose eigenvalues are positive or zero, we say that the quadratic form is positive-semidefinite. Similarly, a negative-semidefinite quadratic form corresponds to symmetric matrix whose eigenvalues are all less than or equal to zero.

Exercises Exercises

1.

Write the matrix of the quadratic form Q(x1,x2,x3)=7x12x223x32+9x1x26x1x3+4x2x3.

2.

Determine the quadratic form Q(x)=xTAx associated to the matrix
A=[985859594].

3.

The matrix
A=[2.100.30600.302.9]
has three distinct eigenvalues, λ1<λ2<λ3. Find the eigenvalues, and classify the quadratic form Q(x)=xTAx.
You have attempted 1 of 4 activities on this page.