\\\\( \nonumber \newcommand{\bevisslut}{$\blacksquare$} \newenvironment{matr}[1]{\hspace{-.8mm}\begin{bmatrix}\hspace{-1mm}\begin{array}{#1}}{\end{array}\hspace{-1mm}\end{bmatrix}\hspace{-.8mm}} \newcommand{\transp}{\hspace{-.6mm}^{\top}} \newcommand{\maengde}[2]{\left\lbrace \hspace{-1mm} \begin{array}{c|c} #1 & #2 \end{array} \hspace{-1mm} \right\rbrace} \newenvironment{eqnalign}[1]{\begin{equation}\begin{array}{#1}}{\end{array}\end{equation}} \newcommand{\eqnl}{} \newcommand{\matind}[3]{{_\mathrm{#1}\mathbf{#2}_\mathrm{#3}}} \newcommand{\vekind}[2]{{_\mathrm{#1}\mathbf{#2}}} \newcommand{\jac}[2]{{\mathrm{Jacobi}_\mathbf{#1} (#2)}} \newcommand{\diver}[2]{{\mathrm{div}\mathbf{#1} (#2)}} \newcommand{\rot}[1]{{\mathbf{rot}\mathbf{(#1)}}} \newcommand{\am}{\mathrm{am}} \newcommand{\gm}{\mathrm{gm}} \newcommand{\E}{\mathrm{E}} \newcommand{\Span}{\mathrm{span}} \newcommand{\mU}{\mathbf{U}} \newcommand{\mA}{\mathbf{A}} \newcommand{\mB}{\mathbf{B}} \newcommand{\mC}{\mathbf{C}} \newcommand{\mD}{\mathbf{D}} \newcommand{\mE}{\mathbf{E}} \newcommand{\mF}{\mathbf{F}} \newcommand{\mK}{\mathbf{K}} \newcommand{\mI}{\mathbf{I}} \newcommand{\mM}{\mathbf{M}} \newcommand{\mN}{\mathbf{N}} \newcommand{\mQ}{\mathbf{Q}} \newcommand{\mT}{\mathbf{T}} \newcommand{\mV}{\mathbf{V}} \newcommand{\mW}{\mathbf{W}} \newcommand{\mX}{\mathbf{X}} \newcommand{\ma}{\mathbf{a}} \newcommand{\mb}{\mathbf{b}} \newcommand{\mc}{\mathbf{c}} \newcommand{\md}{\mathbf{d}} \newcommand{\me}{\mathbf{e}} \newcommand{\mn}{\mathbf{n}} \newcommand{\mr}{\mathbf{r}} \newcommand{\mv}{\mathbf{v}} \newcommand{\mw}{\mathbf{w}} \newcommand{\mx}{\mathbf{x}} \newcommand{\mxb}{\mathbf{x_{bet}}} \newcommand{\my}{\mathbf{y}} \newcommand{\mz}{\mathbf{z}} \newcommand{\reel}{\mathbb{R}} \newcommand{\mL}{\bm{\Lambda}} \newcommand{\mnul}{\mathbf{0}} \newcommand{\trap}[1]{\mathrm{trap}(#1)} \newcommand{\Det}{\operatorname{Det}} \newcommand{\adj}{\operatorname{adj}} \newcommand{\Ar}{\operatorname{Areal}} \newcommand{\Vol}{\operatorname{Vol}} \newcommand{\Rum}{\operatorname{Rum}} \newcommand{\diag}{\operatorname{\bf{diag}}} \newcommand{\bidiag}{\operatorname{\bf{bidiag}}} \newcommand{\spanVec}[1]{\mathrm{span}{#1}} \newcommand{\Div}{\operatorname{Div}} \newcommand{\Rot}{\operatorname{\mathbf{Rot}}} \newcommand{\Jac}{\operatorname{Jacobi}} \newcommand{\Tan}{\operatorname{Tan}} \newcommand{\Ort}{\operatorname{Ort}} \newcommand{\Flux}{\operatorname{Flux}} \newcommand{\Cmass}{\operatorname{Cm}} \newcommand{\Imom}{\operatorname{Im}} \newcommand{\Pmom}{\operatorname{Pm}} \newcommand{\IS}{\operatorname{I}} \newcommand{\IIS}{\operatorname{II}} \newcommand{\IIIS}{\operatorname{III}} \newcommand{\Le}{\operatorname{L}} \newcommand{\app}{\operatorname{app}} \newcommand{\M}{\operatorname{M}} \newcommand{\re}{\mathrm{Re}} \newcommand{\im}{\mathrm{Im}} \newcommand{\compl}{\mathbb{C}} \newcommand{\e}{\mathrm{e}} \\\\)

Exercise 1: Solutions of Systems of Linear Equations

These first exercises are an introduction to how to solve systems of linear equations and should all be solved by hand.

A

Find the general solution to the system of linear equations: \begin{equation} \begin{aligned} x_1 + 2x_2 - 4x_3 &= 2\newline x_2-2x_3 &= -1\newline x_3 &= 2 \end{aligned} \end{equation}

B

Find the general solution to the system of linear equations: \begin{equation} \begin{aligned} x_1 - x_3 + x_4 &= 0\newline x_1 + x_2 + x_3 + x_4 &= 1\newline 4x_1 + 4x_2 + 4x_3 + 3x_4 &= 5 \end{aligned} \end{equation}

C

Find the general solution to the complex system of linear equations: \begin{equation} \begin{aligned} i\,x_1 - 2x_2=-i\newline x_1 + (1+i)x_2= 1 \end{aligned} \end{equation}

D

Find the general set of solutions for the system of linear equations: \begin{equation} \begin{aligned} x_1+2x_2+2x_3 &= 2 \newline x_2+3x_3 &= 3 \newline x_1+4x_2+8x_3 &= 9 \end{aligned} \end{equation}

Exercise 2: Intro to Systems of Equations with Maple

Naturally, Maple can perform computations with matrices. But not all commands are loaded by default. For those we need for our topic today, a package must first be loaded within our Maple sheet. This package is called LinearAlgebra and is loaded with this command:

with(LinearAlgebra):

Note that you must use uppercase L and A. Maple is case-sensitive. (If you’d like to see all the commands loaded with this package, then try to remove the colon.)

The system of linear equations

\begin{equation} \begin{aligned} 3x - 7y &= 1 \newline -2x -y &= 4 \end{aligned} \end{equation} has the coefficient matrix \begin{equation} \begin{aligned} \begin{matr}{rr} 3 & -7 \newline -2 & -1 \end{matr} \end{aligned} \end{equation} and the right-hand-side vector \begin{equation} \begin{aligned} \begin{matr}{rr} 1 \newline 4 \end{matr} \end{aligned} \end{equation}

You create a vector in Maple like this:

<1,4>

and store it in Maple’s memory by defining it to a name with :=:

b:=<1,4>

When you later type b anywhere on a math line, then this is the output you get. Such defined names are reset by clicking Enter on the restart command (or alternatively by writing on a new line: b:='b').

Matrices are created using these symbols: <, >, , ; and |. Write either

A:=<3 , -7 ; -2 , -1>

or

A:=<3,-2 | -7,-1>

which will both result in the same matrix; the former writes it row-wise and the latter column-wise. You can use which ever syntax you like the most. (It might be recommandable to use the latter syntax where the commas separate rows, which corresponds to how vectors are made.)

The linear equation system can be solved in one go with the command LinearSolve (again remember to correctly type uppercase and lowercase letters):

LinearSolve( A , b )

The solutions to the two given equations of two unknowns can be visualized as the intersections between two straight lines in a plane. To illustrate this you’ll need plotting commands from another package:

with(plots):

The plot command itself is loaded by default, but more advanced types of plotting and presentation commands, like the ones below, require this package to be loaded first. Try using implicitplot, which can plot full equations, in contrast to plot that only plots expressions or functions:

line1 := implicitplot( 3*x - 7*y = 1 , x = -3 .. 3 , y = -3 .. 3):

line2 := implicitplot( -2*x - y = 4 , x = -5 .. 3 , y = -3 .. 3):

We are suppressing the output with : because we are not interested in two different plot windows but rather in a single window with both graphs shown. You can merge many plots into the same window with display - note the scaling=constrained argument that enforces equal units on all axes giving same proportions:

display(line1 , line2 , scaling=constrained)

Note that when performing multiplications you must always remember the multiplication sign *. If you instead of x*3-y*7 wrote x3-y7, then Maple would mistakenly have thought that you were refering to variable names $x_3$ and $y_x$. So always remember the multiplication symbol.

Now that you have the graph, try to read from it the intersection point and compare it to the solution you found when solving the two equations analytically.

We will now try to solve Exercise 1.b) with Maple. Write (and understand!) the following commands:

restart: with(LinearAlgebra):

We are given the equations:

eqn1 := x1 - x3 + x4 = 0

eqn2 := x1 + x2 + x3 + x4 = 1

eqn3 := 4*x1 + 4*x2 + 4*x3 + 3*x4 = 5

We now generate the augmented matrix corresponding to the above system of linear equations:

T :=<1,1,4|0,1,4|-1,1,4|1,1,3|0,1,5>

Write the following commands and check wether the results match those you arrived at by hand:

T1 := RowOperation(T , [2,1] , -1)

T2 := RowOperation(T1 , [3,1] , -4)

T3 := RowOperation(T2 , [3,2] , -4)

T4 := RowOperation(T3 , 3 , -1)

redRowEchForm := RowOperation(T4 , [1,3] , -1)

You have now reached the reduced row echelon form of your augmented matrix.

Note the Maple syntax for using each of the three row operations. If you are still not clear on how the syntax works and how they should be used, then try out some more examples before continuing and make yourself more familiar with them.

Actually, you don’t have to use RowOperation for a semi-manual step-by-step method. If you are not interested in the intermediate steps, then you can reach the reduced row echelon form of the augmented matrix immediately with a single command:

ReducedRowEchelonForm(T)

From here Maple cannot rewrite any further, and you must manually extract the solutions and write them on standard parametric form.

Now try to solve the system using LinearSolve (the argument free=t sets the symbol to use for any free parameters):

LinearSolve(A,b,free=t)

Do both solution methods - using RowOperation or ReducedRowEchelonForm vs. LinearSolve - give the same result? In both cases you must manually finalise the output on the form that you want.

Exercise 3: System of Linear Equations with Maple

Given the system of equations \begin{equation} \begin{aligned} x_1+2x_2+2x_3 &= 6 \newline x_2+3x_3 &= 3 \newline x_1+4x_2+8x_3 &= 12 \end{aligned} \end{equation}

A

Define in Maple the coefficient matrix $\mA$, the right-hand side $\mathbf b$ and the augmented matrix $\mT$ of the system of equations.

B

Solve the system using the three Maple commands: RowOperation, ReducedRowEchelonform and LinearSolve.

C

State the solution set for the system of equations on standard parametric form.

D

Discuss pros and cons of each of the three Maple commands: RowOperation, ReducedRowEchelonForm and LinearSolve.

Exercise 4: The Structure of Solutions and the Concept of Rank (Theory)

It is essential to understand the structure of a solution set. Both the relation between the solutions of the inhomogeneous system of equations and that of the corresponding system of homogeneous equations, as well as the relation between the form/dimension of the solution set and the rank of the corresponding augmented matrix are essential to understand.

A

If $ \mx_0 = (1,2,3) $ is a solution to the inhomogeneous system of linear equations, and if $ \mx_1 = (0,5,2) $ is a solution to the corresponding homogeneous problem, is $ \my_0 = (1,7,5) $ then a solution to the inhomogeneous set of equations?

Is $ \mz_0 = (2,9,8) $ a solution to the inhomogeneous system of linear equations?

Is the difference between two solutions of the inhomogeneous system of linear equations a solution to the inhomogeneous system of equations?

Before you solve the next problem you should thoroughly work through Example 6.8 in eNote 6 about Gauss-Jordan elimination and today’s Maple demo.

B

Describe in your own words what the rank of the augmented matrix means to the structure of the solution set.

Exercise 5: The Structure of Solutions and the Concept of Rank (Practice)

The system of equations in this exercise contains an unknown real number $a$ and the solution is different depending on the value of $a$. During the Gauss-Jordan elimination you must be particularly careful not to divide by zero, because you then will miss important special cases. Since $a$ is an unknown and thus could take a value that causes a denominator to become zero, then dividing with an expression involving $a$ automatically constitutes a special case.

Use the exercise to discuss how the rank of the coefficient matrix and augmented matrix of the system and thus the structure of the solution set depends on $a\,.$

A

By hand: Find for every real value of $a$ all solutions to the system of linear equations \begin{equation} \begin{aligned} ax_1 + x_2 + x_3 &= 1\newline x_1 + ax_2 + x_3 &= 1\newline x_1 + x_2 + ax_3 &= 1 \end{aligned} \end{equation}

B

Check the result above with Maple’s LinearSolve. How does Maple handle special cases?

Exercise 6: Computations with Matrices

Multiplication with matrices is not obvious. As a start, read Example 7.2 and Example 7.11 in eNote 7. Note the rules for the computational operations introduced in Theorem 7.3, Theorem 7.13 and Theorem 7.16.

A

What is important to consider before you start the multiplication?

B

Which conditions of the matrices $\mA$ and $\mB$ are needed for it to even make sense to ask whether $\mA\mB$ and $\mB\mA$ might be equal?

C

If $\mA\mB$ and $\mB\mA$ have the same dimensions, is it then certain that $\mA\mB = \mB\mA$?

D

A matrix and a vector are given by: \begin{equation} \mA= \begin{matr}{rrr} 2 & -1 & 3 \newline 1 & 2 & -1 \end{matr} \,\,\,\mathrm{and}\,\,\, \mb=\begin{matr}{r} 3\newline 1\newline -2\end{matr}\,. \end{equation} Compute by hand the matrix-vector product of $\mA$ and $\mb$.

E

Given the matrices \begin{equation} \mA= \begin{matr}{rrr} 1 & 1 & 2 \newline 1 & 2 & -1 \end{matr} \quad \mathrm{and} \quad \mB = \begin{matr}{rrr} 0 & -1 & -1 \newline 1 & 2 & 1 \end{matr} \end{equation} By hand: Compute, if possible, the following: $2\mA-3\mB$, $2\mA\transp-3\mB\transp$, $2\mA-3\mB\transp$, $\mA\mB$, $\mA\mB\transp$, $\mB\mA\transp$, $\mB\transp\mA$ and $\mA\transp\mB$.

Exercise 7: A System of Equations in Disguise?

A matrix $\,\mA\,$ and a vector $\,\mathbf b\,$ are given by

$$ \mA=\begin{matr}{rrrr} 1 & 0 & -1 & 1 \newline -1 & 2 & -3 & -1 \end{matr}\,\,\,\,\mathrm{and} \,\,\,\, \mathbf b = \begin{matr}{r} 4\newline 2 \end{matr}\,.$$
A

Solve the matrix equation $\,\mA\mathbf x=\mathbf b\,.$