Tutorials › Linear Algebra › Quadratic Extrema Under Linear Constraints

Quadratic Forms and Definiteness · Tutorial 765 of 1000

Quadratic Extrema Under Linear Constraints

Represent the feasible subspace with an orthonormal basis, then use the eigenvalues and eigenvectors of the restricted quadratic form to find its extrema.

Advanced 11 min read

What You'll Learn

  • Express homogeneous linear constraints as a feasible subspace.
  • Build an orthonormal basis matrix for that subspace.
  • Form the restricted symmetric matrix using the basis matrix.
  • Find constrained extrema from the smallest and largest eigenvalues.
  • Recover and check the original-space extremizing vectors.
  • Recognize why a norm constraint is needed for finite extrema.

From Linear Constraints to a Smaller Optimization Problem

A quadratic form can have very different extrema depending on which vectors are allowed. If the vectors must satisfy homogeneous linear equations, they lie in a subspace. The key is to describe that subspace with an orthonormal basis, so that coordinates within it preserve lengths. In those coordinates, the original quadratic form becomes a smaller symmetric matrix, and its eigenvalues determine the constrained extrema.

Throughout, let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be symmetric, so \(\mathbf{A}^{\top}=\mathbf{A}\). Its quadratic form is \(q(\mathbf{x})=\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\). We consider vectors in a linear subspace \(S\subseteq\mathbb{R}^n\) subject to \(\|\mathbf{x}\|=1\). The unit-length condition matters: without it, scaling a feasible vector can make the quadratic form arbitrarily large or small whenever it takes a positive or negative value.

Suppose the feasible subspace has dimension \(k\geq 1\), and let \(\mathbf{Q}\in\mathbb{R}^{n\times k}\) have as its columns an orthonormal basis of \(S\). Thus \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_k\), and every \(\mathbf{x}\in S\) can be written uniquely as \(\mathbf{x}=\mathbf{Q}\mathbf{y}\) for \(\mathbf{y}\in\mathbb{R}^k\). Orthonormality gives \(\|\mathbf{Q}\mathbf{y}\|^2=\mathbf{y}^{\top}\mathbf{Q}^{\top}\mathbf{Q}\mathbf{y}=\|\mathbf{y}\|^2\). Substituting this coordinate representation into the quadratic form gives \(q(\mathbf{x})=\mathbf{y}^{\top}(\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q})\mathbf{y}\).

Definition: The restriction matrix of the quadratic form to \(S\), in the chosen orthonormal basis, is \(\mathbf{B}=\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q}\in\mathbb{R}^{k\times k}\). It is symmetric, since \(\mathbf{B}^{\top}=(\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q})^{\top}=\mathbf{Q}^{\top}\mathbf{A}^{\top}\mathbf{Q}=\mathbf{B}\).

When constraints are written as \(\mathbf{C}^{\top}\mathbf{x}=\mathbf{0}\), the feasible subspace is \(S=\operatorname{Nul}(\mathbf{C}^{\top})\). Find an orthonormal basis for this null space, place its vectors in the columns of \(\mathbf{Q}\), and then form \(\mathbf{B}\). The columns of \(\mathbf{Q}\) can be obtained by taking a basis of the subspace and applying the Gram-Schmidt process.

The Constrained Extrema Theorem

Theorem: Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be symmetric, let \(S\subseteq\mathbb{R}^n\) have finite dimension \(k\geq1\), and let \(\mathbf{Q}\) have orthonormal columns forming a basis of \(S\). Set \(\mathbf{B}=\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q}\). On the feasible set \(\{\mathbf{x}\in S:\|\mathbf{x}\|=1\}\), the minimum of \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) is the smallest eigenvalue of \(\mathbf{B}\), and the maximum is its largest eigenvalue. A feasible vector \(\mathbf{x}=\mathbf{Q}\mathbf{y}\) is a minimizer or maximizer exactly when \(\mathbf{y}\) is a unit eigenvector of \(\mathbf{B}\) for the corresponding smallest or largest eigenvalue.

Proof. Because \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_k\), the representation \(\mathbf{x}=\mathbf{Q}\mathbf{y}\) preserves length: \(\|\mathbf{x}\|=1\) exactly when \(\|\mathbf{y}\|=1\). Also, substitution gives \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\mathbf{y}^{\top}\mathbf{B}\mathbf{y}\), and \(\mathbf{B}\) is symmetric. By the Spectral Theorem, \(\mathbf{B}\) has an orthonormal eigenbasis \(\mathbf{u}_1,\ldots,\mathbf{u}_k\) with real eigenvalues \(\lambda_1,\ldots,\lambda_k\). Write any unit \(\mathbf{y}\) as \(\mathbf{y}=\sum_{i=1}^k c_i\mathbf{u}_i\). Orthonormality gives \(\sum_{i=1}^k c_i^2=1\), and the eigenvector equations give \(\mathbf{y}^{\top}\mathbf{B}\mathbf{y}=\sum_{i=1}^k\lambda_i c_i^2\). This is a weighted average of the eigenvalues, with nonnegative weights \(c_i^2\) summing to \(1\). Therefore it is at least \(\lambda_{\min}\) and at most \(\lambda_{\max}\). Taking \(\mathbf{y}\) to be a unit eigenvector for either extreme eigenvalue attains the corresponding bound. Equality at the minimum requires \(c_i=0\) whenever \(\lambda_i>\lambda_{\min}\), since each such term contributes a strictly positive amount to \(\sum_i(\lambda_i-\lambda_{\min})c_i^2\). Thus \(\mathbf{y}\) lies in the eigenspace for \(\lambda_{\min}\). The same argument applied to \(\lambda_{\max}-\mathbf{y}^{\top}\mathbf{B}\mathbf{y}=\sum_i(\lambda_{\max}-\lambda_i)c_i^2\) shows that equality at the maximum occurs exactly in the largest-eigenvalue eigenspace. Mapping back by \(\mathbf{x}=\mathbf{Q}\mathbf{y}\) proves the assertion about feasible optimizers. \(\square\)

This theorem applies even when an extreme eigenvalue is repeated: every unit vector in its eigenspace gives the same extreme value. The eigenvalues to use are those of \(\mathbf{B}\), not automatically those of \(\mathbf{A}\). Restriction to a subspace changes the matrix that represents the quadratic form in feasible coordinates.

Worked Reductions and Checks

Worked Example: The Constraint \(x_1=x_2\)

Find the minimum and maximum of \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) over unit vectors satisfying \(x_1=x_2\), where

$$ \mathbf{A}=\begin{bmatrix}2&0&1\\0&2&1\\1&1&2\end{bmatrix}. $$

The feasible plane has orthonormal basis \(\mathbf{q}_1=(1,1,0)^{\top}/\sqrt{2}\) and \(\mathbf{q}_2=(0,0,1)^{\top}\). Thus \(\mathbf{Q}=[\mathbf{q}_1\ \mathbf{q}_2]\), and the restriction matrix entries are \(\mathbf{q}_i^{\top}\mathbf{A}\mathbf{q}_j\). First, \(\mathbf{A}\mathbf{q}_1=(2,2,2)^{\top}/\sqrt{2}\), so \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_1=2\) and \(\mathbf{q}_2^{\top}\mathbf{A}\mathbf{q}_1=\sqrt{2}\). Also \(\mathbf{A}\mathbf{q}_2=(1,1,2)^{\top}\), giving \(\mathbf{q}_2^{\top}\mathbf{A}\mathbf{q}_2=2\) and \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_2=\sqrt{2}\). Therefore

$$ \mathbf{B}=\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q} =\begin{bmatrix}2&\sqrt{2}\\\sqrt{2}&2\end{bmatrix}. $$

The vectors \((1,1)^{\top}/\sqrt{2}\) and \((1,-1)^{\top}/\sqrt{2}\) are eigenvectors of \(\mathbf{B}\), with eigenvalues \(2+\sqrt{2}\) and \(2-\sqrt{2}\), respectively. Mapping them back gives the maximizing vector \(\mathbf{x}_{\max}=(1/2,1/2,1/\sqrt{2})^{\top}\) and the minimizing vector \(\mathbf{x}_{\min}=(1/2,1/2,-1/\sqrt{2})^{\top}\). Each satisfies \(x_1=x_2\), and each has squared norm \(1/4+1/4+1/2=1\).

Check: For the maximum vector, \(\mathbf{A}\mathbf{x}_{\max}=(1+1/\sqrt{2},1+1/\sqrt{2},1+\sqrt{2})^{\top}=(2+\sqrt{2})\mathbf{x}_{\max}\). For the minimum vector, \(\mathbf{A}\mathbf{x}_{\min}=(1-1/\sqrt{2},1-1/\sqrt{2},1-\sqrt{2})^{\top}=(2-\sqrt{2})\mathbf{x}_{\min}\). Consequently their quadratic-form values are \(2+\sqrt{2}\) and \(2-\sqrt{2}\), as found from the restriction matrix.

Worked Example: A Plane with a Sum Constraint

Find the extrema of \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\) for unit vectors satisfying \(x_1+x_2+x_3=0\), where \(\mathbf{A}=\operatorname{diag}(1,1,3)\).

An orthonormal basis of the plane is \(\mathbf{q}_1=(1,-1,0)^{\top}/\sqrt{2}\) and \(\mathbf{q}_2=(1,1,-2)^{\top}/\sqrt{6}\). Each has coordinate sum zero. Their squared lengths are \(2/2=1\) and \(6/6=1\), and their dot product is \((1-1+0)/\sqrt{12}=0\). Compute: \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_1=1\), \(\mathbf{q}_2^{\top}\mathbf{A}\mathbf{q}_2=(1+1+12)/6=7/3\), and \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_2=(1-1)/\sqrt{12}=0\). Thus the restriction matrix is

$$ \mathbf{B}=\begin{bmatrix}1&0\\0&7/3\end{bmatrix}. $$

The minimum is \(1\), attained at \(\mathbf{x}_{\min}=\mathbf{q}_1\), and the maximum is \(7/3\), attained at \(\mathbf{x}_{\max}=\mathbf{q}_2\). To check the values directly, \(\mathbf{A}\mathbf{q}_1=\mathbf{q}_1\), so \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_1=1\). Also \(\mathbf{q}_2^{\top}\mathbf{A}\mathbf{q}_2=(1+1+3\cdot4)/6=14/6=7/3\). The maximum is not the largest eigenvalue of the ambient matrix \(\mathbf{A}\), which is \(3\); its eigenvector \((0,0,1)^{\top}\) does not satisfy the constraint.

Worked Example: Two Independent Linear Constraints

Find the constrained minimum and maximum for unit vectors satisfying \(x_1+x_2=0\) and \(x_3+x_4=0\), with

$$ \mathbf{A}=\begin{bmatrix}5&0&2&0\\0&1&0&0\\2&0&2&0\\0&0&0&-2\end{bmatrix}. $$

Take \(\mathbf{q}_1=(1,-1,0,0)^{\top}/\sqrt{2}\) and \(\mathbf{q}_2=(0,0,1,-1)^{\top}/\sqrt{2}\). They satisfy both constraints, have unit length, and are orthogonal. The needed products are \(\mathbf{A}\mathbf{q}_1=(5,-1,2,0)^{\top}/\sqrt{2}\) and \(\mathbf{A}\mathbf{q}_2=(2,0,2,2)^{\top}/\sqrt{2}\). Taking dot products with the basis vectors gives \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_1=3\), \(\mathbf{q}_2^{\top}\mathbf{A}\mathbf{q}_2=0\), and \(\mathbf{q}_1^{\top}\mathbf{A}\mathbf{q}_2=1\). Hence

$$ \mathbf{B}=\begin{bmatrix}3&1\\1&0\end{bmatrix}. $$

The characteristic equation is \(\lambda^2-3\lambda-1=0\), so the eigenvalues are \(\lambda_{\pm}=(3\pm\sqrt{13})/2\). For either eigenvalue, \(\mathbf{y}_{\pm}=(1,\lambda_{\pm}-3)^{\top}/\sqrt{1+(\lambda_{\pm}-3)^2}\) is a unit eigenvector: the identity \(\lambda_{\pm}(\lambda_{\pm}-3)=1\) gives \(\mathbf{B}(1,\lambda_{\pm}-3)^{\top}=(\lambda_{\pm},1)^{\top}=\lambda_{\pm}(1,\lambda_{\pm}-3)^{\top}\). Thus the minimum and maximum are \(\lambda_-\) and \(\lambda_+\), attained at \(\mathbf{x}_{\pm}=\mathbf{Q}\mathbf{y}_{\pm}\), where \(\mathbf{Q}=[\mathbf{q}_1\ \mathbf{q}_2]\).

Check: Each \(\mathbf{x}_{\pm}\) is a combination of \(\mathbf{q}_1,\mathbf{q}_2\), so both constraint sums are zero. Orthonormality of the columns of \(\mathbf{Q}\) gives \(\|\mathbf{x}_{\pm}\|=\|\mathbf{y}_{\pm}\|=1\). Finally, \(\mathbf{x}_{\pm}^{\top}\mathbf{A}\mathbf{x}_{\pm}=\mathbf{y}_{\pm}^{\top}\mathbf{B}\mathbf{y}_{\pm}=\lambda_{\pm}\|\mathbf{y}_{\pm}\|^2=\lambda_{\pm}\).

Common Pitfalls and Practical Checks

Do not omit the unit-norm condition. For example, take \(\mathbf{A}=\begin{bmatrix}1&0\\0&-1\end{bmatrix}\) and the feasible subspace \(S=\mathbb{R}^2\). The vector \((t,0)^{\top}\) is feasible for every real \(t\), and its quadratic-form value is \(t^2\), which has no finite maximum as \(t\) grows. Likewise, \((0,t)^{\top}\) gives value \(-t^2\), with no finite minimum. A wrong claim that the unconstrained-in-length maximum is the largest eigenvalue \(1\) fails at \((2,0)^{\top}\), where the value is \(4\). Eigenvalue extrema apply here to the unit sphere in the feasible subspace.

Do not substitute ambient eigenvalues for restricted ones. In the sum-constraint example, the ambient maximum eigenvalue is \(3\), but its eigenvector is infeasible. The restriction matrix has eigenvalues \(1\) and \(7/3\), so the constrained maximum is \(7/3\). The required calculation is \(\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q}\), not merely a list of eigenvalues of \(\mathbf{A}\).

Check the basis before using it. Its columns must satisfy the constraints and be orthonormal. If they are not orthonormal, the coordinate vector need not have the same length as the original vector; the unit-vector optimization then requires an additional constraint in the new coordinates. Using an orthonormal basis makes the reduced problem exactly \(\|\mathbf{y}\|=1\).

The procedure is therefore: describe the feasible subspace, choose an orthonormal basis, compute the restriction matrix, and use its extreme eigenvalues. An eigenvector in the reduced coordinates must be mapped back by \(\mathbf{x}=\mathbf{Q}\mathbf{y}\), after which the constraints, unit norm, and quadratic-form value can all be checked directly. If the feasible subspace is \(\{\mathbf{0}\}\), it contains no unit vectors, so there is no feasible optimization problem of this form.

Check Your Understanding

For each problem, identify the feasible subspace before deciding which matrix should be diagonalized.

  1. What matrix represents the restriction of a symmetric quadratic form when \(\mathbf{Q}\) has orthonormal columns spanning the feasible subspace?
  2. Explain why the largest eigenvalue of the ambient matrix need not be the constrained maximum.
  3. For the constraint \(x_1+x_2=0\) in \(\mathbb{R}^2\), give a unit basis vector for the feasible subspace and state how the restricted matrix is formed.
  4. For a reduced matrix with largest eigenvalue of multiplicity two, describe all reduced-coordinate unit vectors that attain the maximum.
  5. Give a concrete reason that optimizing a quadratic form on a subspace without a unit-norm condition may have no finite maximum.

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon