Skip to main content

Section 41.4 Examples

Subsection 41.4.1 Quadratic forms represented by matrices

Example 41.4.1. Determining the quadratic polynomial associated to a symmetric matrix.

The symmetric matrix

\begin{equation*} A = \left[\begin{array}{rrr} 1 \amp 2 \amp 0 \\ 2 \amp -7 \amp -5 \\ 0 \amp -5 \amp 3 \end{array}\right] \end{equation*}

creates a quadratic form

\begin{equation*} q_A(\uvec{x}) = \utrans{\uvec{x}} A \uvec{x} \text{.} \end{equation*}

We can use the correspondence between matrix entries and polynomial coefficients discussed in Subsection 41.3.1 to obtain

\begin{equation*} q(x_1,x_2,x_3) = x_1^2 + 4 x_1 x_2 - 7 x_2^2 - 10 x_2 x_3 + 3 x_3^2 \end{equation*}

without having to calculate out the matrix multiplication of \(\utrans{\uvec{x}} A \uvec{x} \text{.}\)

Example 41.4.2. Determining the symmetric matrix associated to a quadratic form.

The quadratic form

\begin{equation*} q(x_1,x_2,x_3) = 5 x_1^2 + 3 x_1 x_2 - 4 x_1 x_3 + 9 x_2^2 + 6 x_2 x_3 - 11 x_3^2 \end{equation*}

can be represented by matrix multiplication

\begin{equation*} q(\uvec{x}) = q_A(\uvec{x}) = \utrans{\uvec{x}} A \uvec{x} \end{equation*}

for a symmetric matrix \(A\text{.}\)

To do create the matrix \(A\text{,}\) each diagonal entry should be the coefficient on the corresponding squared term in the quadratic polynomial, and each off-diagonal entry should be one-half of the coefficient of the corresponding cross term in the quadratic polynomial:

\begin{equation*} A = \left[\begin{array}{rrr} 5 \amp \frac{3}{2} \amp -2 \\ \frac{3}{2} \amp 9 \amp 3 \\ -2 \amp 3 \amp -11 \end{array}\right] \text{.} \end{equation*}

Subsection 41.4.2 Level curves of two-variable quadratic forms

Example 41.4.3. An ellipse in the \(xy\)-plane.

Let's work through the example of Discovery 41.5. The symmetric matrix

\begin{equation*} A = \left[\begin{array}{rr} 13 \amp -5 \\ -5 \amp 13 \end{array}\right] \text{.} \end{equation*}

creates quadratic form

\begin{equation*} q_A(\uvec{x}) = 13 x^2 - 10 x y + 13 y^2 \text{,} \end{equation*}

using variables \(x,y\) instead of \(x_1,x_2\text{.}\) It's not clear from this polynomial expression what shape a level curve \(q_A(\uvec{x}) = k\) will take. But since \(A\) is symmetric, we can diagonalize it to remove the cross term in the polynomial for \(q_A\text{.}\)

The eigenvalues of \(A\) are \(\lambda_1 = 8\) and \(\lambda_2 = 18\text{.}\) Calculate bases for the eigenspaces. First \(\lambda_1 = 8\text{:}\)

\begin{gather*} 8 I - A = \left[\begin{array}{rr} -5 \amp 5 \\ 5 \amp -5 \end{array}\right] \quad \rowredarrow \quad = \left[\begin{array}{rr} 1 \amp -1 \\ 0 \amp 0 \end{array}\right]\\ \\ \implies E_8(A) = \Span\left\{ \begin{bmatrix} 1 \\ 1 \end{bmatrix} \right\}\text{.} \end{gather*}

Now \(\lambda_2 = 18\text{:}\)

\begin{gather*} 18 I - A = \left[\begin{array}{rr} 5 \amp 5 \\ 5 \amp 5 \end{array}\right] \quad \rowredarrow \quad = \left[\begin{array}{rr} 1 \amp 1 \\ 0 \amp 0 \end{array}\right]\\ \\ \implies E_{18}(A) = \Span\left\{ \left[\begin{array}{r} -1 \\ 1 \end{array}\right] \right\}\text{.} \end{gather*}

These two eigenvectors are orthogonal as expected (Statement 2 of Theorem 40.6.1), but they need to be normalized:

\begin{align*} E_8(A) \amp = \Span\left\{ \begin{bmatrix} \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{bmatrix} \right\} \text{,} \amp E_{18}(A) \amp = \Span\left\{ \left[\begin{array}{r} -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{array}\right] \right\}\text{.} \end{align*}

Use the normalized eigenvectors to create an orthogonal transition matrix

\begin{equation*} P = \left[\begin{array}{cr} \frac{1}{\sqrt{2}} \amp - \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \amp \frac{1}{\sqrt{2}} \end{array}\right] \end{equation*}

which diagonalizes \(A\text{:}\)

\begin{equation*} \utrans{P} A P = \begin{bmatrix} 8 \\ \amp 18 \end{bmatrix} \text{.} \end{equation*}

Using the change of variables

\begin{align*} \uvec{w} \amp = \begin{bmatrix} w \\ z \end{bmatrix}, \amp \uvec{x} \amp = P \uvec{w}\text{,} \end{align*}

the transformed quadratic form is

\begin{equation*} q_A(\uvec{x}) = q_{\inv{P} A P}(\uvec{w}) = 8 w^2 + 18 z^2 \text{.} \end{equation*}

A level curve \(q_{\inv{P} A P}(\uvec{w}) = k\) (\(k \gt 0\)) is clearly an ellipse. For example, the curve

\begin{equation*} 8 w^2 + 18 z^2 = 72 \end{equation*}

is an ellipse with \(w\)-intercepts at \(w = \pm 3\) and \(z\)-intercepts at \(z = \pm 2\text{.}\)

Ellipse representing level set of a diagonalized quadratic form, plotted on a set of principal axes

Just as the orthonormal basis formed by the standard vectors \(\uvec{e}_1\) and \(\uvec{e}_2\) represent the \(x\)- and \(y\)-axes respectively, the orthonormal basis formed by the columns of \(P\) represent the \(w\)- and \(z\)-axes, and give us a way to plot the ellipse \(q_A(\uvec{x}) = 72\) on the \(xy\)-axes.

Ellipse representing level set of a diagonalized quadratic form, plotted on standard axes but relative to a set of principal axes

Relative to how it appears on the \(wz\)-axes, the ellipse has clearly been rotated by \(\pi/4\) counter-clockwise. This is consistent with viewing \(P\) as a rotation matrix:

\begin{equation*} P = \left[\begin{array}{cr} \frac{1}{\sqrt{2}} \amp - \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \amp \frac{1}{\sqrt{2}} \end{array}\right] = \left[\begin{array}{cr} \cos \frac{\pi}{4} \amp - \sin \frac{\pi}{4} \\ \sin \frac{\pi}{4} \amp \cos \frac{\pi}{4} \end{array}\right]\text{.} \end{equation*}

Also notice how the fact that the columns of \(P\) are orthonormal allow use to use multiples of those vectors to determine distances and positions along each of the \(w\)- and \(z\)-axes.

As our change of variables was

\begin{align*} \uvec{x} \amp = P \uvec{w} \text{,} \amp \uvec{w} \amp = \inv{P} \uvec{x}\text{,} \end{align*}

points in \(wz\)-coordinates must be rotated by \(\pi/4\) to be converted into \(xy\)-coordinates.

Transition matrix \(P\) as a rotation between \(wz\)-coordinates and \(xy\)-coordinates
Example 41.4.4. A hyperbola in the \(xy\)-plane.

Consider the quadratic form

\begin{equation*} q(x,y) = 3 x^2 + 26 \sqrt{3} x y - 23 y^2 \text{.} \end{equation*}

This form corresponds to the symmetric matrix

\begin{equation*} A = \begin{bmatrix} 3 \amp 13 \sqrt{3} \\ 13 \sqrt{3} \amp -23 \end{bmatrix}\text{.} \end{equation*}

The eigenvalues of \(A\) are \(\lambda_1 = 16\) and \(\lambda_2 = -36\text{,}\) so even without computing the transition matrix we know that the decoupled quadratic form is

\begin{equation*} q(w,z) = 16 w^2 - 36 z^2 \text{,} \end{equation*}

so the level curves of \(q\) will be hyperbolas. For example, the hyperbola

\begin{equation*} 16 w^2 - 36 z^2 = 4 \end{equation*}

has \(w\)-intercepts \(w = \pm \frac{1}{2}\) and asymptotes \(z = \pm \frac{2}{3} w\text{.}\)

Hyperbola representing level set of a diagonalized quadratic form, plotted on a set of principal axes

But to determine how to plot this hyperbola on a set of \(xy\)-axes, we need the transition matrix, so calculate bases for the eigenspaces. First \(\lambda_1 = 16\text{:}\)

\begin{gather*} 16 I - A = \begin{bmatrix} 13 \amp - 13 \sqrt{3} \\ - 13 \sqrt{3} \amp 39 \end{bmatrix} \quad \rowredarrow \quad = \begin{bmatrix} 1 \amp -\sqrt{3} \\ 0 \amp 0 \end{bmatrix}\\ \\ \implies E_{16}(A) = \Span\left\{ \begin{bmatrix} \sqrt{3} \\ 1 \end{bmatrix} \right\}\text{.} \end{gather*}

Now \(\lambda_2 = 36\text{:}\)

\begin{gather*} (-36) I - A = \begin{bmatrix} -39 \amp -13 \sqrt{3} \\ -13 \sqrt{3} \amp -13 \end{bmatrix} \quad \rowredarrow \quad = \begin{bmatrix} \sqrt{3} \amp 1 \\ 0 \amp 0 \end{bmatrix}\\ \\ \implies E_{-36}(A) = \Span\left\{ \begin{bmatrix} 1 \\ -\sqrt{3} \end{bmatrix} \right\}\text{.} \end{gather*}

Again, these eigenvectors should be normalized in order to create orthogonal transition matrix

\begin{equation*} P = \begin{bmatrix} \frac{\sqrt{3}}{2} \amp \frac{1}{2} \\ \frac{1}{2} \amp - \frac{\sqrt{3}}{2} \end{bmatrix}\text{.} \end{equation*}

This transition matrix is of the form

\begin{equation*} P= \left[\begin{array}{cr} \cos \frac{\pi}{6} \amp \sin \frac{\pi}{6} \\ \sin \frac{\pi}{6} \amp - \cos \frac{\pi}{6} \end{array}\right]\text{,} \end{equation*}

which represents a rotation followed by a reflection.

Hyperbola representing level set of a diagonalized quadratic form, plotted on standard axes but relative to a set of principal axes

Notice how the \(wz\)-axes are rotated \(\pi/6\) counter-clockwise, but then the \(z\)-axis has been reflected to the other side of the \(w\)-axis. However, we could have chosen our eigenvectors so that \(P\) represented only a rotation, if we had used

\begin{equation*} E_{-36}(A) = \Span\left\{ \left[\begin{array}{r} -\frac{1}{2} \\ \frac{\sqrt{3}}{2} \end{array}\right] \right\} \end{equation*}

instead (see Theorem 41.5.2).

Remark 41.4.5.

Note that in both examples in this subsection, it was not actually necessary to compute the second eigenspace. Since we are working in two dimensions, and we know that symmetric matrices have orthogonal eigenspaces (Statement 2 of Theorem 40.6.1), once we had a basis vector for one eigenspace we could easily obtain a basis vector for the other eigenspace using our pattern of orthogonality in the plane from Discovery 14.2.c (also discussed in Subsection 14.3.2).