Student[LinearAlgebra] Examples - Maple Help

Home : Support : Online Help : Applications and Example Worksheets : Algebra : Student[LinearAlgebra] Examples

Student[LinearAlgebra] Examples

Eigenvalues and Eigenvectors



 • Tools≻Load Package: Student Linear Algebra



Example 1: Diagonalize a Matrix



 Diagonalize $A=\left[\begin{array}{rr}-1& -12\\ 1& 6\end{array}\right]$ by finding and applying an appropriate transition matrix $P$.



Data entry

 • Control-drag the matrix. Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rr}-1& -12\\ 1& 6\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

Obtain the transition matrix $P$, whose columns are the eigenvectors of $A$

 • Write the name $A$. Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvectors
 • Context Panel: Select Element≻2
 • Context Panel: Assign to a Name≻$P$

$A$ = $\left[\begin{array}{cc}{-1}& {-12}\\ {1}& {6}\end{array}\right]$$\stackrel{\text{eigenvectors}}{\to }$$\left[\begin{array}{c}{3}\\ {2}\end{array}\right]{,}\left[\begin{array}{cc}{-3}& {-4}\\ {1}& {1}\end{array}\right]$$\stackrel{\text{select entry 2}}{\to }$$\left[\begin{array}{cc}{-3}& {-4}\\ {1}& {1}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${P}$

Diagonalize $A$ by applying $P$

 • Write the appropriate product of matrices.  Use dot (period) for matrix multiplication. Context Panel: Evaluate and Display Inline

${P}^{-1}.A.P$ = $\left[\begin{array}{cc}{3}& {0}\\ {0}& {2}\end{array}\right]$



Example 2: Singular Values of a Matrix



 Obtain the singular values of $A=\left[\begin{array}{rr}-1& -12\\ 1& 6\end{array}\right]$, and verify the results from first principles



Data entry

 • Control-drag the matrix. Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rr}-1& -12\\ 1& 6\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

Obtain the singular values

 • Write the name $A$. Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Singular Values

$A$ = $\left[\begin{array}{cc}{-1}& {-12}\\ {1}& {6}\end{array}\right]$$\stackrel{\text{singular values}}{\to }$$\left[\begin{array}{c}\frac{\sqrt{{194}}}{{2}}{+}\frac{\sqrt{{170}}}{{2}}\\ \frac{\sqrt{{194}}}{{2}}{-}\frac{\sqrt{{170}}}{{2}}\end{array}\right]$

From first principles

 • Enter the product of the transpose of $A$ with $A$. Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvalues
 • Context Panel: Assign to a Name≻V

${A}^{\mathrm{%T}}.A$ = $\left[\begin{array}{cc}{2}& {18}\\ {18}& {180}\end{array}\right]$$\stackrel{\text{eigenvalues}}{\to }$$\left[\begin{array}{c}{91}{+}\sqrt{{8245}}\\ {91}{-}\sqrt{{8245}}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${V}$

 • Expression palette: square-root operator Apply to each component of the vector V, whose components are the eigenvalues of ${A}^{\mathrm{T}}A$

$\sqrt{{\mathbf{V}}_{1}}$ = $\frac{\sqrt{{194}}}{{2}}{+}\frac{\sqrt{{170}}}{{2}}$

$\sqrt{{\mathbf{V}}_{2}}$ = $\frac{\sqrt{{194}}}{{2}}{-}\frac{\sqrt{{170}}}{{2}}$



Example 3: Jordan Form



 Obtain a transition matrix that puts  into Jordan form.



Maple can return the required transition matrix. The calculations below proceed from first principles.

 • Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rrr}5& -5& -4\\ -4& 8& 5\\ 7& -11& -7\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

 • Context Panel: Student Linear Algebra≻ Solvers and Forms≻Jordan Form

(Consequently, there is one chain of length 3 corresponding to the eigenvalue 2.)

$\left[\begin{array}{rrr}5& -5& -4\\ -4& 8& 5\\ 7& -11& -7\end{array}\right]$$\stackrel{\text{Jordan form}}{\to }$$\left[\begin{array}{ccc}{2}& {1}& {0}\\ {0}& {2}& {1}\\ {0}& {0}& {2}\end{array}\right]$

Obtain the null spaces of   and ${C}^{2}$

 • Context Panel: Assign to a Name≻$C$

(Note that Maple tolerates $A-2$ as a short form of , where $I$ is the identity matrix.)

$A-2$ = $\left[\begin{array}{ccc}{3}& {-5}& {-4}\\ {-4}& {6}& {5}\\ {7}& {-11}& {-9}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${C}$

 • Context Panel: Evaluate and Display Inline Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space

$C$ = $\left[\begin{array}{ccc}{3}& {-5}& {-4}\\ {-4}& {6}& {5}\\ {7}& {-11}& {-9}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}\frac{{1}}{{2}}\\ {-}\frac{{1}}{{2}}\\ {1}\end{array}\right]\right\}$

${C}^{2}$ = $\left[\begin{array}{ccc}{1}& {-1}& {-1}\\ {-1}& {1}& {1}\\ {2}& {-2}& {-2}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}{1}\\ {0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {1}\\ {0}\end{array}\right]\right\}$

Select a vector in ${\mathrm{ℝ}}^{3}$ that is not in the null space of ${C}^{2}$ and verify this choice

 • Context Panel: Assign to a Name≻b[3]

$⟨1,0,0⟩$$\stackrel{\text{assign to a name}}{\to }$${{b}}_{{3}}$

 • Context Panel: Student Linear Algebra≻ Standard Operations≻Determinant

(Non-vanishing of the determinant shows ${\mathbf{b}}_{3}$ is not a member of the null space of ${C}^{2}$)

$\left[\begin{array}{ccc}1& 1& 1\\ 0& 1& 0\\ 1& 0& 0\end{array}\right]$$\stackrel{\text{determinant}}{\to }$${-1}$

Construct the remaining members of the one chain of linearly independent generalized eigenvectors

 • Context Panel: Evaluate and Display Inline Context Panel: Assign to a Name≻b[2]

$C.{\mathbf{b}}_{3}$ = $\left[\begin{array}{c}{3}\\ {-4}\\ {7}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${{b}}_{{2}}$

 • Context Panel: Evaluate and Display Inline Context Panel: Assign to a Name≻b[1]

(Note that ${\mathbf{b}}_{1}$ is an eigenvector.)

$C.{\mathbf{b}}_{2}$ = $\left[\begin{array}{c}{1}\\ {-1}\\ {2}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${{b}}_{{1}}$

Construct the transition matrix whose columns are the vectors ${\mathbf{b}}_{1},{\mathbf{b}}_{2},{\mathbf{b}}_{3}$

 • Context Panel: Evaluate and Display inline
 • Context Panel: Select Elements≻Combine into Matrix
 • Context Panel: Assign to a Name≻$Q$

$\left[{\mathbf{b}}_{1},{\mathbf{b}}_{2},{\mathbf{b}}_{3}\right]$ = $\left[\left[\begin{array}{c}{1}\\ {-1}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-4}\\ {7}\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {0}\\ {0}\end{array}\right]\right]$$\stackrel{\text{combine into Matrix}}{\to }$$\left[\begin{array}{ccc}{1}& {3}& {1}\\ {-1}& {-4}& {0}\\ {2}& {7}& {0}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${Q}$

Verify that $Q$ puts $A$ into Jordan form

 • Context Panel: Evaluate and Display Inline

${Q}^{-1}.A.Q$ = $\left[\begin{array}{ccc}{2}& {1}& {0}\\ {0}& {2}& {1}\\ {0}& {0}& {2}\end{array}\right]$



Solution of Linear Systems



 • Tools≻Load Package: Student Linear Algebra



Example 1: Solve a Completely Determined Linear System



 Solve the completely determined system consisting of the equations



Simply solve the equations

 • Control-drag the equations. Context Panel: Solve≻Solve

$\stackrel{\text{solve}}{\to }$$\left\{{x}{=}\frac{{29}}{{15}}{,}{y}{=}{-}\frac{{4}}{{5}}{,}{z}{=}{-}\frac{{2}}{{15}}\right\}$

Convert to a linear system

 • Control-drag the equations.
 • Context Panel: Student Linear Algebra≻ Constructions≻Generate Matrix≻Augmented (Complete dialog as per Figure 1.)
 • Context Panel: Student Linear Algebra≻ Solvers and Forms≻Linear Solve

 Figure 1

$\stackrel{\text{to Matrix form}}{\to }$$\left[\begin{array}{cccc}{1}& {1}& {1}& {1}\\ {1}& {-1}& {-2}& {3}\\ {5}& {2}& {-7}& {9}\end{array}\right]$$\stackrel{\text{linear solve}}{\to }$$\left[\begin{array}{c}\frac{{29}}{{15}}\\ {-}\frac{{4}}{{5}}\\ {-}\frac{{2}}{{15}}\end{array}\right]$



Example 2: Least-Squares Solution of an Overdetermined System



 Obtain a least-squares solution to the overdetermined system consisting of the equations



 • Control-drag the equations and press the Enter key.
 • Context Panel: Student Linear Algebra≻Constructions≻Generate Matrix≻Matrix-Vector pair (Complete dialog as per Figure 1, in Example 1.)
 • Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares

${x}{+}{y}{+}{z}{=}{1}{,}{x}{-}{y}{-}{2}{z}{=}{3}{,}{5}{x}{+}{2}{y}{-}{7}{z}{=}{9}{,}{3}{x}{-}{7}{y}{+}{9}{z}{=}{-4}$

$\stackrel{\text{to Matrix form}}{\to }$

$\left[\begin{array}{ccc}{1}& {1}& {1}\\ {1}& {-1}& {-2}\\ {5}& {2}& {-7}\\ {3}& {-7}& {9}\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {3}\\ {9}\\ {-4}\end{array}\right]$

$\stackrel{\text{least squares}}{\to }$

$\left[\begin{array}{c}\frac{{10207}}{{11574}}\\ \frac{{93}}{{1286}}\\ {-}\frac{{7777}}{{11574}}\end{array}\right]$



Example 3: Minimum-Norm Least-Squares



 Obtain the minimum-norm least-squares solution of the system $\left[\begin{array}{rrrr}7& 0& 5& -10\\ 1& -5& 1& 9\\ 10& -8& 11& -1\\ 4& -6& 9& 1\end{array}\right]\mathbf{x}=\left[\begin{array}{r}1\\ 2\\ 3\\ 4\end{array}\right]$.



Obtain the minimum-norm least-squares solution

 • Control-drag the system, editing it to a sequence of matrix and vector.
 • Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares Check the "Optimized" box in the "Specify options for Least Squares" dialog

$\left[\begin{array}{rrrr}7& 0& 5& -10\\ 1& -5& 1& 9\\ 10& -8& 11& -1\\ 4& -6& 9& 1\end{array}\right]\mathbf{,}\left[\begin{array}{r}1\\ 2\\ 3\\ 4\end{array}\right]$$\stackrel{\text{least squares}}{\to }$$\left[\begin{array}{c}{-}\frac{{10341}}{{75110}}\\ {-}\frac{{5434}}{{37555}}\\ \frac{{26981}}{{75110}}\\ \frac{{1847}}{{37555}}\end{array}\right]$



Work from first principles: obtain the general solution and minimize its norm:



Obtain the general solution

 • Control-drag the system, editing it to a sequence of matrix and vector.
 • Context Panel: Student Linear Algebra≻Solvers and Forms≻Least Squares Free-Variable Name≻$s$
 • Context Panel: Evaluate at a Point≻$s$
 • Context Panel: Assign to a Name≻X

$\left[\begin{array}{rrrr}7& 0& 5& -10\\ 1& -5& 1& 9\\ 10& -8& 11& -1\\ 4& -6& 9& 1\end{array}\right]\mathbf{,}\left[\begin{array}{r}1\\ 2\\ 3\\ 4\end{array}\right]$$\stackrel{\text{least squares}}{\to }$$\left[\begin{array}{c}{{s}}_{{1}}\\ {3}{{s}}_{{1}}{+}\frac{{139}}{{518}}\\ \frac{{7}{{s}}_{{1}}}{{5}}{+}\frac{{3574}}{{6475}}\\ \frac{{7}{{s}}_{{1}}}{{5}}{+}\frac{{3133}}{{12950}}\end{array}\right]$$\stackrel{\text{evaluate at point}}{\to }$$\left[\begin{array}{c}{s}\\ {3}{s}{+}\frac{{139}}{{518}}\\ \frac{{7}{s}}{{5}}{+}\frac{{3574}}{{6475}}\\ \frac{{7}{s}}{{5}}{+}\frac{{3133}}{{12950}}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${X}$

Obtain the norm and minimize it

 • Write the name X and press the Enter key.
 • Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
 • Context Panel: Differentiate≻With Respect To≻$s$
 • Context Panel: Conversions≻Equate to 0 (This step is optional.)
 • Context Panel: Solve≻Solve
 • Context Panel: Assign to a Name≻$S$

$\mathbf{X}$

$\left[\begin{array}{c}{s}\\ {3}{s}{+}\frac{{139}}{{518}}\\ \frac{{7}{s}}{{5}}{+}\frac{{3574}}{{6475}}\\ \frac{{7}{s}}{{5}}{+}\frac{{3133}}{{12950}}\end{array}\right]$

$\stackrel{\text{Euclidean-norm}}{\to }$

$\frac{\sqrt{{2334418800}{{s}}^{{2}}{+}{642796560}{s}{+}{72985218}}}{{12950}}$

$\stackrel{\text{differentiate w.r.t. s}}{\to }$

$\frac{{4668837600}{s}{+}{642796560}}{{25900}\sqrt{{2334418800}{{s}}^{{2}}{+}{642796560}{s}{+}{72985218}}}$

$\stackrel{\text{equate to 0}}{\to }$

$\frac{{4668837600}{s}{+}{642796560}}{{25900}\sqrt{{2334418800}{{s}}^{{2}}{+}{642796560}{s}{+}{72985218}}}{=}{0}$

$\stackrel{\text{solve}}{\to }$

$\left\{{s}{=}{-}\frac{{10341}}{{75110}}\right\}$

$\stackrel{\text{assign to a name}}{\to }$

${S}$

 • Expression palette: Evaluation template Evaluate X at the solution in S

 • Context Panel: Evaluate and Display Inline

$\genfrac{}{}{0}{}{X}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{S}$ = $\left[\begin{array}{c}{-}\frac{{10341}}{{75110}}\\ {-}\frac{{5434}}{{37555}}\\ \frac{{26981}}{{75110}}\\ \frac{{1847}}{{37555}}\end{array}\right]$



Example 4: Stepwise Row Reduction and Back-Substitution



 If the linear system $A\mathbf{x}=\mathbf{y}$ is expressed by the augmented matrix $\left[\begin{array}{rrrr}5& -6& -2& 3\\ -4& 3& -3& -1\\ 1& 1& 0& 2\end{array}\right]$, row-reduce to upper triangular form and solve for x.



 • Control-drag the matrix. Context Panel: Student Linear Algebra≻ Standard Operations≻Row-Reduced Form

 • Context Panel: Select Elements≻Restrict Columns (Complete dialog as per Figure 2. The return is then a vector and not a one-column matrix.)

 Figure 2

$\left[\begin{array}{rrrr}5& -6& -2& 3\\ -4& 3& -3& -1\\ 1& 1& 0& 2\end{array}\right]$$\stackrel{\text{row-reduced form}}{\to }$$\left[\begin{array}{cccc}{1}& {0}& {0}& \frac{{59}}{{47}}\\ {0}& {1}& {0}& \frac{{35}}{{47}}\\ {0}& {0}& {1}& {-}\frac{{28}}{{47}}\end{array}\right]$$\stackrel{\text{restrict columns}}{\to }$$\left[\begin{array}{c}\frac{{59}}{{47}}\\ \frac{{35}}{{47}}\\ {-}\frac{{28}}{{47}}\end{array}\right]$



Stepwise row reduction can be done via the Context Panel system, as per Figure 3.

  Figure 3   Elementary row operations via the Context Panel system



The elementary row operations are also available in two tutors that can be accessed from the Context Panel (Student Linear Algebra > Tutors) . These are the Gaussian Elimination and Gauss-Jordan Elimination tutors..



Matrix Factorizations



 • Tools≻Load Package: Student Linear Algebra



Example 1: LU Decomposition



 Obtain the LU decomposition of the matrix $\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$.



 • Control-drag the given matrix. Context Panel: Student Linear Algebra≻Solvers and Forms≻LU Decomposition

$\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$$\stackrel{\text{LU decomposition}}{\to }$$\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]{,}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {-2}& {1}& {0}\\ {5}& {-2}& {1}\end{array}\right]{,}\left[\begin{array}{ccc}{1}& {6}& {5}\\ {0}& {14}& {14}\\ {0}& {0}& {-3}\end{array}\right]$



The returned matrices are $P,L,U$, with $P$ being the matrix that tracks permutations of the rows; $L$ being the unit lower triangular factor; and $U$ being the upper triangular factor. By default, Maple returns the Doolittle, not the Crout, factorization.

Example 2: QR Decomposition



 Obtain the QR decomposition of the matrix $\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$.



 • Control-drag the given matrix. Context Panel: Student Linear Algebra≻Solvers and Forms≻QR Decomposition

$\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$$\stackrel{\text{QR decomposition}}{\to }$$\left[\begin{array}{ccc}\frac{\sqrt{{30}}}{{30}}& \frac{{2}\sqrt{{5}}}{{5}}& \frac{\sqrt{{6}}}{{6}}\\ {-}\frac{\sqrt{{30}}}{{15}}& \frac{\sqrt{{5}}}{{5}}& {-}\frac{\sqrt{{6}}}{{3}}\\ \frac{\sqrt{{30}}}{{6}}& {0}& {-}\frac{\sqrt{{6}}}{{6}}\end{array}\right]{,}\left[\begin{array}{ccc}\sqrt{{30}}& \frac{{2}\sqrt{{30}}}{{5}}& {-}\frac{{11}\sqrt{{30}}}{{10}}\\ {0}& \frac{{14}\sqrt{{5}}}{{5}}& \frac{{14}\sqrt{{5}}}{{5}}\\ {0}& {0}& \frac{\sqrt{{6}}}{{2}}\end{array}\right]$



Example 3: Singular-Value Decomposition



 Obtain the singular-value decomposition of the matrix $\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$.



 • Control-drag the given matrix. Context Panel: Student Linear Algebra≻Solvers and Forms≻Singular Value Decomposition≻Singular Value Decomposition (U,S,Vt)

$\left[\begin{array}{rrr}1& 6& 5\\ -2& 2& 4\\ 5& 2& -6\end{array}\right]$$\stackrel{\text{singular value decomposition (U,S,Vt)}}{\to }$$\left[\begin{array}{ccc}{0.5988918686}& {-0.7180631732}& {-0.3545614298}\\ {0.4864104839}& {-0.02555662302}& {0.8733565706}\\ {-0.6361865833}& {-0.6955085456}& {0.3339678021}\end{array}\right]{,}\left[\begin{array}{c}{10.00874977}\\ {7.104651034}\\ {0.5906452392}\end{array}\right]{,}\left[\begin{array}{ccc}{-0.3551754316}& {0.3290919543}& {0.8749565122}\\ {-0.5833492223}& {-0.8094006799}& {0.06763300640}\\ {-0.7304478746}& {0.4863836187}& {-0.4794547714}\end{array}\right]$



The return consists of the factor $U$, the vector of singular values, and the transpose of the factor $V$. If $S$ is a diagonal matrix whose diagonal elements are the singular values, then .

Queries



 • Tools≻Load Package: Student Linear Algebra



Example 1: Positive Definite Matrix



 Is the symmetric matrix $\left[\begin{array}{rrr}7& 4& 1\\ 4& 5& 3\\ 1& 3& 6\end{array}\right]$ positive definite?



 • Control-drag the given matrix. Context Panel: Student Linear Algebra≻Queries≻ Is Definite?≻Positive Definite?

$\left[\begin{array}{rrr}7& 4& 1\\ 4& 5& 3\\ 1& 3& 6\end{array}\right]$$\stackrel{\text{is positive definite?}}{\to }$${\mathrm{true}}$



Typically, definiteness is assigned to bilinear forms ${\mathbf{x}}^{\mathrm{T}}A\mathbf{x}$ derived from the symmetric matrix $A$. If $A$ is not symmetric, the associated bilinear form can be represented by ${\mathbf{x}}^{\mathrm{T}}B\mathbf{x}$, where $B=\left(A+{A}^{\mathrm{T}}\right)/2$, the "symmetric part of $A$" is symmetric. Hence, Maple assigns definiteness to the symmetric part of a nonsymmetric matrix on the grounds that the matrix represents a bilinear form.



Example 2: Similar Matrices



 Show that the matrices $A=\left[\begin{array}{rrr}-5& -2& -2\\ 3& 4& -1\\ 4& -2& -8\end{array}\right]$ and $B=\left[\begin{array}{rrr}-15& -1530& -2334\\ 11& 1433& 2191\\ -5& -931& -1427\end{array}\right]$ are similar by finding a  matrix $C$ for which .



 • Write the sequence of matrices A and B Context Panel: Student Linear Algebra≻Queries≻Similar?
 • Context Panel: Select Element≻2
 • Context Panel: Assign to a Name≻C

$\left[\begin{array}{rrr}-5& -2& -2\\ 3& 4& -1\\ 4& -2& -8\end{array}\right],\left[\begin{array}{rrr}-15& -1530& -2334\\ 11& 1433& 2191\\ -5& -931& -1427\end{array}\right]$$\stackrel{\text{is similar?}}{\to }$${\mathrm{true}}{,}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {-}\frac{{486581}}{{522111}}& \frac{{533}}{{522111}}& {-}\frac{{1071}}{{348074}}\\ \frac{{316730}}{{522111}}& \frac{{98}}{{522111}}& \frac{{3001}}{{1044222}}\end{array}\right]$$\stackrel{\text{select entry 2}}{\to }$$\left[\begin{array}{ccc}{1}& {0}& {0}\\ {-}\frac{{486581}}{{522111}}& \frac{{533}}{{522111}}& {-}\frac{{1071}}{{348074}}\\ \frac{{316730}}{{522111}}& \frac{{98}}{{522111}}& \frac{{3001}}{{1044222}}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${C}$



Data entry

 • Control-drag each matrix. Context Panel: Assign to a Name≻$A$ (or $B$, as appropriate)

$\left[\begin{array}{rrr}-5& -2& -2\\ 3& 4& -1\\ 4& -2& -8\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

$\left[\begin{array}{rrr}-15& -1530& -2334\\ 11& 1433& 2191\\ -5& -931& -1427\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${B}$

Test for similarity and find $C$

 • Write a sequence of the names $A$ and $B$, then press the Enter key.
 • Context Panel: Student Linear Algebra≻Queries≻Is Similar?
 • Context Panel: Select Element≻2
 • Context Panel: Assign to a Name≻$C$

$A,B$

$\left[\begin{array}{ccc}{-5}& {-2}& {-2}\\ {3}& {4}& {-1}\\ {4}& {-2}& {-8}\end{array}\right]{,}\left[\begin{array}{ccc}{-15}& {-1530}& {-2334}\\ {11}& {1433}& {2191}\\ {-5}& {-931}& {-1427}\end{array}\right]$

$\stackrel{\text{is similar?}}{\to }$

${\mathrm{true}}{,}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {-}\frac{{486581}}{{522111}}& \frac{{533}}{{522111}}& {-}\frac{{1071}}{{348074}}\\ \frac{{316730}}{{522111}}& \frac{{98}}{{522111}}& \frac{{3001}}{{1044222}}\end{array}\right]$

$\stackrel{\text{select entry 2}}{\to }$

$\left[\begin{array}{ccc}{1}& {0}& {0}\\ {-}\frac{{486581}}{{522111}}& \frac{{533}}{{522111}}& {-}\frac{{1071}}{{348074}}\\ \frac{{316730}}{{522111}}& \frac{{98}}{{522111}}& \frac{{3001}}{{1044222}}\end{array}\right]$

$\stackrel{\text{assign to a name}}{\to }$

${C}$

Verify similarity

 • Context Panel: Evaluate and Display Inline

$C.A$ = $\left[\begin{array}{ccc}{-5}& {-2}& {-2}\\ \frac{{2428078}}{{522111}}& \frac{{326169}}{{174037}}& \frac{{985481}}{{522111}}\\ {-}\frac{{1577354}}{{522111}}& {-}\frac{{212023}}{{174037}}& {-}\frac{{645562}}{{522111}}\end{array}\right]$

$B.C$ = $\left[\begin{array}{ccc}{-5}& {-2}& {-2}\\ \frac{{2428078}}{{522111}}& \frac{{326169}}{{174037}}& \frac{{985481}}{{522111}}\\ {-}\frac{{1577354}}{{522111}}& {-}\frac{{212023}}{{174037}}& {-}\frac{{645562}}{{522111}}\end{array}\right]$



Example 3: Orthogonal Matrix



 Construct a (nontrivial) 3×3 orthogonal matrix.



 • Enter a list of three linearly independent vectors and press the Enter key.
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Gram-Schmidt≻normalized
 • Context Panel: Select Elements≻Combine into Matrix
 • Context Panel: Assign to a Name≻$Q$

$\left[⟨-4,1,6⟩,⟨5,3,1⟩,⟨7,-8,9⟩\right]$

$\left[\left[\begin{array}{c}{-4}\\ {1}\\ {6}\end{array}\right]{,}\left[\begin{array}{c}{5}\\ {3}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{7}\\ {-8}\\ {9}\end{array}\right]\right]$

$\stackrel{\text{Gram-Schmidt (normalized)}}{\to }$

$\left[\left[\begin{array}{c}{-}\frac{{4}\sqrt{{53}}}{{53}}\\ \frac{\sqrt{{53}}}{{53}}\\ \frac{{6}\sqrt{{53}}}{{53}}\end{array}\right]{,}\left[\begin{array}{c}\frac{{13}\sqrt{{318}}}{{318}}\\ \frac{{5}\sqrt{{318}}}{{159}}\\ \frac{{7}\sqrt{{318}}}{{318}}\end{array}\right]{,}\left[\begin{array}{c}\frac{\sqrt{{6}}}{{6}}\\ {-}\frac{\sqrt{{6}}}{{3}}\\ \frac{\sqrt{{6}}}{{6}}\end{array}\right]\right]$

$\stackrel{\text{combine into Matrix}}{\to }$

$\left[\begin{array}{ccc}{-}\frac{{4}\sqrt{{53}}}{{53}}& \frac{{13}\sqrt{{318}}}{{318}}& \frac{\sqrt{{6}}}{{6}}\\ \frac{\sqrt{{53}}}{{53}}& \frac{{5}\sqrt{{318}}}{{159}}& {-}\frac{\sqrt{{6}}}{{3}}\\ \frac{{6}\sqrt{{53}}}{{53}}& \frac{{7}\sqrt{{318}}}{{318}}& \frac{\sqrt{{6}}}{{6}}\end{array}\right]$

$\stackrel{\text{assign to a name}}{\to }$

${Q}$

Verify that $Q$ is an orthogonal matrix

 • Write the name $Q$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Queries≻Orthogonal?

$Q$ = $\left[\begin{array}{ccc}{-}\frac{{4}\sqrt{{53}}}{{53}}& \frac{{13}\sqrt{{318}}}{{318}}& \frac{\sqrt{{6}}}{{6}}\\ \frac{\sqrt{{53}}}{{53}}& \frac{{5}\sqrt{{318}}}{{159}}& {-}\frac{\sqrt{{6}}}{{3}}\\ \frac{{6}\sqrt{{53}}}{{53}}& \frac{{7}\sqrt{{318}}}{{318}}& \frac{\sqrt{{6}}}{{6}}\end{array}\right]$$\stackrel{\text{is orthogonal?}}{\to }$${\mathrm{true}}$



An alternative verification consists in showing that ${Q}^{\mathrm{T}}Q={\mathrm{QQ}}^{\mathrm{T}}=I$, thereby confirming that the rows (and columns) of $Q$ are sets of orthonormal vectors.

 ${Q}^{\mathrm{%T}}.Q$ = $\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$ $Q.{Q}^{\mathrm{%T}}$ = $\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$



Vector Spaces



 • Tools≻Load Package: Student Linear Algebra



Example 1: Four Fundamental Subspaces of a 5×3



 Find the row space, column space, null space, and null space of the transpose for the matrix    $\left[\begin{array}{rrr}32& -8& -4\\ -40& 10& 5\\ -32& 8& 4\\ 8& -2& -1\\ 72& -18& -9\end{array}\right]$    (Gilbert Strang of MIT calls these the four fundamental subspaces of $A$.)



The 5×3 matrix $A$ maps ${\mathrm{ℝ}}^{3}$ to ${\mathrm{ℝ}}^{5}$. Maple provides bases for each of the four fundamental subspaces.



The row and null spaces of $A$ are orthogonal subspaces of ${\mathrm{ℝ}}^{3}$; the column space of $A$ and the null space of ${A}^{\mathrm{T}}$ are orthogonal subspaces in ${\mathrm{ℝ}}^{5}$. Figure 4 illustrates the relationships between these four subspaces.

  Figure 4   The four fundamental subspaces of $A$



Data entry

 • Control-drag (or copy/paste) the given matrix. Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rrr}32& -8& -4\\ -40& 10& 5\\ -32& 8& 4\\ 8& -2& -1\\ 72& -18& -9\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

Row space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Row Space

$A$ = $\left[\begin{array}{ccc}{32}& {-8}& {-4}\\ {-40}& {10}& {5}\\ {-32}& {8}& {4}\\ {8}& {-2}& {-1}\\ {72}& {-18}& {-9}\end{array}\right]$$\stackrel{\text{row space}}{\to }$$\left[\left[\begin{array}{ccc}{1}& {-}\frac{{1}}{{4}}& {-}\frac{{1}}{{8}}\end{array}\right]\right]$

Column space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Column Space

$A$ = $\left[\begin{array}{ccc}{32}& {-8}& {-4}\\ {-40}& {10}& {5}\\ {-32}& {8}& {4}\\ {8}& {-2}& {-1}\\ {72}& {-18}& {-9}\end{array}\right]$$\stackrel{\text{column space}}{\to }$$\left[\left[\begin{array}{c}{1}\\ {-}\frac{{5}}{{4}}\\ {-1}\\ \frac{{1}}{{4}}\\ \frac{{9}}{{4}}\end{array}\right]\right]$

Null space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space

$A$ = $\left[\begin{array}{ccc}{32}& {-8}& {-4}\\ {-40}& {10}& {5}\\ {-32}& {8}& {4}\\ {8}& {-2}& {-1}\\ {72}& {-18}& {-9}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}\frac{{1}}{{8}}\\ {0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}\frac{{1}}{{4}}\\ {1}\\ {0}\end{array}\right]\right\}$

Null space of ${A}^{\mathrm{T}}$

 • Write the notation for the transpose of $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space

${A}^{\mathrm{%T}}$ = $\left[\begin{array}{ccccc}{32}& {-40}& {-32}& {8}& {72}\\ {-8}& {10}& {8}& {-2}& {-18}\\ {-4}& {5}& {4}& {-1}& {-9}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}{-}\frac{{9}}{{4}}\\ {0}\\ {0}\\ {0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-}\frac{{1}}{{4}}\\ {0}\\ {0}\\ {1}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {0}\\ {1}\\ {0}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}\frac{{5}}{{4}}\\ {1}\\ {0}\\ {0}\\ {0}\end{array}\right]\right\}$



Example 2: Four Fundamental Subspaces of a 4×5



 Find the row space, column space, null space, and null space of the transpose for the matrix   $\left[\begin{array}{rrrrr}50& 42& -6& -20& 20\\ -8& -1& -37& 37& -24\\ 47& 43& -29& 2& 6\\ -25& -21& 3& 10& -10\end{array}\right]$   (Gilbert Strang of MIT calls these the four fundamental subspaces of $A$.)



The 4×5 matrix $A$ maps ${\mathrm{ℝ}}^{5}$ to ${\mathrm{ℝ}}^{4}$. Maple provides bases for each of the four fundamental subspaces.



The row and null spaces of $A$ are orthogonal subspaces of ${\mathrm{ℝ}}^{5}$; the column space of $A$ and the null space of ${A}^{\mathrm{T}}$ are orthogonal subspaces in ${\mathrm{ℝ}}^{4}$. Figure 5 illustrates the relationships between these four subspaces.

  Figure 5   The four fundamental subspaces of $A$

Data entry

 • Control-drag (or copy/paste) the given matrix. Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rrrrr}50& 42& -6& -20& 20\\ -8& -1& -37& 37& -24\\ 47& 43& -29& 2& 6\\ -25& -21& 3& 10& -10\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

Row space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Row Space

$A$ = $\left[\begin{array}{ccccc}{50}& {42}& {-6}& {-20}& {20}\\ {-8}& {-1}& {-37}& {37}& {-24}\\ {47}& {43}& {-29}& {2}& {6}\\ {-25}& {-21}& {3}& {10}& {-10}\end{array}\right]$$\stackrel{\text{row space}}{\to }$$\left[\left[\begin{array}{ccccc}{1}& {0}& \frac{{60}}{{11}}& {-}\frac{{59}}{{11}}& \frac{{38}}{{11}}\end{array}\right]{,}\left[\begin{array}{ccccc}{0}& {1}& {-}\frac{{73}}{{11}}& \frac{{65}}{{11}}& {-}\frac{{40}}{{11}}\end{array}\right]\right]$

Column space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Column Space

$A$ = $\left[\begin{array}{ccccc}{50}& {42}& {-6}& {-20}& {20}\\ {-8}& {-1}& {-37}& {37}& {-24}\\ {47}& {43}& {-29}& {2}& {6}\\ {-25}& {-21}& {3}& {10}& {-10}\end{array}\right]$$\stackrel{\text{column space}}{\to }$$\left[\left[\begin{array}{c}{1}\\ {0}\\ \frac{{27}}{{26}}\\ {-}\frac{{1}}{{2}}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {1}\\ \frac{{8}}{{13}}\\ {0}\end{array}\right]\right]$

Null space of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space

$A$ = $\left[\begin{array}{ccccc}{50}& {42}& {-6}& {-20}& {20}\\ {-8}& {-1}& {-37}& {37}& {-24}\\ {47}& {43}& {-29}& {2}& {6}\\ {-25}& {-21}& {3}& {10}& {-10}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}{-}\frac{{38}}{{11}}\\ \frac{{40}}{{11}}\\ {0}\\ {0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}\frac{{59}}{{11}}\\ {-}\frac{{65}}{{11}}\\ {0}\\ {1}\\ {0}\end{array}\right]{,}\left[\begin{array}{c}{-}\frac{{60}}{{11}}\\ \frac{{73}}{{11}}\\ {1}\\ {0}\\ {0}\end{array}\right]\right\}$

Null space of ${A}^{\mathrm{T}}$

 • Write the notation for the transpose of $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Null Space

${A}^{\mathrm{%T}}$ = $\left[\begin{array}{cccc}{50}& {-8}& {47}& {-25}\\ {42}& {-1}& {43}& {-21}\\ {-6}& {-37}& {-29}& {3}\\ {-20}& {37}& {2}& {10}\\ {20}& {-24}& {6}& {-10}\end{array}\right]$$\stackrel{\text{null space}}{\to }$$\left\{\left[\begin{array}{c}\frac{{1}}{{2}}\\ {0}\\ {0}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{-}\frac{{27}}{{26}}\\ {-}\frac{{8}}{{13}}\\ {1}\\ {0}\end{array}\right]\right\}$



Special Matrices



 • Tools≻Load Package: Student Linear Algebra





 Divide the adjoint of $A=\left[\begin{array}{rrr}9& 2& 1\\ -5& -4& 1\\ 4& 6& -2\end{array}\right]$ by the determinant of $A$, and show that the resulting matrix is ${A}^{-1}$, the multiplicative inverse of $A$.



Data entry

 • Control-drag the matrix $A$. Context Panel: Assign to a Name≻$A$

$\left[\begin{array}{rrr}9& 2& 1\\ -5& -4& 1\\ 4& 6& -2\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${A}$

Obtain the determinant of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻ Standard Operations≻Determinant

$A$ = $\left[\begin{array}{ccc}{9}& {2}& {1}\\ {-5}& {-4}& {1}\\ {4}& {6}& {-2}\end{array}\right]$$\stackrel{\text{determinant}}{\to }$${-8}$

Obtain the adjoint of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Standard Operations≻Adjoint
 • Context Panel: Assign to a Name≻adjA

$A$ = $\left[\begin{array}{ccc}{9}& {2}& {1}\\ {-5}& {-4}& {1}\\ {4}& {6}& {-2}\end{array}\right]$$\stackrel{\text{adjoint}}{\to }$$\left[\begin{array}{ccc}{2}& {10}& {6}\\ {-6}& {-22}& {-14}\\ {-14}& {-46}& {-26}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${\mathrm{adjA}}$

Divide the adjoint by the determinant

 • Context Panel: Evaluate and Display Inline

$\frac{\mathrm{adjA}}{-8}$ = $\left[\begin{array}{ccc}{-}\frac{{1}}{{4}}& {-}\frac{{5}}{{4}}& {-}\frac{{3}}{{4}}\\ \frac{{3}}{{4}}& \frac{{11}}{{4}}& \frac{{7}}{{4}}\\ \frac{{7}}{{4}}& \frac{{23}}{{4}}& \frac{{13}}{{4}}\end{array}\right]$

Obtain ${A}^{-1}$, the multiplicative inverse of $A$

 • Write the name $A$ Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻ Standard Operations≻Inverse

$A$ = $\left[\begin{array}{ccc}{9}& {2}& {1}\\ {-5}& {-4}& {1}\\ {4}& {6}& {-2}\end{array}\right]$$\stackrel{\text{inverse}}{\to }$$\left[\begin{array}{ccc}{-}\frac{{1}}{{4}}& {-}\frac{{5}}{{4}}& {-}\frac{{3}}{{4}}\\ \frac{{3}}{{4}}& \frac{{11}}{{4}}& \frac{{7}}{{4}}\\ \frac{{7}}{{4}}& \frac{{23}}{{4}}& \frac{{13}}{{4}}\end{array}\right]$



Example 2: Reflection Matrix (across a Line)



 Obtain a matrix that reflects vectors in ${\mathrm{ℝ}}^{2}$ across the line $y=x/3$.



 • The red dashed line line in Figure 6 is the graph of $y=x/3$. The green vector, , is along this line.

 • The gold vector, , is orthogonal to the line $y=x/3$.

 • The black vector, , is an arbitrary vector in ${\mathrm{ℝ}}^{2}$. Its reflection across the line $y=x/3$ is the red vector.

 • The reflection matrix is constructed from the gold vector, that is, from a vector orthogonal to the "mirror" across which reflection is to take place.

Figure 6



Construct the rotation matrix

 • On a vector orthogonal to the line of reflection: Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Constructions≻Reflection Matrix
 • Context Panel: Assign to a Name≻$R$

$⟨-1,3⟩$ = $\left[\begin{array}{c}{-1}\\ {3}\end{array}\right]$$\stackrel{\text{reflection matrix}}{\to }$$\left[\begin{array}{cc}\frac{{4}}{{5}}& \frac{{3}}{{5}}\\ \frac{{3}}{{5}}& {-}\frac{{4}}{{5}}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${R}$

Test the rotation matrix

 • Write sequences of two vectors (black & green, red & green, in Figure 6); press the Enter key.
 • Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle

$⟨2,2⟩,⟨3,1⟩$

$\left[\begin{array}{c}{2}\\ {2}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {1}\end{array}\right]$

$\stackrel{\text{angle between}}{\to }$

${\mathrm{arccos}}{}\left(\frac{\sqrt{{2}}\sqrt{{10}}}{{5}}\right)$

$R.⟨2,2⟩,⟨3,1⟩$

$\left[\begin{array}{c}\frac{{14}}{{5}}\\ {-}\frac{{2}}{{5}}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {1}\end{array}\right]$

$\stackrel{\text{angle between}}{\to }$

${\mathrm{arccos}}{}\left(\frac{\sqrt{{2}}\sqrt{{10}}}{{5}}\right)$



Example 3: Reflection Matrix (across a Plane)



 Obtain a matrix that reflects vectors in ${\mathrm{ℝ}}^{3}$ across the plane .



 • Figure 7 shows the plane across which reflections are to take place. In addition, N, the black vector in the figure, is a normal to the plane.

 • The red vector, $\mathbf{V}=\mathbf{i}+\mathbf{j}+\mathbf{k}$, is an arbitrary vector in ${\mathrm{ℝ}}^{3}$.

 • The green vector is $R\mathbf{V}$, the reflection of V across the given plane, where $R$ is the requisite reflection matrix.
 • The angles between V and N and RV and -N should be equal if RV is the reflection of V across the plane.

 > use plots, Student:-VectorCalculus, Student:-LinearAlgebra in module() local p1,p2,p3,R,N,V; N:=<1,2,3>/2; V:=<1,1,1>; R:=ReflectionMatrix(N); p1:=implicitplot3d(x+2*y+2*z=0,x=-1..1,y=-1..1,z=-2..2,style=wireframe); p2:=PlotVector([N,V,R.V],color=[black,red,green],width=.2); p3:=display(p1,p2,scaling=constrained,labels=[x,y,z],axes=frame,orientation=[-5,80,0],tickmarks=[3,4,6],lightmodel=none); print(p3); end module: end use:

 >

Figure 7



Construct the rotation matrix

 • On a vector orthogonal to the plane: Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Constructions≻Reflection Matrix
 • Context Panel: Assign to a Name≻$R$

$⟨1,2,3⟩$ = $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$$\stackrel{\text{reflection matrix}}{\to }$$\left[\begin{array}{ccc}\frac{{6}}{{7}}& {-}\frac{{2}}{{7}}& {-}\frac{{3}}{{7}}\\ {-}\frac{{2}}{{7}}& \frac{{3}}{{7}}& {-}\frac{{6}}{{7}}\\ {-}\frac{{3}}{{7}}& {-}\frac{{6}}{{7}}& {-}\frac{{2}}{{7}}\end{array}\right]$$\stackrel{\text{assign to a name}}{\to }$${R}$

Test the rotation matrix

 • Write sequences of two vectors (V and N, RV and -N, in Figure 7); press the Enter key.
 • Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle

$⟨1,1,1⟩,⟨1,2,3⟩$

$\left[\begin{array}{c}{1}\\ {1}\\ {1}\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$

$\stackrel{\text{angle between}}{\to }$

${\mathrm{arccos}}{}\left(\frac{\sqrt{{3}}\sqrt{{14}}}{{7}}\right)$

$R.⟨1,1,1⟩,-⟨1,2,3⟩$

$\left[\begin{array}{c}\frac{{1}}{{7}}\\ {-}\frac{{5}}{{7}}\\ {-}\frac{{11}}{{7}}\end{array}\right]{,}\left[\begin{array}{c}{-1}\\ {-2}\\ {-3}\end{array}\right]$

$\stackrel{\text{angle between}}{\to }$

${\mathrm{arccos}}{}\left(\frac{\sqrt{{3}}\sqrt{{14}}}{{7}}\right)$



Example 4: Rotation Matrix



 Rotate the vector  through an angle of $\mathrm{π}/6$ radians about the line .



 • In Figure 8, the black vector, , is along the axis of rotation, shown as the dashed red line.

 • In Figure 8, the red vector is ; its $\mathrm{π}/6$ rotation about the axis of rotation, is the green vector.

 > use plots, Student:-VectorCalculus, Student:-LinearAlgebra in module() local p1,p2,p3,V,N,R; R:=RotationMatrix(Pi/6,<1,2,3>); V:=<1,-1,2>; N:=<1,2,3>; p1:=spacecurve([t,2*t,3*t],t=-1/5..1.2,color=red,linestyle=dash); p2:=PlotVector([V,R.V,N],color=[red,green,black],width=.2); p3:=display(p1,p2,scaling=constrained,labels=[x,y,z],tickmarks=[3,3,5],orientation=[-65,85,0]); print(p3); end module: end use:

 >

Figure 8



Construct the requisite rotation matrix

 • Write a sequence of the rotation angle and a vector along the axis of rotation; press the Enter key.
 • Context Panel: Student Linear Algebra≻Constructions≻Rotation Matrix

$\mathrm{π}/6,⟨1,2,3⟩$

$\frac{{\mathrm{\pi }}}{{6}}{,}\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]$

$\stackrel{\text{rotation matrix}}{\to }$

$\left[\begin{array}{ccc}\frac{{13}\sqrt{{3}}}{{28}}{+}\frac{{1}}{{14}}& {-}\frac{\sqrt{{3}}}{{14}}{-}\frac{{3}\sqrt{{14}}}{{28}}{+}\frac{{1}}{{7}}& {-}\frac{{3}\sqrt{{3}}}{{28}}{+}\frac{\sqrt{{14}}}{{14}}{+}\frac{{3}}{{14}}\\ {-}\frac{\sqrt{{3}}}{{14}}{+}\frac{{3}\sqrt{{14}}}{{28}}{+}\frac{{1}}{{7}}& \frac{{5}\sqrt{{3}}}{{14}}{+}\frac{{2}}{{7}}& {-}\frac{{3}\sqrt{{3}}}{{14}}{-}\frac{\sqrt{{14}}}{{28}}{+}\frac{{3}}{{7}}\\ {-}\frac{{3}\sqrt{{3}}}{{28}}{-}\frac{\sqrt{{14}}}{{14}}{+}\frac{{3}}{{14}}& {-}\frac{{3}\sqrt{{3}}}{{14}}{+}\frac{\sqrt{{14}}}{{28}}{+}\frac{{3}}{{7}}& \frac{{5}\sqrt{{3}}}{{28}}{+}\frac{{9}}{{14}}\end{array}\right]$



Matrix Operators



 • Tools≻Load Package: Student Linear Algebra



Example 1: Matrix Norm Subordinate to Vector Norm



 Obtain the Euclidean norm of the matrix $A=\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$ and show that it is the maximum value of the Euclidean norm of the vector $A\mathbf{v}$, where v is a unit vector.



Obtain the Euclidean norm of $A$

 • Control-drag the matrix $A$ Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
 • Context Panel: Simplify≻Simplify

$\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$$\stackrel{\text{Euclidean-norm}}{\to }$$\sqrt{\frac{{15}}{{2}}{+}\frac{\sqrt{{29}}}{{2}}}$$\stackrel{\text{simplify}}{=}$$\frac{\sqrt{{29}}}{{2}}{+}\frac{{1}}{{2}}$

Obtain the norm of $A\mathbf{x}$, where x is a unit vector

 • Write $A$ times a unit vector and press the Enter key.
 • Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
 • Context Panel: Simplify≻Simplify
 • Context Panel: Assign to a Name≻$f$

$\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right].⟨x,\sqrt{1-{x}^{2}}⟩$

$\left[\begin{array}{c}{x}{+}{2}\sqrt{{-}{{x}}^{{2}}{+}{1}}\\ {3}{x}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}\end{array}\right]$

$\stackrel{\text{Euclidean-norm}}{\to }$

$\sqrt{{\left({x}{+}{2}\sqrt{{-}{{x}}^{{2}}{+}{1}}\right)}^{{2}}{+}{\left({3}{x}{-}\sqrt{{-}{{x}}^{{2}}{+}{1}}\right)}^{{2}}}$

$\stackrel{\text{simplify}}{=}$

$\sqrt{{5}{{x}}^{{2}}{+}{5}{-}{2}{x}\sqrt{{-}{{x}}^{{2}}{+}{1}}}$

$\stackrel{\text{assign to a name}}{\to }$

${f}$

Maximize the norm of $A\mathbf{x}$

 • Write $f$ and press the Enter key.
 • Context Panel: Differentiate≻With Respect To≻$x$
 • Context Panel: Conversions≻Equate to 0 (This step is optional.)
 • Context Panel: Solve≻Solve
 • Context Panel: Assign to a Name≻$S$

$f$

$\sqrt{{5}{{x}}^{{2}}{+}{5}{-}{2}{x}\sqrt{{-}{{x}}^{{2}}{+}{1}}}$

$\stackrel{\text{differentiate w.r.t. x}}{\to }$

$\frac{{10}{x}{-}{2}\sqrt{{-}{{x}}^{{2}}{+}{1}}{+}\frac{{2}{{x}}^{{2}}}{\sqrt{{-}{{x}}^{{2}}{+}{1}}}}{{2}\sqrt{{5}{{x}}^{{2}}{+}{5}{-}{2}{x}\sqrt{{-}{{x}}^{{2}}{+}{1}}}}$

$\stackrel{\text{equate to 0}}{\to }$

$\frac{{10}{x}{-}{2}\sqrt{{-}{{x}}^{{2}}{+}{1}}{+}\frac{{2}{{x}}^{{2}}}{\sqrt{{-}{{x}}^{{2}}{+}{1}}}}{{2}\sqrt{{5}{{x}}^{{2}}{+}{5}{-}{2}{x}\sqrt{{-}{{x}}^{{2}}{+}{1}}}}{=}{0}$

$\stackrel{\text{solve}}{\to }$

$\left\{{x}{=}\frac{\sqrt{{1682}{-}{290}\sqrt{{29}}}}{{58}}\right\}{,}\left\{{x}{=}{-}\frac{\sqrt{{1682}{+}{290}\sqrt{{29}}}}{{58}}\right\}$

$\stackrel{\text{assign to a name}}{\to }$

${S}$

Evaluate $f=∥A\mathbf{x}∥$ at each critical value of $x$

 • Expression palette: Evaluation template Evaluate at each of the two critical values.
 • Context Panel: Evaluate and Display Inline
 • Context Panel: Simplify≻Simplify

$\genfrac{}{}{0}{}{f}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{S}_{1}}$ = $\sqrt{\frac{{15}}{{2}}{-}\frac{{25}\sqrt{{29}}}{{58}}{-}\frac{\sqrt{{1682}{-}{290}\sqrt{{29}}}\sqrt{\frac{{1}}{{2}}{+}\frac{{5}\sqrt{{29}}}{{58}}}}{{29}}}$$\stackrel{\text{simplify}}{=}$${-}\frac{{1}}{{2}}{+}\frac{\sqrt{{29}}}{{2}}$

$\genfrac{}{}{0}{}{f}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{S}_{2}}$ = $\sqrt{\frac{{15}}{{2}}{+}\frac{{25}\sqrt{{29}}}{{58}}{+}\frac{\sqrt{{1682}{+}{290}\sqrt{{29}}}\sqrt{\frac{{1}}{{2}}{-}\frac{{5}\sqrt{{29}}}{{58}}}}{{29}}}$$\stackrel{\text{simplify}}{=}$$\frac{\sqrt{{29}}}{{2}}{+}\frac{{1}}{{2}}$



Example 2: Matrix Norm and Singular Values



 Show that the Euclidean norm of the matrix $A=\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$ is the largest singular value of $A$, and the square root of the largest eigenvalue of ${A}^{\mathrm{T}}A$.



From Example 1:

Obtain the Euclidean norm of $A$

 • Control-drag the matrix $A$ Context Panel: Student Linear Algebra≻Standard Operations≻Norm≻Euclidean
 • Context Panel: Simplify≻Simplify

$\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$$\stackrel{\text{Euclidean-norm}}{\to }$$\sqrt{\frac{{15}}{{2}}{+}\frac{\sqrt{{29}}}{{2}}}$$\stackrel{\text{simplify}}{=}$$\frac{\sqrt{{29}}}{{2}}{+}\frac{{1}}{{2}}$

Obtain the singular values of $A$

 • Control-drag the matrix $A$ Context Panel: Student Linear Algebra≻ Eigenvalues, etc≻Singular Values

$\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$$\stackrel{\text{singular values}}{\to }$$\left[\begin{array}{c}\frac{\sqrt{{29}}}{{2}}{+}\frac{{1}}{{2}}\\ {-}\frac{{1}}{{2}}{+}\frac{\sqrt{{29}}}{{2}}\end{array}\right]$

Obtain the eigenvalues of ${A}^{\mathrm{T}}A$

 • Write the product ${A}^{\mathrm{T}}.A$. Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Eigenvalues, etc≻Eigenvalues

${\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]}^{\mathrm{%T}}.\left[\begin{array}{cc}1& 2\\ 3& -1\end{array}\right]$ = $\left[\begin{array}{cc}{10}& {-1}\\ {-1}& {5}\end{array}\right]$$\stackrel{\text{eigenvalues}}{\to }$$\left[\begin{array}{c}\frac{{15}}{{2}}{+}\frac{\sqrt{{29}}}{{2}}\\ \frac{{15}}{{2}}{-}\frac{\sqrt{{29}}}{{2}}\end{array}\right]$

 • Control-drag the larger of the two eigenvalues.
 • Select, and click $\sqrt{{a}}$ in the Expression palette
 • Context Panel: Evaluate and Display Inline

$\sqrt{\frac{15}{2}+\frac{1}{2}\sqrt{29}}$ = $\frac{\sqrt{{29}}}{{2}}{+}\frac{{1}}{{2}}$



Vectors and Vector Operators



 • Tools≻Load Package: Student Linear Algebra



Example 1: Vector Angle, Dot and Cross Products



 Determine the angle between the vectors  and , then obtain their dot and cross products.



Data entry

 • Context Panel: Assign to a Name≻$\mathbf{u}$ and $\mathbf{v}$, as appropriate

$⟨1,2,3⟩$$\stackrel{\text{assign to a name}}{\to }$${u}$

$⟨3,-7,5⟩$$\stackrel{\text{assign to a name}}{\to }$${v}$

Determine the angle between u and v

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Standard Operations≻Vector Angle

$\mathbf{u},\mathbf{v}$ = $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-7}\\ {5}\end{array}\right]$$\stackrel{\text{angle between}}{\to }$${\mathrm{arccos}}{}\left(\frac{{2}\sqrt{{14}}\sqrt{{83}}}{{581}}\right)$

Dot product

Cross product

 • Common Symbols palette: Dot product operator
 • Context Panel: Evaluate and Display Inline

Common Symbols palette: Cross product operator

Context Panel: Evaluate and Display Inline

$\mathbf{u}·\mathbf{v}$ = ${4}$

$\mathbf{u}×\mathbf{v}$ = $\left[\begin{array}{c}{31}\\ {4}\\ {-13}\end{array}\right]$

 • Context Panel: Evaluate and Display Inline
 • Context Panel: Student Linear Algebra≻Standard Operations≻Dot Product (or Cross Product)

$\mathbf{u},\mathbf{v}$ = $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-7}\\ {5}\end{array}\right]$$\stackrel{\text{dot product}}{\to }$${4}$

$\mathbf{u},\mathbf{v}$ = $\left[\begin{array}{c}{1}\\ {2}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{3}\\ {-7}\\ {5}\end{array}\right]$$\stackrel{\text{cross product}}{\to }$$\left[\begin{array}{c}{31}\\ {4}\\ {-13}\end{array}\right]$



Example 2: Orthonormalization



 Orthonormalize the columns of the matrix $A=\left[\begin{array}{rrr}-8& -4& 9\\ -6& 4& 3\\ 3& -9& 1\end{array}\right]$, then form $Q$, a matrix with these orthonormalized vectors, and show that $Q$ is an orthogonal matrix.



 • Control-drag the matrix $A$ and press the Enter key.
 • Context Panel: Select Elements≻Split into Columns
 • Context Panel: Student Linear Algebra≻Vector Spaces≻Gram-Schmidt≻normalized
 • Context Panel: Assign to a Name≻$Q$

$\left[\begin{array}{rrr}-8& -4& 9\\ -6& 4& 3\\ 3& -9& 1\end{array}\right]$

$\left[\begin{array}{ccc}{-8}& {-4}& {9}\\ {-6}& {4}& {3}\\ {3}& {-9}& {1}\end{array}\right]$

$\stackrel{\text{split into columns}}{\to }$

$\left[\left[\begin{array}{c}{-8}\\ {-6}\\ {3}\end{array}\right]{,}\left[\begin{array}{c}{-4}\\ {4}\\ {-9}\end{array}\right]{,}\left[\begin{array}{c}{9}\\ {3}\\ {1}\end{array}\right]\right]$

$\stackrel{\text{Gram-Schmidt (normalized)}}{\to }$

$\left[\left[\begin{array}{c}{-}\frac{{8}\sqrt{{109}}}{{109}}\\ {-}\frac{{6}\sqrt{{109}}}{{109}}\\ \frac{{3}\sqrt{{109}}}{{109}}\end{array}\right]{,}\left[\begin{array}{c}{-}\frac{{42}\sqrt{{6649}}}{{6649}}\\ \frac{{23}\sqrt{{6649}}}{{6649}}\\ {-}\frac{{66}\sqrt{{6649}}}{{6649}}\end{array}\right]{,}\left[\begin{array}{c}\frac{{3}\sqrt{{61}}}{{61}}\\ {-}\frac{{6}\sqrt{{61}}}{{61}}\\ {-}\frac{{4}\sqrt{{61}}}{{61}}\end{array}\right]\right]$

$\stackrel{\text{combine into Matrix}}{\to }$

$\left[\begin{array}{ccc}{-}\frac{{8}\sqrt{{109}}}{{109}}& {-}\frac{{42}\sqrt{{6649}}}{{6649}}& \frac{{3}\sqrt{{61}}}{{61}}\\ {-}\frac{{6}\sqrt{{109}}}{{109}}& \frac{{23}\sqrt{{6649}}}{{6649}}& {-}\frac{{6}\sqrt{{61}}}{{61}}\\ \frac{{3}\sqrt{{109}}}{{109}}& {-}\frac{{66}\sqrt{{6649}}}{{6649}}& {-}\frac{{4}\sqrt{{61}}}{{61}}\end{array}\right]$

$\stackrel{\text{assign to a name}}{\to }$

${Q}$

Verify that $Q$ is an orthogonal matrix

 • Context Panel: Evaluate and Display Inline

${Q}^{\mathrm{%T}}.Q$ = $\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$

$Q.{Q}^{\mathrm{%T}}$ = $\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]$



Visualizing a Linear Transform



 • Tools≻Load Package: Student Linear Algebra



Example 1: Linear Transform Induced by a 2×2 Matrix



 Visualize the effect of applying to unit vectors, the linear transformation determined by the matrix $A=\left[\begin{array}{cc}1& 2\\ 3& 4\end{array}\right]$.



Access the Linear Transform Plot tutor through the Context Panel applied to the matrix $A$. The result is Figure 9.

Context Panel: Student Linear Algebra≻Tutors≻Linear Transform Plot

 Figure 9