17. Quadratic form

Quadratic form

Finally we make a step out of strictly linear algebra to discuss quadratic forms. A quadratic form is a function which assigns a number to each vector, in such a way that it is sum of products of two coordinates, e.g. q(x,y,z)=x^2-2xy+4xz-5z^2. The square of the norm is also an example of a quadratic form (|(x,y,z)|^2=x^2+y^2+z^2).

We can classify forms with respect to possible sign of results:

  • form q\colon V\to\mathbb{R} is positively definite, if for all v\in V, we get q(v)>0.
  • form q\colon V\to\mathbb{R} is negatively definite, if for all v\in V, we get q(v)<0.
  • form q\colon V\to\mathbb{R} is positively semidefinite, if for all v\in V, we get q(v)\geq 0.
  • form q\colon V\to\mathbb{R} is negatively semidefinite, if for all v\in V, we get q(v)\leq 0.

Obviously a form may not fall in any of those categories, if for some v,w\in V we have q(v)>0 and q(w)<0. Such forms are called indefinite.

Matrix of a form

Notice, that for any quadratic form q we can consider a matrix M, such that q(v)=v\cdot M\cdot v^T (so we multiply this matrix by a vector from the left and by the same but vertical vector from the right). We shall also assume that M is symmetrical (with respect to its diagonal). E.g., let q(x,y,z)=x^2-2xy+4xz-5z^2, then:

    \[q(x,y,z)=[x,y,z]\cdot \left[\begin{array}{ccc}1&-1&2\\-1&0&0\\2&0&-5\end{array}\right]\cdot \left[\begin{array}{c}x\\y\\z\end{array}\right]\]

so notice, that the coefficients are divided by 2 outside the diagonal, because the same expression is generated twice.

Sylvester’s criterion

Sylvester’s criterion determines whether a form is positively definite or negatively definite. Notice that it does not tell anything about the categories with semidefinite forms!

How does it work? We study determinants of minors: let A_k be the matrix of size k\times k in the left upper corner of the matrix of a form we study. Let n\times n be the size of the matrix of this form. Sylvester’s criterion consists of the two following facts:

  • if for any k\leq n we have \det A_k > 0, the form is positively definite,
  • if for any k\leq n we have \det A_k > 0 for even k, and \det A_k<0, for odd k, then the form is negatively definite.

E.g. let q(x,y)=2x^2+y^2-2xy, so its matrix: \left[\begin{array}{cc}2&-1\\-1&1\end{array}\right], so A_1=[2] and A_2=\left[\begin{array}{cc}2&-1\\-1&1\end{array}\right], therefore \det A_1=2>0 and \det A_2=2-1=1>0, so form q is positively definite.

E.g., let q(x,y)=-x^2-5y^2-4xy-z^2, so its matrix: \left[\begin{array}{ccc}-1&-2&0\\-2&-5&0\\0&0&-1\end{array}\right], so A_1=[-1] and A_2=\left[\begin{array}{cc}-1&-2\\-2&-5\end{array}\right], also A_3=\left[\begin{array}{ccc}-1&-2&0\\-2&1&0\\0&0&-1\end{array}\right], therefore \det A_1=-1<0 and \det A_2=5-4=1>0 and \det A_3=-5+4=-1<0, so form q is negatively definite.

Finally let q(x,y)=-2x^2+y^2-2xy, its matrix: \left[\begin{array}{cc}-2&-1\\-1&1\end{array}\right], so A_1=[-2] and A_2=\left[\begin{array}{cc}-2&-1\\-1&1\end{array}\right], therefore \det A_1=-2<0 and \det A_2=-2-1=-3<0, so form q is neither positively definite nor negatively definite.

Eigenvalues

Fine, but how to check everything. Also the other two categories. The answer is given by eigenvalues. Notice that if we find a basis of eigenvectors, everything will be clear in such a basis. Moreover, symmetric matrices are always diagonalizable.

Therefore if M is the matrix of q and matrix M:

  • has only positive eigenvalues, then q is positively definite,
  • has only negative eigenvalues, then q is negatively definite,
  • has only non-negative eigenvalues, then q is positively semidefinite,
  • has only non-positive eigenvalues, then q is negatively semidefinite,
  • has a positive and a negative eigenvalue q is indefinite.

E.g.: let q(x,y)=-2x^2+y^2-2xy, the matrix: \left[\begin{array}{cc}-2&-1\\-1&1\end{array}\right], so its characteristic polynomial: (-2-\lambda)(1-\lambda)+1=\lambda^2+\lambda-1 has zeroes in \frac{-1-\sqrt{5}}{2} and \frac{-1+\sqrt{5}}{2}, so it has eigenvalues of both signs, so is q is indefinite.