How to Find the Determinant of a Matrix Step by Step: A Complete Beginner’s Guide


How to Find the Determinant of a Matrix Step by Step: A Complete Beginner’s Guide

If you’re learning linear algebra for the first time, you’ve likely encountered determinants and wondered what they mean and how to compute them. Whether you’re dealing with a simple 2×2 matrix or larger, understanding how to find the determinant of a matrix step by step is a skill that will help you solve problems involving systems of equations, matrix inverses, eigenvalues, and more.

In this guide, we’ll walk through what a determinant is, why it matters, and several methods to calculate it, including methods for 2×2 and 3×3 matrices, cofactor expansion, and row operations. We will then demonstrate an application of determinants by solving a system of linear equations using Cramer’s Rule.

The following infographic illustrates the concepts covered in this article.

Determinants Infographic Resized. Related Article: How to Find the Determinant of a Matrix Step by Step: A Complete Beginner's Guide

What Is a Determinant?

Before we calculate determinants, it’s important to understand that a determinant is a number that summarizes certain properties of a square matrix, which we now explore.

  • Geometric Interpretation – In geometry, the determinant gives information about the area or volume scaling factor when a matrix transforms a space. For example, if you apply a 2×2 matrix to a unit square, the absolute value of the determinant tells you how the area changes. A determinant of 2 means the area doubles, and a determinant of 0 implies the transformation collapses the square entirely, and the area becomes 0.
  • Invertibility and System Solvability – One of the most valuable properties of the determinant is that it tells us whether a matrix is invertible. A matrix is invertible if and only if its determinant is nonzero. This fact is significant when solving systems of linear equations. If the determinant is zero, the system either has no solution or infinitely many solutions.

Notation

The determinant of a matrix A is written in several ways, including \( \det(A) \) and \( |A| \).

Now that we know what a determinant is and why it matters, let’s look at how to find the determinant of a matrix, starting with the simplest case, the 2×2 matrix.

How to Find the Determinant of a 2×2 Matrix

Finding the determinant of a 2×2 matrix is straightforward. The formula is

$$\begin{vmatrix}
a & b \\
c & d
\end{vmatrix}
=
ad – bc.$$

Example 1: Find the determinant of the matrices:
(a) $$\begin{bmatrix}
3 & 5 \\
2 & 4
\end{bmatrix}$$
(b) $$\begin{bmatrix}
1 & 2 \\
2 & 4
\end{bmatrix}$$

Solution: (a) $$\begin{bmatrix}
3 & 5 \\
2 & 4
\end{bmatrix}$$

Applying the formula gives

$$(3)(4) – (5)(2).$$

Simplifying we get

$$12 – 10.$$

Subtracting, we arrive at a final answer of

$$2.$$

(b) $$\begin{bmatrix}
1 & 2 \\
2 & 4
\end{bmatrix}$$

Applying the formula gives

$$(1)(4) – (2)(2).$$

Simplifying we get

$$4 – 4.$$

Subtracting, we arrive at a final answer of

$$0.$$

These examples show how quick the 2×2 determinant formula is. In the next section, we’ll explore how to extend this idea to 3×3 matrices.

How to Find the Determinant of a 3×3 Matrix

The formula for 3×3 determinants is messy. However, a simple method for computing the determinant of a 3×3 matrix provides a quick alternative to more general methods like cofactor expansion. To find the determinant of a 3×3 matrix, we rewrite the matrix by repeating the first two columns to the right of the matrix, sum the products of the three diagonals running from the top left to the bottom right, and subtract the products of the three diagonals running from the bottom left to the top right. We demonstrate this with an example.

Example 2: Find the determinant of the matrices:
(a) $$\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}$$
(b) $$\begin{bmatrix}
2 & 1 & 3 \\
0 & -1 & 4 \\
5 & 2 & 0
\end{bmatrix}$$

Solution: (a) $$\begin{bmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9
\end{bmatrix}$$

Extending the matrix gives

$$\begin{vmatrix}
1 & 2 & 3 \\
4 & 5 & 6 \\
7 & 8 & 9 \\
\end{vmatrix}
\begin{matrix}
1 & 2 \\
4 & 5 \\
7 & 8 \\
\end{matrix}.$$

Computing the determinant by summing the products of the three diagonals running from the top-left to the bottom-right and subtracting the products of the three diagonals running from the bottom-left to the top-right we obtain

$$(1)(5)(9) + (2)(6)(7) + (3)(4)(8) – (7)(5)(3) – (8)(6)(1) – (9)(4)(2).$$

Simplifying we get

$$45 + 84 + 96 – 105 – 48 – 72.$$

Adding and subtracting, we get a final answer of

$$0.$$

(b) $$\begin{bmatrix}
2 & 1 & 3 \\
0 & -1 & 4 \\
5 & 2 & 0
\end{bmatrix}$$

Extending the matrix gives

$$\begin{vmatrix}
2 & 1 & 3 \\
0 & -1 & 4 \\
5 & 2 & 0
\end{vmatrix}
\begin{matrix}
2 & 1 \\
0 & -1 \\
5 & 2
\end{matrix}.$$

Computing the determinant by summing the products of the three diagonals running from the top-left to the bottom-right and subtracting the products of the three diagonals running from the bottom-left to the top-right we obtain

$$(2)(-1)(0) + (1)(4)(5) + (3)(0)(2) – (5)(-1)(3) – (2)(4)(2) – (0)(0)(1).$$

Simplifying we get

$$0 + 20 + 0 – (-15) – 16 – 0.$$

Adding and subtracting, we arrive at a final answer of

$$19.$$

The methods introduced in this section offer a fast way to compute the determinant of any 3×3 matrix. In the next couple of sections, we’ll explore more general methods that work for larger matrices, too.

How to Find the Determinant Using Cofactor Expansion

Cofactor expansion is a method that allows you to compute the determinant of any square matrix. It works by using minors and cofactors to reduce the problem of finding the determinant of an nxn matrix into finding n determinants of (n-1) x (n-1) matrices.

Key Concepts

The minor, \( M_{ij} \), is the determinant of the matrix formed by removing row i and column j.

The cofactor, \( C_{ij} \), is defined as

$$C_{ij} = (-1)^{i+j} \cdot M_{ij}.$$

The cofactor expansion along row i is

$$\det(A) = \sum_{j=1}^n a_{ij} \cdot C_{ij}.$$

The cofactor expansion down column j is

$$\det(A) = \sum_{i=1}^n a_{ij} \cdot C_{ij}.$$

You can expand along any row or down any column. A row or column with more zeros is often a good choice.

Example

Example 3: Find the determinant of the matrices
(a) $$\begin{bmatrix}
2 & 0 & 3 \\
1 & -1 & 4 \\
5 & 2 & 0
\end{bmatrix}$$
(b) $$\begin{bmatrix}
1 & 0 & 2 & -1 \\
3 & 1 & 0 & 4 \\
5 & 0 & -2 & 2 \\
0 & 1 & 3 & -3
\end{bmatrix}$$

Solution: (a) $$\begin{bmatrix}
2 & 0 & 3 \\
1 & -1 & 4 \\
5 & 2 & 0
\end{bmatrix}$$

Expanding along row 1 gives

$$2
\begin{vmatrix}
-1 & 4 \\
2 & 0
\end{vmatrix}
-0
\begin{vmatrix}
1 & 4 \\
5 & 0
\end{vmatrix}
+
3
\begin{vmatrix}
1 & -1 \\
5 & 2
\end{vmatrix}.$$

Which simplifies to

$$2
\begin{vmatrix}
-1 & 4 \\
2 & 0
\end{vmatrix}
+
3
\begin{vmatrix}
1 & -1 \\
5 & 2
\end{vmatrix}.$$

Applying the formula for 2×2 determinants, we obtain

$$2((-1)(0) – (4)(2)) + 3((1)(2) – (-1)(5)).$$

Simplifying the expressions in parentheses gives

$$2(0 – 8) + 3(2 – (-5)).$$

Subtracting we get

$$2(-8) + 3(7).$$

Multiplying we obtain

$$-16 + 21.$$

Adding we arrive at a final answer of

$$5.$$

(b) $$\begin{bmatrix}
1 & 0 & 2 & -1 \\
3 & 1 & 0 & 4 \\
5 & 0 & -2 & 2 \\
0 & 1 & 3 & -3
\end{bmatrix}$$

Expanding down column 2 gives

$$-0
\begin{vmatrix}
3 & 0 & 4 \\
5 & -2 & 2 \\
0 & 3 & -3
\end{vmatrix}
+1
\begin{vmatrix}
1 & 2 & -1 \\
5 & -2 & 2 \\
0 & 3 & -3
\end{vmatrix}
-0
\begin{vmatrix}
1 & 2 & -1 \\
3 & 0 & 4 \\
0 & 3 & -3
\end{vmatrix}
+1
\begin{vmatrix}
1 & 2 & -1 \\
3 & 0 & 4 \\
5 & -2 & 2
\end{vmatrix}.$$

This simplifies to

$$\begin{vmatrix}
1 & 2 & -1 \\
5 & -2 & 2 \\
0 & 3 & -3
\end{vmatrix}
+
\begin{vmatrix}
1 & 2 & -1 \\
3 & 0 & 4 \\
5 & -2 & 2
\end{vmatrix}.$$

We use the methods covered in the previous section to compute the remaining determinants. Extending the matrices, we get

$$\begin{vmatrix}
1 & 2 & -1 \\
5 & -2 & 2 \\
0 & 3 & -3
\end{vmatrix}
\begin{matrix}
1 & 2 \\
5 & -2 \\
0 & 3
\end{matrix}
+
\begin{vmatrix}
1 & 2 & -1 \\
3 & 0 & 4 \\
5 & -2 & 2
\end{vmatrix}
\begin{matrix}
1 & 2 \\
3 & 0 \\
5 & -2
\end{matrix}.$$

Computing each determinant by summing the products of the three diagonals running from the top-left to the bottom-right and subtracting the products of the three diagonals running from the bottom-left to the top-right, we obtain

$$(1)(-2)(-3) + (2)(2)(0) + (-1)(5)(3) – (0)(-2)(-1) – (3)(2)(1) – (-3)(5)(2) + (1)(0)(2) + (2)(4)(5) + (-1)(3)(-2) – (5)(0)(-1) – (-2)(4)(1) – (2)(3)(2).$$

$$6 + 0 + (-15) – 0 – 6 – (-30) + 0 + 40 + 6 – 0 – (-8) – 12.$$

$$57.$$

Cofactor expansion allows you to compute determinants of matrices of any size. Choosing a row or column with more zeros can save you a lot of computation, as we have demonstrated.

How to Find the Determinant Using Row Operations

Row operations are a powerful tool in linear algebra, not only for solving systems of equations, as covered in the article How to Solve a System of Equations Using Gaussian Elimination: A Step-by-Step Guide, but also for simplifying determinant calculations. In this section, we’ll explore how to compute the determinant of a matrix by taking advantage of triangular matrices, row operations, and cofactor expansion.

Properties of Determinants and Row Operations

  • Swapping two rows changes the sign of the determinant.
  • Multiplying a row by a constant multiplies the determinant by that constant.
  • Adding a multiple of one row to another does not change the determinant.
  • The determinant of a triangular matrix} is the product of the diagonal entries.

Examples

Example 4: Find the determinant of the matrices:
(a) $$\begin{bmatrix}
2 & 1 & -3 & 4 \\
0 & 5 & 2 & -1 \\
0 & 0 & 3 & 6 \\
0 & 0 & 0 & -2
\end{bmatrix}$$
(b) $$\begin{bmatrix}
1 & 2 & 3 & 4 \\
2 & 4 & 5 & 6 \\
3 & 6 & 8 & 10 \\
4 & 5 & 6 & 7
\end{bmatrix}$$

Solution: (a) $$\begin{bmatrix}
2 & 1 & -3 & 4 \\
0 & 5 & 2 & -1 \\
0 & 0 & 3 & 6 \\
0 & 0 & 0 & -2
\end{bmatrix}$$

This matrix is triangular, so to find the determinant, we only have to take the product of the diagonal entries, which gives

$$(2)(5)(3)(-2).$$

Multiplying, we arrive at a final answer of

$$-60.$$

(b) $$\begin{bmatrix}
1 & 2 & 3 & 4 \\
2 & 4 & 5 & 6 \\
3 & 6 & 8 & 10 \\
4 & 5 & 6 & 7
\end{bmatrix}$$

Subtracting 2 times row 1 from row 2, 3 times row 1 from row 3, and 4 times row 1 from row 4, we get

$$\begin{vmatrix}
1 & 2 & 3 & 4 \\
0 & 0 & -1 & -2 \\
0 & 0 & -1 & -2 \\
0 & -3 & -6 & -9
\end{vmatrix}.$$

We now swap row 2 and row 4, noting that this will change the sign of the determinant to obtain

$$-
\begin{vmatrix}
1 & 2 & 3 & 4 \\
0 & -3 & -6 & -9 \\
0 & 0 & -1 & -2 \\
0 & 0 & -1 & -2
\end{vmatrix}.$$

We now divide row 2 by -3, and in the process multiply the determinant by -3. This gives

$$3
\begin{vmatrix}
1 & 2 & 3 & 4 \\
0 & 1 & 2 & 3 \\
0 & 0 & -1 & -2 \\
0 & 0 & -1 & -2
\end{vmatrix}.$$

We now divide row 3 by -1 and, in the process, multiply the determinant by -1. This gives

$$-3
\begin{vmatrix}
1 & 2 & 3 & 4 \\
0 & 1 & 2 & 3 \\
0 & 0 & 1 & 2 \\
0 & 0 & -1 & -2
\end{vmatrix}.$$

Adding row 3 to row 4, we get

$$-3
\begin{vmatrix}
1 & 2 & 3 & 4 \\
0 & 1 & 2 & 3 \\
0 & 0 & 1 & 2 \\
0 & 0 & 0 & 0
\end{vmatrix}.$$

This matrix is triangular, so to find the determinant, we take the product of the diagonal entries to get

$$-3(1)(1)(1)(0).$$

Multiplying gives a final answer of

$$0.$$

The next example shows how you can combine multiple techniques to compute determinants.

Example 5: Find the determinant of the matrix
$$\begin{bmatrix}
1 & 0 & 2 & -1 \\
3 & 4 & 0 & 5 \\
2 & -1 & 3 & 4 \\
0 & 2 & 1 & -2
\end{bmatrix}.$$

Solution: Subtracting 3 times row 1 from row 2 and 2 times row 1 from row 3, we get

$$\begin{vmatrix}
1 & 0 & 2 & -1 \\
0 & 4 & -6 & 8 \\
0 & -1 & -1 & 6 \\
0 & 2 & 1 & -2
\end{vmatrix}.$$

We now do a cofactor expansion down column 2, which gives

$$1
\begin{vmatrix}
4 & -6 & 8 \\
-1 & -1 & 6 \\
2 & 1 & -2
\end{vmatrix}
-0
\begin{vmatrix}
0 & 2 & -1 \\
-1 & -1 & 6 \\
2 & 1 & -2
\end{vmatrix}
+0
\begin{vmatrix}
0 & 2 & -1 \\
4 & -6 & 8 \\
2 & 1 & -2
\end{vmatrix}
-0
\begin{vmatrix}
0 & 2 & -1 \\
4 & -6 & 8 \\
-1 & -1 & 6
\end{vmatrix}.$$

This simplifies to

$$\begin{vmatrix}
4 & -6 & 8 \\
-1 & -1 & 6 \\
2 & 1 & -2
\end{vmatrix}.$$

To compute the remaining determinant, we use the methods covered in the section on 3×3 determinants. Extending the matrix, we get

$$\begin{vmatrix}
4 & -6 & 8 \\
-1 & -1 & 6 \\
2 & 1 & -2
\end{vmatrix}
\begin{matrix}
4 & -6 \\
-1 & -1 \\
2 & 1
\end{matrix}.$$

Computing the determinant by summing the products of the three diagonals running from the top-left to the bottom-right and subtracting the products of the three diagonals running from the bottom-left to the top-right, we obtain

$$(4)(-1)(-2) + (-6)(6)(2) + (8)(-1)(1) – (2)(-1)(8) – (1)(6)(4) – (-2)(-1)(-6).$$

Multiplying we get

$$8 + (-72) + (-8) – (-16) – 24 – (-12).$$

Adding and subtracting, we arrive at a final answer of

$$-68.$$

Cramer’s Rule

One application of determinants is Cramer’s Rule, a method for solving systems of linear equations. It works for systems with as many equations as unknowns.

Statement of Cramer’s Rule

Consider a system of equations in the form

$$A \vec{x} = \vec{b}.$$

If \( \det(A) \neq 0 \), the system has a unique solution given by

$$x = \frac{\det(A_x)}{\det(A)}, \quad y = \frac{\det(A_y)}{\det(A)}.$$

Where \( A_x \) is the matrix formed by replacing the first column of A with \( \vec{b} \) and \( A_y \) is the matrix formed by replacing the second column of A with \( \vec{b} \).

Example

Example 6: Solve the system using Cramer’s Rule
$$\begin{aligned}
2x + 3y &= 8 \\
4x – y &= 2
\end{aligned}.$$

Solution: In matrix form, this is
$$\begin{bmatrix}
2 & 3 \\
4 & -1
\end{bmatrix}
\begin{bmatrix}
x \\
y
\end{bmatrix}
=
\begin{bmatrix}
8 \\
2
\end{bmatrix}.$$

By Cramer’s Rule, x is

$$x = \frac{\begin{vmatrix}
8 & 3 \\
2 & -1
\end{vmatrix}}
{\begin{vmatrix}
2 & 3 \\
4 & -1
\end{vmatrix}}.$$

Using the formula for 2×2 determinants gives

$$x = \frac{(8)(-1) – (3)(2)}{(2)(-1) – (3)(4)}.$$

Multiplying we get

$$x = \frac{-8 – 6}{-2 – 12}.$$

Subtracting we find

$$x = \frac{-14}{-14}.$$

Dividing, we arrive at

$$x = 1.$$

Likewise y is

$$y = \frac{\begin{vmatrix}
2 & 8 \\
4 & 2
\end{vmatrix}}
{\begin{vmatrix}
2 & 3 \\
4 & -1
\end{vmatrix}}.$$

Applying the formula for 2×2 determinants, we obtain

$$y = \frac{(2)(2) – (8)(4)}{(2)(-1) – (3)(4)}.$$

Multiplying we find

$$y = \frac{4 – 32}{-2 – 12}.$$

Subtracting gives

$$y = \frac{-28}{-14}.$$

Dividing, we arrive at

$$y = 2.$$

Thus, our final solution is

$$x = 1, y = 2.$$

Cramer’s Rule is an elegant way to solve systems, and it shows that determinants are practical tools for solving real-world problems.

Conclusion

This guide explored several methods for how to find the determinant of a matrix step by step, including a direct method for 2×2 and 3×3 matrices, cofactor expansion for general square matrices, and row operations to simplify calculations. We also used Cramer’s Rule to solve systems of equations using determinants.

Further Reading

Beginner’s Guide to Changing Variables in Double and Triple Integrals: Everything You Need to Know – Now that you know how to calculate determinants, you now have the tools necessary to compute double and triple integrals via change of variables.

Frequently Asked Questions

No, determinants are only defined for square matrices. You cannot compute the determinant of a rectangular matrix.

Only systems with the same number of equations as unknowns can be solved using Cramer’s Rule, and only if the determinant of the coefficient matrix is nonzero. If these conditions do not hold, other methods, like Gaussian Elimination, must be used.