Skip to content
GATEiit

GATE DA · Linear Algebra

Quadratic forms

Quadratic forms x^T A x: writing the symmetric matrix, classifying definiteness by eigenvalues or principal minors, principal axes and the Rayleigh quotient; GATE asks to classify forms and find extreme values.

Before you start

Concept notes

1. Quadratic form and its symmetric matrix

A quadratic form in x=(x1,…,xn) is a homogeneous polynomial of degree 2: Q(x)=xTAx=∑i∑jaijxixj. Always take A symmetric. Any matrix B gives the same form as its symmetric part 12(B+BT), so the symmetric choice is unique.

Reading A from Q:

  • the coefficient of xi2 goes to aii;
  • the coefficient of the cross term xixj is split in half: aij=aji=12(coefficient).

Example: Q=2x12+5x22−6x1x2 has , because xTAx=2x12−3x1x2−3x2x1+5x22.

Quadratic forms appear in data science as variances wTΣw of a projected variable, squared errors ∥Ax−b∥2, and the second-order term 12hTHh of a Taylor expansion, where H is the Hessian. The rank of the form is the rank of A. A form in n variables has n square terms and (n2) cross terms, which matches the n(n+1)2 free entries of a symmetric matrix.

2. Definiteness and the eigenvalue test

Classify Q(x)=xTAx by its sign for x≠0, or equivalently by the eigenvalues of the symmetric matrix A:

Class Q(x) for x≠0 Eigenvalues of A
Positive definite (PD) >0 all >0
Positive semidefinite (PSD) ≥0 all ≥0, some may be 0
Negative definite (ND) <0 all <0
Negative semidefinite (NSD) ≤0 all ≤0
Indefinite takes both signs some >0 and some <0

Quick consequences:

  • PD means det⁡A>0 and every diagonal entry aii>0 (put x=ei). A single non-positive diagonal entry rules out PD.
  • PSD but not PD means det⁡A=0: some non-zero x gives Q=0.
  • A diagonal entry of each sign means indefinite.
  • ATA is always PSD, since xTATAx=∥Ax∥2≥0; it is PD exactly when A has independent columns. Covariance matrices are PSD for the same reason.
  • If A is PD then A−1 is PD (its eigenvalues are 1/λi) and A+B is PD for any PSD B.
Positive definite: level sets are ellipsesIndefinite: level sets are hyperbolas
Contours of a quadratic form in two variables

3. Sylvester's criterion (principal minors)

Eigenvalues of a 3×3 matrix are slow to find, so GATE usually expects the minor test. The leading principal minors D1,D2,…,Dn are the determinants of the top-left 1×1, 2×2, ..., n×n sub-matrices.

  • PD if and only if D1>0,D2>0,…,Dn>0.
  • ND if and only if the signs alternate starting negative: D1<0,D2>0,D3<0,… (that is, (−1)kDk>0).
  • If some Dk has the wrong sign (and none is zero) the form is indefinite; for example D2<0 always means indefinite.
  • Semidefinite needs all principal minors, not just the leading ones. has D1=D2=0 but is not PSD.

For a 2×2 form ax2+2bxy+cy2, with :

Condition Class
a>0, ac−b2>0 PD
a<0, ac−b2>0 ND
ac−b2<0 indefinite
ac−b2=0 semidefinite (check sign of a or c)

The same table is the second-derivative test for two-variable maxima and minima, with a=fxx, b=fxy, c=fyy.

4. Principal axes and the Rayleigh quotient

A real symmetric A has an orthonormal eigenvector basis: A=QΛQT. Substituting y=QTx (a rotation of axes) removes all cross terms: xTAx=yTΛy=λ1y12+λ2y22+⋯+λnyn2. This is the principal axes (canonical) form. The eigenvectors are the axes of the ellipse Q=c, and the semi-axis lengths are c/λi.

In the canonical form, the number of positive coefficients is the index p, the number of non-zero coefficients is the rank r. By Sylvester's law of inertia these counts do not depend on which change of variables you use.

Rayleigh quotient: for x≠0, λmin⁡≤xTAxxTx≤λmax⁡. So the maximum of Q on the unit sphere ∥x∥=1 is λmax⁡, reached at its unit eigenvector; the minimum is λmin⁡. This is exactly why the first principal component in PCA is the top eigenvector of the covariance matrix: it maximises the variance wTΣw over unit vectors w.

Formulas to remember

Matrix form
Q(x)=xTAx,A=AT, aij=12 (coefficient of xixj)
Two variables
Positive definite (Sylvester)Leading principal minors
D1>0, D2>0, …, Dn>0
Negative definite
(−1)kDk>0 for k=1,…,n
Principal axes form
xTAx=∑iλiyi2,y=QTx
Rayleigh quotient bounds
λmin⁡≤xTAxxTx≤λmax⁡

Common mistakes

  • Putting the full cross-term coefficient in aij; it must be halved so that aij+aji equals the coefficient.
  • Using only leading principal minors to test semidefiniteness; zeros among them prove nothing, so check all principal minors or the eigenvalues.
  • For negative definite, requiring all minors to be negative; the signs must alternate, starting with D1<0.
  • Classifying a non-symmetric matrix by its eigenvalues; first replace it by its symmetric part 12(A+AT).
  • Forgetting that a form can be zero at a non-zero point and still be PSD; that is exactly the PSD-but-not-PD case with det⁡A=0.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Matrix of a three-variable form and its class

numerical

Write the symmetric matrix of Q=x12+2x22+3x32+4x1x2−2x2x3 and decide its definiteness.

  1. Step 1: Place the square terms on the diagonal and halve the cross terms.

    Try it on paper first.

Example 2: Principal axes of a two-variable form

numerical

Reduce Q=2x2+2xy+2y2 to principal axes form and find the maximum of Q on the unit circle x2+y2=1.

  1. Step 1: Write the matrix.

    Try it on paper first.

Example 3: Find the range of a parameter for positive definiteness

numerical

For which k is Q=x2+ky2+z2+2xy+2yz positive definite?

  1. Step 1: Write the matrix.

    Try it on paper first.

Example 4: Why leading minors are not enough for semidefinite

conceptual

has D1=0 and D2=0. Is xTAx positive semidefinite?

  1. Step 1: Evaluate the form directly.

    Try it on paper first.

Previous year questions

2 official GATE DA questions on this topic, newest first.

Practise these 2 PYQs →

Topic test

10 questions: up to 2 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.