Solving systems of linear equations with matrices

Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

About this lesson

Precalculus › Matrices

To save a PDF, choose “Save as PDF” in the print dialog.

Sources and credits

Original sedifier lesson.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits

Solving systems of linear equations with matrices

Matrices. matrices, matrix multiplication, determinant, inverse matrix, vectors, transformations

Warm-up

Three quick questions from earlier lessons.

  1. Solve the system x+y=6x + y = 6 and x−y=0x - y = 0. x=  ?x = \;?
  2. Solve the system 3x+4y=303x + 4y = 30 and 3x+2y=183x + 2y = 18. y=  ?y = \;?
  3. To solve x+7y=20x + 7y = 20 and 9x+y=209x + y = 20 by elimination, you multiply the first equation by a number and subtract the second, so that xx disappears. Which number?

Discover

To solve 5x = 20 you multiply both sides by 1/5. What does that give?

  1. x = 4
  2. x = 100

Key idea

A system is one matrix equation AX = B; X = A⁻¹B.

Write the coefficients as a matrix AA (one row per equation), the unknowns as X=(xy)X = \begin{pmatrix} x \\ y \end{pmatrix} and the constants as BB: then AX=BAX = B. If det⁡A≠0\det A \ne 0, X=A−1BX = A^{-1}B, the only solution.

Worked example

Solve 2x + y = 5, x + y = 3.

A=(2111)A = \begin{pmatrix} 2 & 1 \\ 1 & 1 \end{pmatrix}, det = 1
Matrix.
A−1=(1−1−12)A^{-1} = \begin{pmatrix} 1 & -1 \\ -1 & 2 \end{pmatrix}
Inverse.
x = 5 − 3 = 2, y = −5 + 6 = 1
Multiply.

Your turn, guided

Your turn: in that system, what is det A?

11
2 · 1 − 1 · 1.

Practice ★

  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  2. Which matrix equation represents the system 9x + 9y = 13 and 2x + 4y = 10?
    1. (9924)(xy)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    2. (9294)(xy)\begin{pmatrix} 9 & 2 \\ 9 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    3. (9924)(1310)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} 13 \\ 10 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  1. Solve the system 4x + 4y = 0 and 3x + 1y = 10 by multiplying by the inverse of the coefficient matrix. What is x?

Watch out!

Practice ★★

  1. Solve the system 4x + 4y = 0 and 3x + 1y = 10 by multiplying by the inverse of the coefficient matrix. What is x?
  2. Solve the system 4x + 1y = 20 and 1x + 1y = 5 by multiplying by the inverse of the coefficient matrix. What is x?
  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}

Exit ticket

Three questions to check you have got it.

  1. Which matrix equation represents the system 4x + 5y = 18 and 4x + 2y = 35?
    1. (4542)(xy)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    2. (4452)(xy)\begin{pmatrix} 4 & 4 \\ 5 & 2 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1835)\begin{pmatrix} 18 \\ 35 \end{pmatrix}
    3. (4542)(1835)\begin{pmatrix} 4 & 5 \\ 4 & 2 \end{pmatrix}\begin{pmatrix} 18 \\ 35 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  2. Which matrix equation represents the system 9x + 9y = 13 and 2x + 4y = 10?
    1. (9924)(xy)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    2. (9294)(xy)\begin{pmatrix} 9 & 2 \\ 9 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (1310)\begin{pmatrix} 13 \\ 10 \end{pmatrix}
    3. (9924)(1310)\begin{pmatrix} 9 & 9 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} 13 \\ 10 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}
  3. Which matrix equation represents the system 6x + 2y = 32 and 6x + 4y = 39?
    1. (6264)(xy)\begin{pmatrix} 6 & 2 \\ 6 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (3239)\begin{pmatrix} 32 \\ 39 \end{pmatrix}
    2. (6624)(xy)\begin{pmatrix} 6 & 6 \\ 2 & 4 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = (3239)\begin{pmatrix} 32 \\ 39 \end{pmatrix}
    3. (6264)(3239)\begin{pmatrix} 6 & 2 \\ 6 & 4 \end{pmatrix}\begin{pmatrix} 32 \\ 39 \end{pmatrix} = (xy)\begin{pmatrix} x \\ y \end{pmatrix}

Summary card

Systems with matrices

AX = B, so X = A⁻¹B when det A ≠ 0.

Watch out: one row per equation; multiply by A⁻¹ on the left.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. For which kk does the system kx+3y=1kx + 3y = 1, 3x+y=43x + y = 4 fail to have a unique solution?
Sources and credits

Original sedifier lesson.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits