Maths Mutt HOME

Systems of Equations

Introduction

Solving simultaneous equations is often done by elimination, but they can also be solved using matrices.

Example

\(ax + by = e\)
\(cx + dy = f\)

can be represented by:

\[ \mathbf{A}\,x = b \]

\[ \mathbf{A} = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \qquad \mathbf{x} = \begin{bmatrix} x \\ y \end{bmatrix} \qquad\text{and}\qquad \mathbf{b} = \begin{bmatrix} e \\ f \end{bmatrix} \]

Using parentheses:

\[ \mathbf{A}\mathbf{x} = \mathbf{b} \] \[ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} e \\ f \end{bmatrix} \]

This can be shortened to the augmented matrix form:

\[ \begin{bmatrix} a & b & \vdots & e \\ c & d & \vdots & f \end{bmatrix} \]

Elementary Row Operations (EROs) can then be used to reduce the matrix to upper triangular form:

\[ \begin{bmatrix} g & h & \vdots & j \\ 0 & i & \vdots & k \end{bmatrix} \]

or continue to solve fully:

\[ \begin{bmatrix} 1 & 0 & \vdots & n \\ 0 & 1 & \vdots & p \end{bmatrix} \]

Reforming the matrix gives:

\[ \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} n \\ p \end{bmatrix} \] \[ \text{so}\quad x = n \qquad y = p \]

Elementary Row Operations

  • The order of equations can be switched.
  • An equation can be multiplied by a constant.
  • Equations can be added or subtracted.
Example

\(2x + 3y = 7\)
\(3x + 4y = 6\)

Matrix form:

\[ \mathbf{A}\mathbf{x} = \mathbf{b} \] \[ \begin{bmatrix} 2 & 3 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 7 \\ 6 \end{bmatrix} \]

Augmented form:

\[ \begin{bmatrix} 2 & 3 & \vdots & 7 \\ 3 & 4 & \vdots & 6 \end{bmatrix} \] \[ \text{R1} \;\to\; \text{R2} - \text{R1} \qquad \begin{bmatrix} 1 & 1 & \vdots & -1 \\ 3 & 4 & \vdots & 6 \end{bmatrix} \] \[ \text{R2} \;\to\; \text{R2} - 3\text{R1} \qquad \begin{bmatrix} 1 & 1 & \vdots & -1 \\ 0 & 1 & \vdots & 9 \end{bmatrix} \qquad \text{Upper triangular form} \] \[ \text{R1} \;\to\; \text{R1} - \text{R2} \qquad \begin{bmatrix} 1 & 0 & \vdots & -10 \\ 0 & 1 & \vdots & 9 \end{bmatrix} \] \[ \text{solution} \] \[ \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} -10 \\ 9 \end{bmatrix} \] \[ \text{so}\quad x = -10 \qquad y = 9 \]

Gaussian Elimination

The system:

\[ \left\{ \begin{aligned} a_{11}x_{1} + a_{12}x_{2} + a_{13}x_{3} + \dots + a_{1m}x_{m} &= b_{1} \\ a_{21}x_{1} + a_{22}x_{2} + a_{23}x_{3} + \dots + a_{2m}x_{m} &= b_{2} \\ a_{31}x_{1} + a_{32}x_{2} + a_{33}x_{3} + \dots + a_{3m}x_{m} &= b_{3} \\ &\vdots \\ a_{m1}x_{1} + a_{m2}x_{2} + a_{m3}x_{3} + \dots + a_{mm}x_{m} &= b_{m} \end{aligned} \right. \]

can be written as:

Ax=b

or in augmented form:

augmented matrix

Reducing a system to upper triangular form and then back‑substituting is called Gaussian elimination.

A redundant row indicates a general solution.

An inconsistent row indicates no solution.

Large changes in the solution caused by small changes in coefficients indicate an ill‑conditionedsystem.

Example

Solve the system:

\(x + 2y + z = 14\)
\(3x - y - 4z = 7\)
\(-x + y + 3z = 2\)


\[ \begin{bmatrix} 1 & 2 & 1 \\ 3 & -1 & -4 \\ -1 & 1 & 3 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 14 \\ 7 \\ 2 \end{bmatrix} \]

Augmented form:

\[ \begin{bmatrix} 1 & 2 & 1 & \vdots & 14 \\ 3 & -1 & -4 & \vdots & 7 \\ -1 & 1 & 3 & \vdots & 2 \end{bmatrix} \] \[ \begin{aligned} \text{R2} &\to R2 - 3R1 \\ \text{R3} &\to R3 + R1 \end{aligned} \qquad \begin{bmatrix} 1 & 2 & 1 & \vdots & 14 \\ 0 & -7 & -7 & \vdots & -35 \\ 0 & 3 & 4 & \vdots & 16 \end{bmatrix} \] \[ \begin{aligned} \text{R2} &\to R2 / (-7) \\ \text{R3} &\to R3 - 3R2 \end{aligned} \qquad \begin{bmatrix} 1 & 2 & 1 & \vdots & 14 \\ 0 & 1 & 1 & \vdots & 5 \\ 0 & 0 & 1 & \vdots & 1 \end{bmatrix} \]

Back‑substitution:

Row 3 → \(z = 1\)
Row 2 → \(y + z = 5\) → \(y = 4\)
Row 1 → \(x + 2y + z = 14\) → \(x = 5\)

Alternatively, continue row reduction:

\[ \text{R2} \;\to\; R2 - R3 \qquad \begin{bmatrix} 1 & 2 & 1 & \vdots & 14 \\ 0 & 1 & 0 & \vdots & 4 \\ 0 & 0 & 1 & \vdots & 1 \end{bmatrix} \] \[ \text{R1} \;\to\; R1 - 2R2 \qquad \begin{bmatrix} 1 & 0 & 1 & \vdots & 6 \\ 0 & 1 & 0 & \vdots & 4 \\ 0 & 0 & 1 & \vdots & 1 \end{bmatrix} \] \[ \text{R1} \;\to\; R1 - R3 \qquad \begin{bmatrix} 1 & 0 & 0 & \vdots & 5 \\ 0 & 1 & 0 & \vdots & 4 \\ 0 & 0 & 1 & \vdots & 1 \end{bmatrix} \]

Solution:

\[ \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 5 \\ 4 \\ 1 \end{bmatrix} \] \[ x = 5 \qquad y = 4 \qquad z = 1 \]
Example

Solve the system:

\(2x + y - 2z = 5\)
\(3x + 2y + 5z = 5\)
\(4x + 2y - 4z = 10\)


\[ \begin{bmatrix} 2 & 1 & -2 & \vdots & 5 \\ 3 & 2 & 5 & \vdots & 5 \\ 4 & 2 & -4 & \vdots & 10 \end{bmatrix} \] \[ \begin{aligned} \text{R1} &\to R2 - R1 \\ \text{R3} &\to R3 - 2R1 \end{aligned} \qquad \begin{bmatrix} 1 & 1 & 7 & \vdots & 0 \\ 3 & 2 & 5 & \vdots & 5 \\ 0 & 0 & 0 & \vdots & 0 \end{bmatrix} \] \[ \text{row 3 indicates a general solution} \] \[ \text{R2} \;\to\; R2 - 3R1 \qquad \begin{bmatrix} 1 & 1 & 7 & \vdots & 0 \\ 0 & -1 & -16 & \vdots & 5 \\ 0 & 0 & 0 & \vdots & 0 \end{bmatrix} \] \[ \text{R1} \;\to\; R1 + R2 \qquad \begin{bmatrix} 1 & 0 & -9 & \vdots & 5 \\ 0 & -1 & -16 & \vdots & 5 \\ 0 & 0 & 0 & \vdots & 0 \end{bmatrix} \] \[ \begin{bmatrix} 1 & 0 & -9 \\ 0 & -1 & -16 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 5 \\ 5 \\ 0 \end{bmatrix} \] \[ x - 9z = 5 \qquad\qquad -\,y - 16z = 5 \] \[ \therefore\; x = 5 + 9z \qquad\qquad z = \frac{-y - 5}{16} \] \[ \therefore\; x = 5 + 9\left(\frac{-y - 5}{16}\right) \] \[ \Rightarrow\; x = 5 + \frac{-9y - 45}{16} \] \[ \Rightarrow\; x = \frac{-9y + 35}{16} \]

 

So we have

\[ x = 5 + 9z,\qquad y = -5 - 16z. \]

Letting \(z = t\) (a free parameter), the solution set is

\[ (x,y,z) = (5,-5,0) + t(9,-16,1), \quad t \in \mathbb{R}. \]

Interactive – Gaussian Elimination

Gaussian elimination can also be used to find the inverse of a matrix.

Maths Mutt logo © Alexander Forrest