Home / Articles / Algebra
Algebra · 4 min read

Matrices and Determinants: A Beginner's Guide

Learn matrices and determinants from scratch: order, addition, multiplication, 2x2 and 3x3 determinants, inverses and solving equations, with worked examples.

Matrices show up early in Matric and FSc algebra, and many students find them confusing at first. The good news is that a matrix is just a neat way of arranging numbers, and the rules for working with it are few and consistent. This guide covers the basics, then shows you how to find determinants and inverses and use them to solve equations.

What Is a Matrix?

A matrix is a rectangular arrangement of numbers in rows and columns, written inside brackets. A matrix with \(m\) rows and \(n\) columns has order \(m \times n\).

$$ A = \begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix} $$

Here \(A\) has 2 rows and 2 columns, so its order is \(2 \times 2\). Each number is an element, and \(a_{ij}\) means the element in row \(i\), column \(j\). In \(A\), \(a_{21} = 1\).

Common Types of Matrices

  • Row matrix: only one row, e.g. \(\begin{bmatrix} 1 & 5 & 7 \end{bmatrix}\).
  • Column matrix: only one column.
  • Square matrix: same number of rows and columns.
  • Zero (null) matrix: every element is 0.
  • Identity matrix \(I\): a square matrix with 1s on the main diagonal and 0s elsewhere.
  • Transpose \(A^t\): formed by swapping rows and columns.

Basic Operations

Addition and Subtraction

You can add or subtract two matrices only if they have the same order. Simply add or subtract corresponding elements.

Scalar Multiplication

Multiply every element by the number. For example, \(2A = \begin{bmatrix} 6 & 4 \\ 2 & 8 \end{bmatrix}\).

Matrix Multiplication

The product \(AB\) exists only when the number of columns of \(A\) equals the number of rows of \(B\). Each element of \(AB\) is found by multiplying a row of \(A\) with a column of \(B\) and adding the results.

$$ \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix} = \begin{bmatrix} 1(5)+2(7) & 1(6)+2(8) \\ 3(5)+4(7) & 3(6)+4(8) \end{bmatrix} = \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix} $$

Remember: in general \(AB \neq BA\). Matrix multiplication is not commutative.

Determinants

The determinant is a single number attached to a square matrix. It tells you whether the matrix has an inverse.

Determinant of a 2 × 2 Matrix

$$ \left| \begin{matrix} a & b \\ c & d \end{matrix} \right| = ad - bc $$

Multiply the main diagonal, then subtract the product of the other diagonal.

Determinant of a 3 × 3 Matrix

Expand along the first row using alternating signs \(+, -, +\):

$$ \left| \begin{matrix} a & b & c \\ d & e & f \\ g & h & i \end{matrix} \right| = a(ei - fh) - b(di - fg) + c(dh - eg) $$

If the determinant is 0, the matrix is called singular and has no inverse. Otherwise it is non-singular.

Worked Example 1: Determinant and Inverse of a 2 × 2 Matrix

Find \(|A|\) and \(A^{-1}\) for \(A = \begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix}\).

Step 1: Find the determinant.

$$ |A| = (3)(4) - (2)(1) = 12 - 2 = 10 $$

Since \(|A| \neq 0\), the inverse exists.

Step 2: Find the adjoint. For a 2 × 2 matrix, swap the diagonal elements and change the signs of the other two:

$$ \text{adj}\,A = \begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix} $$

Step 3: Divide by the determinant.

$$ A^{-1} = \frac{1}{|A|}\,\text{adj}\,A = \frac{1}{10}\begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix} $$

Step 4: Check. Multiply \(A\) by \(\text{adj}\,A\):

$$ \begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix}\begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix} = \begin{bmatrix} 12-2 & -6+6 \\ 4-4 & -2+12 \end{bmatrix} = \begin{bmatrix} 10 & 0 \\ 0 & 10 \end{bmatrix} $$

Dividing by 10 gives \(I\), so the inverse is correct.

Worked Example 2: Determinant of a 3 × 3 Matrix

Evaluate

$$ \left| \begin{matrix} 2 & 1 & 3 \\ 0 & -1 & 4 \\ 1 & 2 & 1 \end{matrix} \right| $$

Step 1: Expand along the first row:

$$ = 2\left| \begin{matrix} -1 & 4 \\ 2 & 1 \end{matrix} \right| - 1\left| \begin{matrix} 0 & 4 \\ 1 & 1 \end{matrix} \right| + 3\left| \begin{matrix} 0 & -1 \\ 1 & 2 \end{matrix} \right| $$

Step 2: Evaluate each 2 × 2 minor:

  • \((-1)(1) - (4)(2) = -1 - 8 = -9\)
  • \((0)(1) - (4)(1) = -4\)
  • \((0)(2) - (-1)(1) = 1\)

Step 3: Combine:

$$ 2(-9) - 1(-4) + 3(1) = -18 + 4 + 3 = -11 $$

The determinant is \(-11\), so this matrix is non-singular.

Worked Example 3: Solving Equations with the Inverse

Solve \(3x + 2y = 8\) and \(x + 4y = 6\).

Step 1: Write in matrix form \(AX = B\):

$$ \begin{bmatrix} 3 & 2 \\ 1 & 4 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 8 \\ 6 \end{bmatrix} $$

Step 2: Use \(X = A^{-1}B\). From Example 1 we already have \(A^{-1}\):

$$ X = \frac{1}{10}\begin{bmatrix} 4 & -2 \\ -1 & 3 \end{bmatrix}\begin{bmatrix} 8 \\ 6 \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 32 - 12 \\ -8 + 18 \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 20 \\ 10 \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \end{bmatrix} $$

Step 3: Check. \(3(2) + 2(1) = 8\) and \(2 + 4(1) = 6\). So \(x = 2\), \(y = 1\).

Common Mistakes

  • Multiplying matrices of the wrong orders. Always check that columns of the first equal rows of the second.
  • Assuming \(AB = BA\). Order matters in matrix multiplication.
  • Forgetting the minus sign on the middle term when expanding a 3 × 3 determinant.
  • Swapping the wrong elements in the adjoint. Swap the diagonal, change signs of the off-diagonal.
  • Trying to find an inverse when \(|A| = 0\). A singular matrix has no inverse.

Key Takeaways

  • A matrix of order \(m \times n\) has \(m\) rows and \(n\) columns.
  • Addition needs equal orders; multiplication needs columns of the first to equal rows of the second.
  • For a 2 × 2 matrix, the determinant is \(ad - bc\); for 3 × 3, expand along a row with signs \(+, -, +\).
  • \(A^{-1} = \frac{1}{|A|}\,\text{adj}\,A\), and it exists only when \(|A| \neq 0\).
  • A system \(AX = B\) can be solved as \(X = A^{-1}B\).

Stuck on a matrix question in your textbook or assignment? Send it to Amathify on WhatsApp or through the "Ask a Question" form, and our subject experts and PhD scholars will send you a clear step-by-step solution.

Stuck on a problem or assignment?

Our experts and PhD scholars solve maths, physics and chemistry — step by step.

WhatsApp usAsk a question

Related articles