Salick Academy

Matrices and Systems of Linear Equations

No calculator

Three equations in three unknowns can be solved by elimination, but the matrix method scales, and it answers a question elimination hides: whether a unique solution exists at all.

Matrix operations

Addition, subtraction and scalar multiplication work element by element, and need matrices of the same order. Multiplication takes a row from the left and a column from the right:

(m×n)×(n×p)=(m×p)(m \times n) \times (n \times p) = (m \times p)

so two 3×33\times3 matrices multiply to give another 3×33\times3.

The identity matrix

I=(100010001)I = \begin{pmatrix} 1&0&0 \\ 0&1&0 \\ 0&0&1 \end{pmatrix}

leaves any matrix unchanged: AI=IA=AAI = IA = A. It is the matrix equivalent of the number 1, and the definition of an inverse is

AA−1=A−1A=IAA^{-1} = A^{-1}A = I

The determinant of a 3 × 3 matrix

Expand along the first row, alternating signs:

det⁡(abcdefghi)=a∣efhi∣−b∣dfgi∣+c∣degh∣\det\begin{pmatrix} a&b&c \\ d&e&f \\ g&h&i \end{pmatrix} = a\begin{vmatrix} e&f \\ h&i \end{vmatrix} - b\begin{vmatrix} d&f \\ g&i \end{vmatrix} + c\begin{vmatrix} d&e \\ g&h \end{vmatrix}

Each 2×22\times2 determinant is the minor — what remains after deleting the row and column of that element.

Find det⁡(213102418)\det\begin{pmatrix} 2&1&3 \\ 1&0&2 \\ 4&1&8 \end{pmatrix}.

=2(0×8−2×1)−1(1×8−2×4)+3(1×1−0×4)= 2(0 \times 8 - 2 \times 1) - 1(1 \times 8 - 2 \times 4) + 3(1 \times 1 - 0 \times 4) =2(−2)−1(0)+3(1)=−4+0+3=−1= 2(-2) - 1(0) + 3(1) = -4 + 0 + 3 = -1

And det⁡(123014560)\det\begin{pmatrix} 1&2&3 \\ 0&1&4 \\ 5&6&0 \end{pmatrix}:

=1(0−24)−2(0−20)+3(0−5)=−24+40−15=1= 1(0 - 24) - 2(0 - 20) + 3(0 - 5) = -24 + 40 - 15 = 1

The inverse of a 3 × 3 matrix

A−1=1det⁡A adj⁡(A)A^{-1} = \frac{1}{\det A}\,\operatorname{adj}(A)

where the adjoint is built in three steps:

  1. Replace each element by its minor.
  2. Apply the sign pattern to get the cofactor matrix.
  3. Transpose it.

For A=(123014560)A = \begin{pmatrix} 1&2&3 \\ 0&1&4 \\ 5&6&0 \end{pmatrix}, with det⁡A=1\det A = 1:

The cofactor matrix is

(−2420−518−1545−41)\begin{pmatrix} -24 & 20 & -5 \\ 18 & -15 & 4 \\ 5 & -4 & 1 \end{pmatrix}

Transposing gives the adjoint, and dividing by det⁡A=1\det A = 1 leaves

A−1=(−2418520−15−4−541)A^{-1} = \begin{pmatrix} -24 & 18 & 5 \\ 20 & -15 & -4 \\ -5 & 4 & 1 \end{pmatrix}

Check by multiplying: AA−1=IAA^{-1} = I ✓

Solving systems with matrices

x+y+z=62x−y+z=3x+2y−z=2\begin{aligned} x + y + z &= 6 \\ 2x - y + z &= 3 \\ x + 2y - z &= 2 \end{aligned}

becomes Ax=bA\mathbf{x} = \mathbf{b}:

(1112−1112−1)(xyz)=(632)\begin{pmatrix} 1&1&1 \\ 2&-1&1 \\ 1&2&-1 \end{pmatrix}\begin{pmatrix} x \\ y \\ z \end{pmatrix} = \begin{pmatrix} 6 \\ 3 \\ 2 \end{pmatrix}

Multiplying on the left by A−1A^{-1}:

x=A−1b\mathbf{x} = A^{-1}\mathbf{b}

The solution is x=1x = 1, y=2y = 2, z=3z = 3.

Check in all three equations: 1+2+3=61+2+3 = 6 ✓, 2−2+3=32-2+3 = 3 ✓, 1+4−3=21+4-3 = 2 ✓

Row reduction

For a single system, row reduction is quicker than inverting. Write the augmented matrix and use row operations to reach a triangle of zeros:

(11162−11312−12)\left(\begin{array}{ccc|c} 1&1&1&6 \\ 2&-1&1&3 \\ 1&2&-1&2 \end{array}\right)

The three legal operations are: swap two rows, multiply a row by a non-zero constant, and add a multiple of one row to another. None of them changes the solution.

R2−2R1R_2 - 2R_1 and R3−R1R_3 - R_1 give

(11160−3−1−901−2−4)\left(\begin{array}{ccc|c} 1&1&1&6 \\ 0&-3&-1&-9 \\ 0&1&-2&-4 \end{array}\right)

Then 3R3+R23R_3 + R_2 clears the last column:

(11160−3−1−900−7−21)\left(\begin{array}{ccc|c} 1&1&1&6 \\ 0&-3&-1&-9 \\ 0&0&-7&-21 \end{array}\right)

The last row reads −7z=−21-7z = -21, so z=3z = 3. Back-substituting into row 2: −3y−3=−9-3y - 3 = -9, so y=2y = 2. Then row 1 gives x=1x = 1 ✓

Consistency of a system

Situation Solutions
det⁡A≠0\det A \ne 0 exactly one
det⁡A=0\det A = 0, equations consistent infinitely many
det⁡A=0\det A = 0, equations inconsistent none

A zero determinant means the equations are not independent — one is a combination of the others. Whether that leaves infinitely many solutions or none depends on the constants.

x+y=32x+2y=6x + y = 3 \qquad 2x + 2y = 6

The second is just twice the first, so any point on the line satisfies both: infinitely many solutions.

x+y=32x+2y=7x + y = 3 \qquad 2x + 2y = 7

The left sides are still proportional, but 2(x+y)2(x+y) must be 6, not 7. The equations contradict each other: no solution.