Lecture Notes: Systems of Linear Equations
Lecture Notes: Systems of Linear Equations
A First Course in
LINEAR ALGEBRA
Lecture Notes
by Karen Seyffarth
ONLINE
OPEN TEXT
ASSESSMENT
INSTRUCTOR
SUPPORT
SUPPLEMENTS
These lecture notes were originally developed by Karen Seyffarth of the University of Calgary. Edits, additions, and
revisions have been made to these notes by the editorial team at Lyryx Learning to accompany their text A First
Course in Linear Algebra based on K. Kuttler’s original text.
In addition we recognize the following contributors. All new content contributed is released under the same license
as noted below.
Ilijas Farah, York University
Ken Kuttler, Brigham Young University
Asia Weiss, York University
BE A CHAMPION OF OER!
Contribute suggestions for improvements, new content, or errata:
A new topic
A new example or problem
A new or better proof to an existing theorem
Any other suggestions to improve the material
Contact Lyryx at [email protected] with your ideas.
License
ax = b
Solution
If a 6= 0, there is a unique solution x = b/a.
Else if a = 0 and
I b 6= 0, there is no solution.
I b = 0, there are infinitely many solutions, in fact any x ∈ R is a
solution.
This a complete description of all possible solutions of ax = b.
Objective:
Can we do the same for linear equations in more variables?
a1 x1 + a2 x2 + · · · + an xn = b
x1 − 2x2 − 7x3 = −1
−x1 + 3x2 + 6x3 = 0
variables: x1 , x2 , x3 .
coefficients:
1x1 − 2x2 − 7x3 = −1
−1x1 + 3x2 + 6x3 = 0
constant terms:
x1 − 2x2 − 7x3 = −1
−x1 + 3x2 + 6x3 = 0
x1 − 2x2 − 7x3 = −1
−x1 + 3x2 + 6x3 = 0
because
(−3) − 2(−1) − 7 · 0 = −1
−(−3) + 3(−1) + 6 · 0 = 0.
Another solution to the system is x1 = 6, x2 = 0, x3 = 1 (check!).
However, x1 = −1, x2 = 0, x3 = 0 is not a solution to the system, because
(−1) − 2 · 0 − 7 · 0 = −1
−(−1) + 3 · 0 + 6 · 0 = 1 =
6 0
(−1, 4)
intersect in one point parallel but different line are the same
consistent inconsistent consistent
(unique solution) (no solutions) (infinitely many solutions)
x1 − 2x2 − 7x3 = −1
−x1 + 3x2 + 6x3 = 0,
x1 = −3 + 9s, x2 = −1 + s, x3 = s, where s ∈ R
Definition
Two systems of linear equations are equivalent if they have exactly the
same solutions.
Example
The two systems of linear equations
2x + y = 2 x + y = 1
and
3x = 3 y = 0
2x + y = 4
x − 3y = 1
Solution
Add (−2) times the second equation to the first equation.
7y = 2
x − 3y = 1
Problem
Prove that A can be obtained from B by a sequence of elementary row
operations if and only if B can be obtained from A by a sequence of
elementary row operations.
Prove that row equivalence is an equivalence relation.
Example
∗ ∗ ∗ ∗ ∗ ∗
0 1
0 0 0 1 ∗ ∗ ∗ ∗
0 0 0 0 1 ∗ ∗ ∗
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
where ∗ can be any number.
Row-echelon matrix.
Each leading 1 is the only nonzero entry in its column.
Example
∗ ∗ ∗
0 1 0 0 0
0 0 0 1 0 ∗ ∗ 0
0 0 0 0 1 ∗ ∗ 0
0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
where ∗ can be any number.
Solution
2 1 3 1 1 2 −1 0
1 2 −1 0 →r1 ↔r2 2 1 3 1
1 −4 9 2 1 −4 9 2
1 2 −1 0 1 2 −1 0
→−2r1 +r2 ,−r1 +r3 0 −3 5 1 →−r2 +r3 0 −3 5 1
0 −6 10 2 0 0 0 0
7 2
1 0
1 2 −1 0 3 3
− 13 r2 0 1 − 5 − 1 −2r2 +r1
5 1
→ 3 3 →
0 1 −3 −3
0 0 0 0 0 0 0 0
Solution
2 1 3 1 1 2 −1 0 1 2 −1 0
1 2 −1 0 → 2
1 3 1 → 0 −3 5 1
1 −4 9 2 1 −4 9 2 0 −6 10 2
1 2 −1 0
1 2 −1 0
→ 0 −3 5 1 →
0 1 − 53 − 13
0 0 0 0 0 0 0 0
x + 2y − z = 0 x = −2y + z
1 , so
y − 5
3z = −3 y = − 31 + 53 z ,
and thus
x = −2(− 13 + 53 z) + z = 2
3 − 37 z
y = − 13 + 53 z
y = − 13 + 5
3s
z = s
Solution
1 1 2 −1 1 1 2 −1 1 1 2 −1
2 1 3 0 →−2r1 +r2 0 −1 −1 2 →−1·r2 0 1 1 −2
0 −2 1 2 0 −2 1 2 0 −2 1 2
1 0 0 5
3
1
0 1 1
1 0 1 1
1r
2r +r −4
→ 2 3 0 1 1 −2 → 3 3 0
1 1 −2 →−r3 +r2 ,−r3 +r1 0 1 0
3
−2
0 0 3 −2 0 0 1 3 −2
0 0 1 3
5, y = −4, z = −2.
The unique solution is x = 3 3 3
−3x1 − 9x2 + x3 = −9
2x1 + 6x2 − x3 = 6
x1 + 3x2 − x3 = 2
Solution
1 3 −1 2 1 3 −1 2 1 3 0 4
2 6 −1 6 → 0 0 1 2 → 0 0 1 2
−3 −9 1 −9 0 0 −2 −3 0 0 0 1
which is impossible!
Therefore, this system is inconsistent, i.e., it has no solutions.
Systems of Linear Equations Gaussian Elimination Page 35/65
General Patterns for Systems of Linear Equations
Problem
Find all values of a, b and c (or conditions on a, b and c) so that the
system
2x + 3y + az = b
− y + 2z = c
x + 3y − 2z = 1
has (i) a unique solution, (ii) no solutions, and (iii) infinitely many
solutions. In (i) and (iii), find the solution(s).
Solution
2 3 a b 1 3 −2 1
0 −1 2 c → 0 −1 2 c
1 3 −2 1 2 3 a b
b − 2 − 3c
z= .
a−2
Theorem
Systems of linear equations that correspond to row equivalent augmented
matrices have exactly the same solutions.
Theorem
Every matrix A is row equivalent to a unique reduced row-echelon matrix.
x1 = 59 s − 14
9
s − 14
5 t 5 5 t
x1
x2 = − 45 s − 15 t x2 − 4 s − 1 t
or
= 5 5 , where s, t ∈ R.
x3
x3 = s s
x4
x4 = t t
Example (continued)
In the previous example,
9 14
5s − 5 t
9
− 14
5s 5 t
x1
x2 − 4 s − 1 t − 45 s − 15 t
= 5 5 = +
x3
s 0
s
x4 0 t
t
9
− 14
5 5
− 45 − 15
= s +t
1 0
0 1
Systems of Linear Equations Rank and Homogeneous Systems Page 44/65
Example (continued)
This gives us
9
− 14
x1 5 5
4
x2 − − 15
5
x3 = s +t = sX1 + tX2 ,
1 0
x4 0 1
9 14
5 −5
− 54 − 51
where X1 = and X2 = .
1 0
0 1
where r , q ∈ R.
Proof.
Consider the RREF matrix equivalent to the augmented matrix of the
system.
Each non-leading variable corresponds to a parameter; let N be the set of
non-leading variables and enumerate the parameters as sj , for j ∈ N.
Then, for scalars cij , the general solution has the form
X
xi = cij sj (1)
j∈N
x + y = 0
ay + z = 0
x + y + az = 0
Solution
Non-trivial solutions occur only when a = 0, and the solutions when a = 0
are given by
x 1
y = s −1 , s ∈ R.
z 0
Definition
The rank of a matrix A, denoted rank A, is the number of leading 1’s in
any row-echelon matrix obtained from A by performing elementary row
operations.
| {z } | {z }
n r leading 10 s
Problem
a b 5
Find the rank of A = .
1 −2 1
Solution
a b 5 1 −2 1 1 −2 1
→ →
1 −2 1 a b 5 0 b + 2a 5 − a
If b + 2a = 0 and 5 − a = 0, i.e., a = 5 and b = −10, then rank A = 1.
Otherwise, rank A = 2.
For any system of linear equations, exactly one of the following holds:
1 the system is inconsistent;
2 the system has a unique solution, i.e., exactly one solution;
3 the system has infinitely many solutions.
One can see what case applies by looking at the RREF matrix equivalent to
the augmented matrix of the system and distinguishing three cases:
1 The last nonzero row ends with . . . 0 1]: no solution.
2 The last nonzero row does not end with . . . 0 1] and all variables are
leading: unique solution.
3 The last nonzero row does not end with . . . 0 1] and there are
non-leading variables: infinitely many solutions.
Solution
Begin by putting the augmented matrix in reduced row-echelon form.
1 −2 2 2 −5 1 1 −2 0 0 −13 9
−3 6 −4 −9 3 −1 0 0 1 0 0 −2
→
−1 2 −2 −4 −3 3 0 0 0 1 4 −2
1 −2 1 3 −1 1 0 0 0 0 0 0
The system has 5 variables, and the rank of the augmented matrix is 3.
Since the system is consistent, the set of solutions has 5 − 3 = 2
parameters.
Systems of Linear Equations Rank and Homogeneous Systems Page 55/65
Solution (continued)
From the reduced row-echelon matrix
1 −2 0 0 −13 9
0
0 1 0 0 −2
0 0 0 1 4 −2
0 0 0 0 0 0
Problem
The following is the reduced row-echelon form of the augmented matrix of
a system of linear equations.
1 0 −3 0 6 8
0 1 1 0 2 0
0 0 0 1
5 −5
0 0 0 0 0 0
0 0 0 0 0 0
How many equations does the system have? 5
How many variables does the system have? 5
If the variables are labeled x1 , x2 , x3 , x4 , x5 , which variables are are the
- leading variables? x1 , x2 , x4
- non-leading variables? x3 , x5
x1 − 3x3 + 6x5 =8
x2 + x3 + 2x5 =0
x4 + 5x5 = −5
Solution
Setting up a system of equations in x, y , z, w gives
Sn : x = z or x − z = 0
O : 2x = w or 2x − w = 0
H : 2y = 2w or 2y − 2w = 0
1 0 −1 0 0
The augmented matrix is 2 0 0 −1 0
0 2 0 −2 0
Systems of Linear Equations Various Applications Page 60/65
Solution (continued)
The reduced row-echelon matrix is
1 0 0 − 12 0
0 1 0 −1 0
0 0 1 − 12 0
Resistor:
Voltage Source:
Current:
I1
17 volts
I2
1Ω
4Ω
I3 2Ω
2Ω
24 volts
I1 3Ω
5Ω
Systems of Linear Equations Various Applications Page 63/65
Solution
The equation for the bottom circuit, with current I1 is given by