Skip to main content
Logo image

Discover Linear Algebra

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 = \begin{abmatrix}{rrr} 1 \amp 2 \amp 0 \\ 2 \amp -7 \amp -5 \\ 0 \amp -5 \amp 3 \end{abmatrix} \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 = \begin{abmatrix}{rrr} 5 \amp \frac{3}{2} \amp -2 \\ \frac{3}{2} \amp 9 \amp 3 \\ -2 \amp 3 \amp -11 \end{abmatrix} \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 = \begin{abmatrix}{rr} 13 \amp -5 \\ -5 \amp 13 \end{abmatrix} \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 = \begin{abmatrix}{rr} -5 \amp 5 \\ 5 \amp -5 \end{abmatrix} \quad \rowredarrow \quad = \begin{abmatrix}{rr} 1 \amp -1 \\ 0 \amp 0 \end{abmatrix}\\ \\ \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 = \begin{abmatrix}{rr} 5 \amp 5 \\ 5 \amp 5 \end{abmatrix} \quad \rowredarrow \quad = \begin{abmatrix}{rr} 1 \amp 1 \\ 0 \amp 0 \end{abmatrix}\\ \\ \implies E_{18}(A) = \Span\left\{ \begin{abmatrix}{r} -1 \\ 1 \end{abmatrix} \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\{ \begin{abmatrix}{r} -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \end{abmatrix} \right\}\text{.} \end{align*}
Use the normalized eigenvectors to create an orthogonal transition matrix
\begin{equation*} P = \begin{abmatrix}{cr} \frac{1}{\sqrt{2}} \amp - \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \amp \frac{1}{\sqrt{2}} \end{abmatrix} \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{.}\)
An ellipse representing a level set of a diagonalized quadratic form, plotted on a set of principal axes.
The ellipse \(8 w^2 + 18 z^2 = 72 \) is plotted on a set of \(wz\)-axes. This ellipse is centred at the origin with major axis along the horizontal \(w\)-axis and \(w\)-intercepts at \(w = \pm 3\text{,}\) and minor axis along the vertical \(z\)-axis and \(z\)-intercepts at \(z = \pm 2\text{.}\)
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.
An ellipse representing a level set of a diagonalized quadratic form, plotted on standard axes but relative to a set of principal axes.
The ellipse \(13 x^2 - 10 x y + 13 y^2 = 72 \) is plotted on a set of \(xy\)-axes. A set of slant, orthogonal axes are drawn, rotated forty-five degrees counterclockwise from the \(xy\)-axes, and labelled as the \(wz\)-axes. The ellipse is centred at the origin, with major axis along the slant \(w\)-axis and minor axis along the slant \(z\)-axis. Directed line segments of length \(1\text{,}\) with initial points at the origin, and labelled as vectors \(\uvec{p}_1\) and \(\uvec{p}_2\text{,}\) respectively, are drawn so that \(\uvec{p}_1\) lies along the positive \(w\)-axis and \(\uvec{p}_2\) lies along the positive \(z\)-axis. Directed line segments for scalar multiple vectors \(3 \uvec{p}_1\) and \(2 \uvec{p}_2\) are also drawn with initial points at the origin, so that \(3 \uvec{p}_1\) lies along the \(w\)-axis with its terminal point on the ellipse and \(2 \uvec{p}_2\) lies along the \(z\)-axis.
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 = \begin{abmatrix}{cr} \frac{1}{\sqrt{2}} \amp - \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} \amp \frac{1}{\sqrt{2}} \end{abmatrix} = \begin{abmatrix}{cr} \cos \frac{\pi}{4} \amp - \sin \frac{\pi}{4} \\ \sin \frac{\pi}{4} \amp \cos \frac{\pi}{4} \end{abmatrix}\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.
An ellipse is plotted twice, once on a set of principal axes, and again on a set of standard axes. The two diagrams are rotations of each other by forty-five degrees.
On the left, the ellipse \(8 w^2 + 18 z^2 = 72 \) is again plotted on a set of \(wz\)-axes, and superimposed are a set of slant, orthogonal axes, rotated forty-five degrees clockwise from the \(wz\)-axes and labelled as the \(xy\)-axes. On the right, the ellipse \(13 x^2 - 10 x y + 13 y^2 = 72 \) is again plotted on a set of \(xy\)-axes, and superimposed are a set of slant, orthogonal axes, rotated forty-five degrees counterclockwise from the \(xy\)-axes and labelled as the \(wz\)-axes. The two diagrams are rotations of each other, and between them curved arrows are drawn to represent the transformation of one diagram onto the other. The arrow pointing from the left diagram to the right is labelled \(P\text{,}\) and the arrow pointing from the right diagram to the left is labelled \(\inv{P}\text{.}\)

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{.}\)
A hyperbola representing a level set of a diagonalized quadratic form, plotted on a set of principal axes.
The hyperbola \(16 w^2 - 36 z^2 = 4 \) is plotted on a set of \(wz\)-axes. The hyperbola has vertices and major axis along the \(w\)-axis, and the hyperbola’s asymptotes \(z = \pm \frac{2}{3} w\) are drawn as dotted lines.
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} = \begin{abmatrix}{cr} \cos \frac{\pi}{6} \amp \sin \frac{\pi}{6} \\ \sin \frac{\pi}{6} \amp - \cos \frac{\pi}{6} \end{abmatrix}\text{,} \end{equation*}
which represents a rotation followed by a reflection.
A hyperbola representing a level set of a diagonalized quadratic form, plotted on standard axes but relative to a set of principal axes.
The hyperbola \(3 x^2 + 26 \sqrt{3} x y - 23 y^2 = 4\) is plotted on a set of \(xy\)-axes. A set of slant, orthogonal axes are superimposed and labelled as the \(wz\)-axes, rotated thirty degrees from the \(xy\)-axes but also reflected so that the \(z\)-axis points down into the fourth quadrant. Directed line segments of length \(1\text{,}\) with initial points at the origin, and labelled as vectors \(\uvec{p}_1\) and \(\uvec{p}_2\text{,}\) respectively, are drawn so that \(\uvec{p}_1\) lies along the positive \(w\)-axis and \(\uvec{p}_2\) lies along the positive \(z\)-axis. The hyperbola’s asymptotes \(z = \pm \frac{2}{3} w\) are drawn as dotted lines relative to the slant \(wz\)-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\{ \begin{abmatrix}{r} -\frac{1}{2} \\ \frac{\sqrt{3}}{2} \end{abmatrix} \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).