Solve Systems of Equations Using Matrices

Last Updated : 7 Aug, 2025

A system of linear equations is a collection of two or more linear equations involving the same set of variables. It is a set of equations where each equation represents a straight line (or hyperplane in higher dimensions) when graphed.

The goal is to find the values for the variables that satisfy all equations simultaneously. The solution to a system of linear equations is the set of values for the variables that satisfy all equations simultaneously.

Example of Systems of Linear Equations

  • Two Equations with Two Variables:

x + 2y = 5
3x - y = 4

  • Three Equations with Three Variables

x + y + z = 6
2x - y + 3z = 14
4x + 3y + 2z = 24

Matrices are rectangular arrays of numbers, symbols, or expressions arranged in rows and columns. In the context of solving linear equations, matrices are used to represent the coefficients of the equations and manipulate them to find the solutions.

Systems of Linear Equations as Matrices

Matrix Representation of a System of Equations for the system

x + 2y = 5
3x − y = 4

The matrix form is \begin{pmatrix}1 & 2 \\3 & -1\end{pmatrix}\begin{pmatrix}x \\y\end{pmatrix}=\begin{pmatrix}5 \\4\end{pmatrix}

Augmented Matrix, The augmented matrix combines the coefficient matrix and the constants, i.e.,

\left[\begin{array}{cc|c}1 & 2 & 5 \\3 & -1 & 4\end{array}\right]

In the augmented matrix:

  • The left side represents the coefficients of the variables.
  • The right side (after the vertical line) represents the constants from the equations.

Methods to Solve a System of Equations Using Matrices

  • Gaussian Elimination: Use row operations to simplify the augmented matrix and solve by back-substitution.
  • Inverse Matrix Method: Solve using X=A−1B if the coefficient matrix is invertible.
  • Cramer’s Rule: Use determinants to find each variablex = \frac{\det(A_x)}{\det(A)}.

Steps For Solving Linear Equations Using Matrices

To solve a system of linear equations using matrices, follow these steps

Example: Solve the system using Gaussian elimination

x + y + z = 6
2x − y + 3z = 14
4x + 3y + 2z = 24

Solution:

Step 1: Form the augmented matrix.
\left[ \begin{array}{ccc|c}1 & 1 & 1 & 6 \\2 & -1 & 3 & 14 \\4 & 3 & 2 & 24\end{array} \right]

Step 2: Perform row operations to simplify.

  • R2 = R2 − 2R1

R2 = [2, -1, 3, 14] - 2 × [1, 1, 1, 6] = [2 - 2, -1 - 2, 3 - 2, 14 - 12] = [0, -3, 1, 2]

  • R3 = R3 − 4R1

R3 = [4, 3, 2, 24] - 4 × [1, 1, 1, 6] = [4 - 4, 3 - 4, 2 - 4, 24 - 24] = [0, -1, -2, 0]

  • Further simplify to row echelon form.

Step 3: Back-substitute to solve for x, y, and z.

From row 3:

-1y - 2z = 0
y + 2z = 0 (multiply by -1 to simplify)
y = -2z

Now, Solve for y in terms of z From row 2:
-3y + z = 2

Substitute y = -2z into this equation:
-3(-2z) + z = 2 ⇒ 6z + z = 2
7z = 2 ⇒ z = 2/7

Now that we have z = 2/7, substitute this into y = -2z:
y = -2 × 2/7 = -4/7

Now, Solve for x From row 1:
x + y + z = 6

Substitute y = - 4/7and z = 2/7 into this equation:
x - 4/7 + 2/7 = 6 ⇒ x - 2/7 = 6
7x - 2 = 42 ⇒ 7x = 44
x = 44/7

Step 4: Verify the solution by substituting back into the original equations.

Thus, the solution to the system is: x = 44/7, y = -4/7, z = 2/7

Solved Questions on Systems of Equations Using Matrices

Question 1: Solve the system of equations using matrices.

  • x + y = 5
  • 2x − 3y = -4

Let's solve using matrices.

Solution:

Form the Augmented Matrix:
\left[\begin{array}{cc|c}1 & 1 & 5 \\2 & -3 & -4\end{array}\right]

Row Operations:
Subtract 2×R1​ from R2​: \begin{bmatrix}1 & 1 & | & 5 \\0 & -5 & | & -14\end{bmatrix}

Back-Substitute: From R2: y = 14/5
Substitute into R1: x + y = 5,
solve for x: x + 14/5​ = 5x = 11/5

Solution: x = 11/5, y = 14/5

Question 2: Solve using the inverse matrix method.

  • 3x + 2y = 6
  • x − y = 4

Let's solve using the inverse matrix method.

Solution:

Matrix Form:
A = \begin{bmatrix}3 & 2 \\1 & -1\end{bmatrix}B = \begin{bmatrix}x \\y\end{bmatrix}C = \begin{bmatrix}6 \\4\end{bmatrix}
AB = C
Find Inverse of A:
A^{-1} = \frac{1}{\det(A)} \begin{bmatrix}-1 & -2 \\-1 & 3\end{bmatrix}=\begin{bmatrix}\frac{1}{-5} \cdot (-1) & \frac{1}{-5} \cdot (-2) \\\frac{1}{-5} \cdot (-1) & \frac{1}{-5} \cdot 3\end{bmatrix} = \begin{bmatrix}0.2 & 0.4 \\0.2 & -0.6\end{bmatrix}
Compute B = A − 1C:
B = \begin{bmatrix}0.2 & 0.4 \\0.2 & -0.6\end{bmatrix}\begin{bmatrix}6 \\4\end{bmatrix}\begin{bmatrix}0.2 \cdot 6 + 0.4 \cdot 4 \\0.2 \cdot 6 - 0.6 \cdot 4\end{bmatrix}=\begin{bmatrix}2.8 \\-1.2\end{bmatrix}

Solution: x = 2.8, y = -1.2

Question 3: Solve the system using Gaussian elimination.

Solution:

  • x + 3y = 7
  • 2x + 5y = 14

Let's solve using the Gaussian Elimination method.

Solution:

Form the Augmented Matrix:
\left[\begin{array}{cc|c}1 & 3 & 7 \\2 & 5 & 14\end{array}\right]
Row Operations:
Subtract 2×R1 from R2: \left[\begin{array}{cc|c}1 & 3 & 7 \\0 & -1 & 0\end{array}\right]
Solve for y: From R2: y = 0
​Substitute y = 0 in R1 to find x:
x + 3(0) = 7⟹x = 7

Solution: x = 7, y = 0

Question 4: Solve the system using Cramer's Rule.

  • 2x + 3y = 8
  • x − y = 1

Let's solve this with the help of Cramer's Rule.

Solution:

Form the Coefficient Matrix A and its Determinant:​
A = \begin{bmatrix}2 & 3 \\1 & -1\end{bmatrix},\text{det}(A) = (2 \cdot (-1)) - (3 \cdot 1) = -2 - 3 = -5
Calculate Determinants for x and y:
A_x = \begin{bmatrix}8 & 3 \\1 & -1\end{bmatrix},\text{det}(A_x) = (8 \cdot (-1)) - (3 \cdot 1) = -8 - 3 = -11
A_y = \begin{bmatrix}2 & 8 \\1 & 1\end{bmatrix},\text{det}(A_y) = (2 \cdot 1) - (8 \cdot 1) = 2 - 8 = -6
Apply Cramer's Rule:
x = \frac{\text{det}(A_x)}{\text{det}(A)} = \frac{-11}{-5} = 2.2,y = \frac{\text{det}(A_y)}{\text{det}(A)} = \frac{-6}{-5} = 1.2

Solution: x = 2.2, y = 1.2

Unsolved Questions on Systems of Equations Using Matrices

Question 1: Solve the following system of equations using matrices:

  • 2x+y=9
  • 3x−4y= −2

Question 2: Use the inverse matrix method to solve:

  • x+y= 4
  • 2x−3y= −1

Question 3: Solve using Cramer's Rule:

  • x+4y = 13
  • −2x+y= −1

Question 4: Solve using Gaussian Elimination:

  • 3x−y = 5
  • −6x+4y = −10
Comment

Explore