Tutorials › Linear Algebra › Ellipsoids From Positive Definite Forms

Quadratic Forms and Definiteness · Tutorial 774 of 1000

Ellipsoids From Positive Definite Forms

Learn how the eigenvectors and eigenvalues of a positive definite matrix determine the orientation and semiaxis lengths of its ellipsoidal level sets.

Advanced 10 min read

What You'll Learn

  • Rewrite a positive definite quadratic form in orthogonal eigenvector coordinates.
  • Determine when a level set is an ellipsoid, a single point, or empty.
  • Find principal directions and semiaxis lengths from eigenpairs.
  • Distinguish the ellipsoid surface from the solid it bounds.
  • Check axis endpoints directly in the original quadratic form.

From a Quadratic Form to an Ellipsoid

A positive definite quadratic form assigns a positive value to every nonzero vector. Its level sets therefore describe how far vectors lie from the origin, but generally not in the same way in every direction. The eigenvectors of the matrix identify the directions in which the form has a particularly simple expression; the corresponding eigenvalues determine how quickly the form grows along those directions. Together, they give the orientation and dimensions of the ellipsoids described by equations of the form \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\).

Throughout, \(\mathbf{x}\in\mathbb{R}^n\), and \(\mathbf{A}\in\mathbb{R}^{n\times n}\) is real and symmetric. The matrix is positive definite if \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}>0\) for every \(\mathbf{x}\ne\mathbf{0}\). The level set at \(c\in\mathbb{R}\) is the set of all \(\mathbf{x}\) satisfying \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\). We use the earlier result on orthogonal diagonalization of real symmetric matrices: there is an orthonormal basis of eigenvectors of \(\mathbf{A}\).

Definition: For \(c>0\), an ellipsoid centred at the origin is a set that can be written as \(\{\mathbf{x}:\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\}\) for a real symmetric positive definite matrix \(\mathbf{A}\). Its principal directions are the directions of an orthonormal eigenbasis of \(\mathbf{A}\). If \(\lambda_i\) is the eigenvalue for a unit eigenvector \(\mathbf{q}_i\), the semiaxis length in direction \(\mathbf{q}_i\) is the distance from the origin to the ellipsoid along that direction. The full axis length is twice the semiaxis length.

The Eigenvector Coordinates and the Axis Formula

Let \(\mathbf{q}_1,\ldots,\mathbf{q}_n\) be an orthonormal eigenbasis, with \(\mathbf{A}\mathbf{q}_i=\lambda_i\mathbf{q}_i\). Write \(\mathbf{Q}=[\mathbf{q}_1\ \cdots\ \mathbf{q}_n]\). Orthonormality means \(\mathbf{Q}^{\top}\mathbf{Q}=\mathbf{I}_n\), and orthogonal diagonalization gives \(\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q}=\operatorname{diag}(\lambda_1,\ldots,\lambda_n)\). For coordinates \(\mathbf{y}=\mathbf{Q}^{\top}\mathbf{x}\), we have \(\mathbf{x}=\mathbf{Q}\mathbf{y}\), so

$$ \mathbf{x}^{\top}\mathbf{A}\mathbf{x} =\mathbf{y}^{\top}\mathbf{Q}^{\top}\mathbf{A}\mathbf{Q}\mathbf{y} =\lambda_1y_1^2+\cdots+\lambda_ny_n^2. $$

Positive definiteness forces every \(\lambda_i\) to be positive: for a unit eigenvector \(\mathbf{q}_i\), \(\lambda_i=\mathbf{q}_i^{\top}\mathbf{A}\mathbf{q}_i>0\). Thus, when \(c>0\), dividing by \(c\) expresses the level set as a sum of squared coordinates equal to \(1\). This is the standard ellipsoid equation in orthonormal coordinates.

Theorem (Ellipsoid axes): Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\) be symmetric and positive definite, with orthonormal eigenvectors \(\mathbf{q}_1,\ldots,\mathbf{q}_n\) and corresponding eigenvalues \(\lambda_1,\ldots,\lambda_n\). If \(c>0\), then $$ \{\mathbf{x}:\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\} = \left\{\mathbf{x}=\sum_{i=1}^n y_i\mathbf{q}_i: \sum_{i=1}^n\frac{y_i^2}{c/\lambda_i}=1\right\}. $$ The principal directions are \(\mathbf{q}_i\), and the semiaxis lengths in those directions are \(\sqrt{c/\lambda_i}\). The corresponding full axis lengths are \(2\sqrt{c/\lambda_i}\).

Proof. Assume the stated hypotheses. Since the eigenvectors form an orthonormal basis, every \(\mathbf{x}\in\mathbb{R}^n\) has coordinates \(y_i=\mathbf{q}_i^{\top}\mathbf{x}\) and equals \(\sum_i y_i\mathbf{q}_i\). Orthogonal diagonalization gives \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=\sum_i\lambda_i y_i^2\). Because \(c>0\) and every \(\lambda_i>0\), the equation \(\sum_i\lambda_i y_i^2=c\) is equivalent, after dividing by \(c\), to \(\sum_i y_i^2/(c/\lambda_i)=1\). This proves the displayed description in both directions: each point of the level set satisfies the sum equation, and any coordinates satisfying the sum equation give a point of the level set. On the \(i\)th principal direction, all coordinates except \(y_i\) are zero, so the equation becomes \(\lambda_i y_i^2=c\). Its two solutions are \(y_i=\pm\sqrt{c/\lambda_i}\), giving the two axis endpoints and the stated semiaxis length. \(\square\)

The formula also explains how to compare the axes. For fixed \(c>0\), smaller eigenvalues give longer semiaxes, because \(c/\lambda_i\) is larger when \(\lambda_i\) is smaller. If an eigenvalue is repeated, its eigenspace gives the corresponding principal directions; an orthonormal basis within that eigenspace can be chosen in more than one way, but all those directions have the same semiaxis length.

Worked Axis Calculations

Worked Example: A Level Set with Coordinate Axes

Find the principal directions and semiaxis lengths for \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=4\), where \(\mathbf{A}=\begin{bmatrix}1&0\\0&4\end{bmatrix}\).

The coordinate vectors \(\mathbf{e}_1=(1,0)^{\top}\) and \(\mathbf{e}_2=(0,1)^{\top}\) are unit eigenvectors: \(\mathbf{A}\mathbf{e}_1=(1,0)^{\top}=1\mathbf{e}_1\) and \(\mathbf{A}\mathbf{e}_2=(0,4)^{\top}=4\mathbf{e}_2\). Thus the eigenvalues are \(1\) and \(4\). In coordinates, the equation is \(x_1^2+4x_2^2=4\), or \(x_1^2/4+x_2^2/1=1\). The semiaxis lengths are \(\sqrt{4/1}=2\) along \(\mathbf{e}_1\) and \(\sqrt{4/4}=1\) along \(\mathbf{e}_2\).

Check: The axis endpoints are \((\pm2,0)^{\top}\) and \((0,\pm1)^{\top}\). For either sign, \(\mathbf{A}(\pm2,0)^{\top}=(\pm2,0)^{\top}\), so \((\pm2,0)\mathbf{A}(\pm2,0)^{\top}=4\). Also, \(\mathbf{A}(0,\pm1)^{\top}=(0,\pm4)^{\top}\), so \((0,\pm1)\mathbf{A}(0,\pm1)^{\top}=4\). Both pairs lie on the claimed level set.

Worked Example: A Rotated Ellipse

Find the principal directions and semiaxis lengths of \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=6\) for \(\mathbf{A}=\begin{bmatrix}2&1\\1&2\end{bmatrix}\).

Take \(\mathbf{q}_1=\frac{1}{\sqrt{2}}(1,1)^{\top}\) and \(\mathbf{q}_2=\frac{1}{\sqrt{2}}(1,-1)^{\top}\). Each has squared norm \(\frac12+\frac12=1\), and their inner product is \(\frac12-\frac12=0\). Multiplication gives \(\mathbf{A}\mathbf{q}_1=\frac{1}{\sqrt{2}}(3,3)^{\top}=3\mathbf{q}_1\) and \(\mathbf{A}\mathbf{q}_2=\frac{1}{\sqrt{2}}(1,-1)^{\top}=\mathbf{q}_2\). The eigenvalues are \(3\) and \(1\). The semiaxis lengths are therefore \(\sqrt{6/3}=\sqrt{2}\) along \(\mathbf{q}_1\), and \(\sqrt{6/1}=\sqrt{6}\) along \(\mathbf{q}_2\).

For coordinates \(y_1,y_2\) in these directions, the equation becomes \(3y_1^2+y_2^2=6\), or \(y_1^2/2+y_2^2/6=1\). The rotated principal directions can also be read from the endpoints: \(\sqrt{2}\mathbf{q}_1=(1,1)^{\top}\) and \(\sqrt{6}\mathbf{q}_2=(\sqrt{3},-\sqrt{3})^{\top}\).

Check: For \(\mathbf{x}=(1,1)^{\top}\), \(\mathbf{A}\mathbf{x}=(3,3)^{\top}\), so \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=1\cdot3+1\cdot3=6\). For \(\mathbf{x}=(\sqrt{3},-\sqrt{3})^{\top}\), \(\mathbf{A}\mathbf{x}=(\sqrt{3},-\sqrt{3})^{\top}\), so \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=3+3=6\). The endpoints satisfy the original equation.

Worked Example: A Three-Dimensional Ellipsoid

Find the principal directions and semiaxis lengths of \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=36\), where \(\mathbf{A}=\begin{bmatrix}1&0&0\\0&4&0\\0&0&9\end{bmatrix}\).

The standard unit vectors are eigenvectors, since \(\mathbf{A}\mathbf{e}_1=\mathbf{e}_1\), \(\mathbf{A}\mathbf{e}_2=4\mathbf{e}_2\), and \(\mathbf{A}\mathbf{e}_3=9\mathbf{e}_3\). The eigenvalues are \(1,4,9\), so the semiaxis lengths are \(\sqrt{36/1}=6\), \(\sqrt{36/4}=3\), and \(\sqrt{36/9}=2\), in directions \(\mathbf{e}_1,\mathbf{e}_2,\mathbf{e}_3\), respectively. Equivalently, \(x_1^2/36+x_2^2/9+x_3^2/4=1\).

Check: The six axis endpoints are \(\pm6\mathbf{e}_1,\pm3\mathbf{e}_2,\pm2\mathbf{e}_3\). For the first pair, \(\mathbf{A}(6\mathbf{e}_1)=6\mathbf{e}_1\), giving \((6\mathbf{e}_1)^{\top}\mathbf{A}(6\mathbf{e}_1)=36\); changing the sign leaves the value \(36\). For the second pair, \(\mathbf{A}(3\mathbf{e}_2)=12\mathbf{e}_2\), giving \(36\), again unchanged by sign. For the third pair, \(\mathbf{A}(2\mathbf{e}_3)=18\mathbf{e}_3\), giving \(36\), also unchanged by sign.

What the Value of \(c\) Changes

The ellipsoid description requires \(c>0\). The other values have straightforward but different outcomes, and positive definiteness is essential to each conclusion.

Result: If \(\mathbf{A}\) is real symmetric and positive definite, then \(\{\mathbf{x}:\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\}\) is empty for \(c<0\), is \(\{\mathbf{0}\}\) for \(c=0\), and is an ellipsoid for \(c>0\).

Proof. If \(\mathbf{x}\ne\mathbf{0}\), positive definiteness gives \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}>0\), while at \(\mathbf{x}=\mathbf{0}\) the value is \(0\). Therefore no vector can have a negative value, proving emptiness for \(c<0\). When \(c=0\), the zero vector is a solution, and no nonzero vector can be a solution, so the level set is exactly \(\{\mathbf{0}\}\). When \(c>0\), the ellipsoid axes theorem applies and gives the ellipsoid description. \(\square\)

As \(c\) increases through positive values, every semiaxis length \(\sqrt{c/\lambda_i}\) scales by the same factor. For example, replacing \(c\) by \(4c\) doubles each semiaxis length without changing its principal direction. The level set itself is the ellipsoid’s surface; the solid it encloses is described by \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}\le c\). The same eigenvector coordinates show why: the inequality becomes \(\sum_i y_i^2/(c/\lambda_i)\le1\).

A Common Axis-Length Mistake

A common error is to report \(c/\lambda_i\) as the semiaxis length. That ratio is the square of the semiaxis length, because the standard equation uses squared coordinates. In the first worked example, the mistaken calculation would report a length \(4/1=4\) along \(\mathbf{e}_1\). But the proposed endpoint \((4,0)^{\top}\) gives \((4,0)\mathbf{A}(4,0)^{\top}=16\), not \(4\). The correction is to take the square root: the semiaxis length is \(\sqrt{4/1}=2\), and the endpoint \((2,0)^{\top}\) gives the required value \(4\).

It is also important not to confuse an eigenvalue with a length. A large eigenvalue means the quadratic form grows quickly along its eigenvector, so the ellipsoid must reach a smaller distance in that direction to stay at the same value \(c\). Thus the longest semiaxis corresponds to the smallest eigenvalue, and the shortest corresponds to the largest. This direction is the reverse of what a direct comparison of eigenvalue sizes might suggest.

Check Your Understanding

Use eigenvector coordinates to answer each question, and verify any proposed axis endpoint in the original quadratic form.

  1. For \(\mathbf{A}=\begin{bmatrix}2&0\\0&8\end{bmatrix}\) and \(c=8\), find the principal directions and semiaxis lengths.
  2. If a positive definite matrix has an eigenvalue \(5\) with unit eigenvector \(\mathbf{q}\), what is the distance from the origin to the level set \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=20\) along \(\mathbf{q}\)?
  3. Explain why a positive definite quadratic form has no level set at a negative value of \(c\).
  4. For the rotated ellipse example, which eigenvalue gives the longer semiaxis, and why?
  5. What is the difference between the ellipsoid surface \(\mathbf{x}^{\top}\mathbf{A}\mathbf{x}=c\) and the solid it bounds?

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