0% found this document useful (0 votes)
8 views14 pages

Linear Equations

The document discusses systems of linear equations, presenting methods such as Cramer's Rule, Matrix Inverse Method, Gauss Elimination, and Gauss-Jordan Elimination for solving these systems. It provides examples illustrating the application of each method and highlights conditions under which these methods are valid, such as the requirement for a non-zero determinant. Additionally, it emphasizes the importance of transforming systems into matrix form and performing elementary row operations.

Uploaded by

hana yahia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views14 pages

Linear Equations

The document discusses systems of linear equations, presenting methods such as Cramer's Rule, Matrix Inverse Method, Gauss Elimination, and Gauss-Jordan Elimination for solving these systems. It provides examples illustrating the application of each method and highlights conditions under which these methods are valid, such as the requirement for a non-zero determinant. Additionally, it emphasizes the importance of transforming systems into matrix form and performing elementary row operations.

Uploaded by

hana yahia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

System of Linear Equations

Introduction

Consider a system of 𝑛 linear algebraic equations in 𝑛 unknowns

a11 x1 + a12 x2 +  + a1n xn = b1,


a21 x1 + a22 x2 +  + a2n xn = b2
    
an1 x1 + an 2 x2 +  + ann xn = bn

where 𝑎𝑖𝑗 are the known coefficients, 𝑏𝑖 are the known values and 𝑥𝑖 are
the unknown to be determined such that 𝑖 and 𝑗 = 1,2, … , 𝑛. The system can be
written in a matrix form as

 a11 a12  a1n   x1  b1 


a a22  a2n   x2  b2 
 21  = .
        
    
 an1 an 2  ann   xn  bn 

Writing

 a11 a12  a1n   x1  b1 


a a22  a2n  x  b 
A =  21 , X =  2 and B =  2
       
     
 an1 an 2  ann   xn  bn 
we have
𝑨𝑿=𝑩

This is the matrix form of the simultaneous equations. Here the unknown is
the vector 𝑿, since 𝑨 and 𝑩 are already known. 𝑨 is called the matrix of
coefficients (𝑎𝑖𝑗 ).

1
Cramer’s Rule

The solution of the system can be put in the form:

det( Ak )
xk = , k = 1, 2,.....,n
det( A)

where det(𝐴) is the determinant of the coefficients matrix of the system:

a11 a12  a1n


a a22  a2n
det( A) = 21 ,
   
an1 an 2  ann

and det(𝐴𝑘 ) is the determinant which is formed from the determinant det(𝐴)
by replacing the elements of the 𝑘𝑡ℎ column in it by the known values (𝑏𝑖 )

a11 a12  a1, k −1 b1 a1, k +1 a1, n


a21 a22  a2, k −1 b2 a2, k +1 a2, n
det( Ak ) =        .
      
an1 a11  an, k −1 bn an, k +1 an, n

Note that:

When all 𝑏𝑖 = 0 i.e. 𝑩 = 𝑶, the system is called homogeneous system. The


homogeneous system has two cases:

1) If det(𝐴) ≠ 0 , this system has a trivial solution i.e. 𝑋 = 𝑂 or all 𝑥𝑖 = 0.

2) If det(𝐴) = 0 , then there is non-trivial solution and we can't use Cramer's


rule.

2
Example 1
Use Cramer’s rule to solve the system of equations:

2 x − y + 3 z = 10,
x + 2 y − z = −5,
3 x + 4 y + 2 z = −4.
Solution
2 −1 3 10 − 1 3
det( A) = 1 2 − 1 = 15 , det( A1 ) = − 5 2 − 1 = 30
3 4 2 −4 4 2

2 10 3 2 − 1 10
det( A2 ) = 1 − 5 − 1 = −45 det( A3 ) = 1 2 − 5 = 15
3 −4 2 3 4 −4

det( A1 ) det( A2 ) det( A3 )


x= = 2, y= = −3, and z= = 1.
det( A) det( A) det( A)

Example 2
Use Cramer’s rule to solve the system of equations, if it is valid:

2 x1 − x2 + 3 x3 − 10 x4 = 0
x1 + 2 x2 − x3 + 5 x4 = 0
3 x1 + 4 x2 + 2 x3 + 4 x4 = 0
4 x1 + 3 x2 + x3 = 0
Solution

2 − 1 3 − 10
1 2 −1 5
Since det( A) = = 0 , so the system can't be solved using
3 4 2 4
4 3 1 0

Cramer's rule (discussed later).

3
Matrix Inverse Method

For the matrix notation


𝐴𝑋=𝐵

we can multiply both sides by 𝐴−1 from left, provided this exists, to give

𝐴−1 𝐴 𝑋 = 𝐴−1 𝐵

So, 𝑿 = 𝑨−𝟏 𝑩

The system has a unique solution if and only if the det(𝐴) ≠ 0. If so, the
homogeneous system (𝐵 = 0) possess only a trivial solution (𝑋 = 0).

Example 3
Solve the following system of equations by using matrix inverse method
𝑥1 + 2𝑥2 = 5 and 3𝑥1 + 7𝑥2 = 17
Solution
1 2 𝑥1 5
[ ] [𝑥 ]=[ ]
3 7 2 17

1 2 5
where 𝐴 = [ ] and 𝐵 = [ ].
3 7 17

1 7 −2 7 −2
𝐴−1 = [ ]=[ ]
1 −3 1 −3 1

𝑥1 7 −2 5 1
∴[𝑥 ]=[ ][ ] = [ ].
2 −3 1 17 2

4
Example 4
Solve the following system of equations by using matrix inverse method

2 x1 + 6 x2 + 8 x3 = 22
2 x1 + 5 x2 + 3 x3 = 8
3 x1 + 4 x2 − 4 x3 = −10
Solution
2 6 8 𝑥1 22
𝑥
[2 5 3 ] [ 2]=[ 8 ]
3 4 −4 𝑥3 −10

2 6 8 22
where 𝐴 = [ 2 5 3 ] and 𝐵 = [ 8 ].
3 4 −4 −10

1 −32 56 −22
−1
𝐴 = [ 17 −32 10 ]
−18
−7 10 −2

𝑥1 22
1 −32 56 −22 1 −36 2
∴ [ 𝑥2 ] = [ 17 −32 10 ] [ 8 ] = [ 18 ] = [ −1 ].
𝑥3 −18 −18
−7 10 −2 −10 −54 3

Note that:
The system in example (2) can't be solved using the matrix inverse method
because det(𝐴) = 0 and therefore 𝐴−1 does not exist.

Moreover, Cramer's rule and matrix inverse method are valid only if:
1) The system must have the same number of equations as unknowns, that
is, the coefficient matrix of the system 𝑨 must be square.
2) The determinant of the coefficient matrix must be non-zero (det(𝐴) ≠ 0).
The reason, of course, is that the inverse of a matrix exists.

5
Gauss Elimination Method

The goal of Gauss elimination method is to convert any given system of


equations into an equivalent upper triangular form. Once converted, we can
back-substitute through the equations, solving for the unknowns.

The operations used in converting a system of equations to upper triangular


form are known as elementary row operations and are:

1) Any equation (row) may be multiplied by a nonzero scalar.


2) Any equation (row) may be added to a multiple of another equation (row).
3) The positions of any two equations (rows) in the system may be exchanged.

𝒌 𝑹𝒊
𝒌 𝑹𝒊 + 𝑹𝒋
𝑹𝒊 ↔ 𝑹𝒋

In practice, when carrying out elementary row operations on the matrix form,
it is useful to define the so-called augmented matrix, which consists of 𝐴 with
the right-hand side 𝐵 attached together.

Example 5
Solve the system of equations using Gauss elemination method

𝑥1 + 3 𝑥2 = 11
2 𝑥1 + 9 𝑥2 = 31
Solution
1 3 𝑥1 11
The matrix form: [ ] [𝑥 ]=[ ]
2 9 2 31

6
1 3 11 −2 𝑅1 + 𝑅2 1 3 11
Augmented matrix: [𝑨|𝑩]≡[ | ] ⇒ [ | ]
2 9 31 0 3 9
resulting in
𝑥1 + 3 𝑥2 = 11
3 𝑥2 = 9

the second equation gives 𝑥2 = 3 and perform back substitution in the first
equation to get 𝑥1 = 2.

Gauss-Jordan Elimination Method

It is similar and simpler than Gauss elimination method as we have to


perform two different processes in Gauss elimination method i.e.
1) Formation of upper triangular matrix, and
2) Back substitution
But in case of Gauss-Jordan elimination method, we only have to form a
reduced row echelon form (rref).

A matrix is in reduced row echelon form if it satisfies the following conditions:

1) All nonzero rows (rows with at least one nonzero element) are above any
rows of all zeroes, if any, belong at the bottom of the matrix.
2) The leading coefficient (the first nonzero number from the left, also called
the pivot) of a nonzero row is always strictly to the right of the leading
coefficient of the row above it.
3) Every leading coefficient is 1 and is the only nonzero entry in its column.

7
These are examples of matrices in reduced row echelon form (rref),

1 4 0 −1 −21
1 0 0 3 1 0 2 −1
0 0 1 −6 −11
[ 0 1 0 | 4 ] , [ 0 1 −4 | 5 ] and [ | ]
0 0 0 0 0
0 0 1 2 0 0 0 0
0 0 0 0 0

which show that the left of the matrix is not always an identity matrix.

Example 6
Solve the system of equations using Gauss-Jordan elimination method

𝑥1 + 3 𝑥2 = 11
2 𝑥1 + 9 𝑥2 = 31
Solution
1
𝑅
1 3 11 −2 𝑅1 + 𝑅2 1 3 11 3 2 1 3 11 −3 𝑅2+ 𝑅1 1 0 2
[ | ] ⇒ [ | ] ⇒ [ | ] ⇒ [ | ]
2 9 31 0 3 9 0 1 3 0 1 3

resulting in 𝑥1 = 2 and 𝑥2 = 3.

Note that:
In the previous example, after carrying out the elementary row operations, the
matrix 𝐴 is converted to 𝐼 and 𝐵 converted to the solution 𝑋.

Row Operations
i.e. [𝐴|𝐵] ⇒ [𝑰|𝑋]

Special case:

If we try to solve the following systems 𝐴𝑋 = 𝑰, we find that 𝑋 = 𝐴−1 . Therfore,


we can use to find the inverse of a matrix 𝐴 as follows

Row Operations
[𝑨|𝑰] ⇒ [ 𝑰 | 𝑨−𝟏 ]

8
Example 7
2 5
Use Gauss-Jordan elimination method to find 𝐴−1 for 𝐴 = [ ].
1 3
Solution

2 5 1 0 𝑅1↔ 𝑅2 1 3 0 1 −2𝑅1+ 𝑅2 1 3 0 1
[ | ] ⇒ [ | ] ⇒ [ | ]
1 3 0 1 2 5 1 0 0 −1 1 −2

− 𝑅2 1 3 0 1 −3𝑅2+ 𝑅1 1 0 3 −5
⇒ [ | ] ⇒ [ | ]
0 1 −1 2 0 1 −1 2

3 −5
∴ 𝐴−1 = [ ].
−1 2

Example 8
a) Find the inverse of 𝐴 (Using Gauss-Jordan elimination method)

0 1 1
𝐴=[ 1 0 −2]
−1 1 4

b) Hence, solve the following system


𝑦+𝑧 =0
𝑥 − 2𝑧 =1
𝑦 + 4𝑧 =2+𝑥
Solution
a)
0 1 1 1 0 0 𝑅1↔ 𝑅2 1 0 −2 0 1 0
[ 1 0 −2 | 0 1 0 ] ⇒ [ 0 1 1 |1 0 0]
−1 1 4 0 0 1 −1 1 4 0 0 1

𝑅1 + 𝑅3 1 0 −2 0 1 0 −𝑅2+ 𝑅3 1 0 −2 0 1 0
⇒ [0 1 1 | 1 0 0] ⇒ [0 1 1 | 1 0 0]
0 1 2 0 1 1 0 0 1 −1 1 1

9
−𝑅3 + 𝑅2 1 0 0 −2 3 2
⇒ [0 1 0 | 2 −1 −1 ]
2𝑅3 + 𝑅1
0 0 1 −1 1 1

−2 3 2
−1
∴ 𝐴 = [ 2 −1 −1].
−1 1 1
b)
𝑦+𝑧 =0
𝑥 − 2𝑧 =1
𝑦 + 4𝑧 =2+𝑥

0 1 1 𝑥 0
[ 1 𝑦
0 −2 ] [ ] = [ 1 ]
−1 1 4 𝑧 2

𝐴 𝑋 = 𝐵 ⇒ 𝑋 = 𝐴−1 𝐵

𝑥 −2 3 2 0 7
𝑦
∴ [ ] = [ 2 −1 −1] [ 1 ] = [−3].
𝑧 −1 1 1 2 3

Example 9
Solve the following system of linear equations using Gauss-Jordan method

𝑥1 − 3𝑥2 + 4𝑥3 = 12
2𝑥1 − 5𝑥2 + 3𝑥3 = 13
𝑥1 − 4𝑥2 + 9𝑥3 = 23

Solution
1 −3 4 12 1 −3 4 12 1 0 −11 −21
[ 2 −5 3 | 13 ] ⇒ [0 1 −5 | −11 ] ⇒ [ 0 1 −5 | −11 ]
1 −4 9 23 0 −1 5 11 0 0 0 0

This last matrix is in reduced row echelon form so we can stop. It corresponds
to the augmented matrix of the following system.

10
𝑥1 − 11𝑥3 = −21
𝑥2 − 5𝑥3 = −11

We can express the solutions of this system as

𝑥1 = −21 + 11 𝑥3
𝑥2 = −11 + 5 𝑥3

Since there is no specific value for 𝑥3 , it can be chosen arbitrarily. This means
that there are infinitely many solutions for this system. We can represent all
the solutions by using a parameter 𝑡 as follows.

Let 𝑥3 = 𝑡, 𝑥2 = −11 + 5𝑡 and 𝑥1 = −21 + 11𝑡.

Any value of the parameter 𝑡 gives us a solution of the system.

Note that: In example (9), the value of det(𝐴) = 0. This explains the zero row
appeared in rref(A).

Example 10
Solve the following system of equations

𝑥+2𝑦+3𝑧 =0
4𝑥 + 5 𝑦 + 6 𝑧 =6
Solution
1 2 3 0 1 2 3 0 1 2 3 0
[ | ] ⇒ [ | ] ⇒ [ | ]
4 5 6 6 0 −3 −6 6 0 1 2 −2

1 0 −1 4
∴ rref(𝐴|𝐵) = [ | ]
0 1 2 −2
The system reduced to

𝑥− 𝑧 =4
𝑦+2𝑧 = −2

11
Let 𝑧 = 𝑡, then 𝑥 = 4 + 𝑡 and 𝑦 = −2 − 2𝑡. The solution can be written as

𝑥 4 1
[ 𝑦 ] = [−2] + 𝑡 [−2].
𝑧 0 1

Example 11
Solve the following system of equations

𝑥1 + 2 𝑥2 + 3 𝑥3 = 4
2 𝑥1 + 3 𝑥2 + 7 𝑥3 = 6
𝑥1 + 𝑥2 + 4 𝑥3 = 9
Solution
1 2 3 4 1 2 3 4 1 2 3 4
[ 2 3 7 |6 ] ⇒ [ 0 −1 1 | −2 ] ⇒ [0 1 −1 | 2 ]
1 1 4 9 0 −1 1 5 0 −1 1 5

1 0 5 0
∴ rref(𝐴|𝐵) = [ 0 1 −1 | 2 ]
0 0 0 7

Third equation does not make sense. We recognize that the system is
inconsistent when we get to an equation that says 0 = something nonzero. So,
the system has no solution.

12
Example 12
Find the value(s) of the constant 𝑘 such that the following system

𝑥1 + 2𝑥2 + 3𝑥3 = 4
𝑥1 + 𝑘 𝑥2 + 4𝑥3 = 6
𝑥1 + 2𝑥2 + (𝑘 + 2) 𝑥3 = 6

has (1) unique solution (2) no solution (3) many solutions.

Solution
1 2 3 4 1 2 3 4
[ 1 𝑘 4 |6] −𝑅1 + 𝑅2 and – 𝑅1 + 𝑅3 [0 𝑘−2 1 |2]
1 2 𝑘+2 6 0 0 𝑘−1 2

(1) For unique solution: 𝑘 ≠ 1 and 𝑘 ≠ 2


(2) For no solution: 𝑘 = 1
1 2 3 4
[ 0 −1 1 |2]
0 0 0 2

(3) For many solutions: 𝑘 = 2


1 2 3 4 −3𝑅 2 + 𝑅1
−𝑅2 + 𝑅3
1 2 0 −2
[0 0 1 |2] ⇒ [0 0 1 | 2 ]
0 0 1 2 0 0 0 0

Note that:
• A unique solution to 𝐴𝑋 = 𝐵 if and only if rref(A) has a leading 1 in every
column.
• No solution if and only if rref(𝐴|𝐵) has a leading 1 in the last column.
• In all other cases we have infinitely many solutions.

A system which has 1 or ∞ solution is called consistent. Otherwise, it is called


inconsistent.

13
Example 13
Solve the following homogeneous system of equations
1 1 3 𝑥1 0
[ −1 1 −1 ] [ 𝑥2 ] = [ 0 ]
3 −1 5 𝑥3 0
Solution
1 1 3 0 1 1 3 0 1 1 3 0
[ −1 1 −1 | 0 ] ⇒ [0 2 2 | 0] ⇒ [0 1 1 | 0]
3 −1 5 0 0 −4 −4 0 0 −4 −4 0

1 0 2 0
∴ rref(𝐴|𝐵) = [ 0 1 1 | 0 ]
0 0 0 0
i.e.
𝑥1 + 2 𝑥3 = 0
𝑥2 + 𝑥3 = 0

𝑥1 −2𝑡 −2
𝑥
∴ [ 2 ] = [ −𝑡 ] = 𝑡 [ −1 ]. (Non-trivial solution)
𝑥3 𝑡 1

Note that: The homogeneous system is always consistent.

14

You might also like