# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/matrix/matrix-determinant
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/matrix/matrix-determinant/en.mdx

Calculate order-two matrix determinants and solve linear equations using Cramer's Rule. Learn determinant formulas with worked examples and practice.

---

## Understanding Matrix Determinants

The determinant of a matrix is a scalar value (a single number) that can be calculated from the elements of a square matrix. The concept of a determinant is very important in linear algebra, one of its uses being to help solve systems of linear equations. Every square matrix has a unique determinant value.

## Calculating the Determinant of an Order-Two Matrix

A $$2 \times 2$$ order matrix is a matrix that has two rows and two columns. Suppose we have matrix $$A$$ as follows:

Visible text: A order matrix is a matrix that has two rows and two columns. Suppose we have matrix as follows:

```math
A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}
```

The determinant of matrix $$A$$, usually written as $$\det(A)$$ or $$|A|$$, is calculated by subtracting the product of the elements of the main diagonal from the product of the elements of the second diagonal.

Visible text: The determinant of matrix , usually written as or , is calculated by subtracting the product of the elements of the main diagonal from the product of the elements of the second diagonal.

The formula is:

```math
\det(A) = |A| = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc
```

Note that the notation $$\begin{vmatrix} a & b \\ c & d \end{vmatrix}$$ uses straight lines, which denote the determinant, as opposed to square brackets $$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$ which denote the matrix itself.

Visible text: Note that the notation uses straight lines, which denote the determinant, as opposed to square brackets which denote the matrix itself.

### Calculation of an Order-Two Matrix Determinant

Suppose we have matrix $$B$$:

Visible text: Suppose we have matrix :

```math
B = \begin{bmatrix} -1 & 3 \\ -7 & -5 \end{bmatrix}
```

To calculate its determinant, we identify $$a = -1$$, $$b = 3$$, $$c = -7$$, and $$d = -5$$.

Visible text: To calculate its determinant, we identify , , , and .

Then, the determinant of matrix $$B$$ is:

Visible text: Then, the determinant of matrix is:

Component: MathContainer
Children:

```math
\det(B) = (-1 \times -5) - (3 \times -7)
```

```math
\det(B) = 5 - (-21)
```

```math
\det(B) = 5 + 21
```

```math
\det(B) = 26
```

So, the determinant value of matrix $$B$$ is $$26$$.

Visible text: So, the determinant value of matrix is .

## Solving Systems of Linear Equations with Two Variables (SPLDV) using Determinants

One important application of determinants is to solve systems of linear equations. This method is often called Cramer's Rule.

Consider the following system of linear equations with two variables (SPLDV):

Component: MathContainer
Children:

```math
a_{11}x + a_{12}y = b_1
```

```math
a_{21}x + a_{22}y = b_2
```

In this system, $$x$$ and $$y$$ are the variables whose values we want to find. The coefficients $$a_{11}, a_{12}, a_{21}, a_{22}$$ and constants $$b_1, b_2$$ are known numbers.

Visible text: In this system, and are the variables whose values we want to find. The coefficients and constants are known numbers.

This system of equations can be converted into matrix multiplication form:

```math
\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \end{bmatrix}
```

The first step is to calculate the determinant of the coefficient matrix, which we call $$D$$:

Visible text: The first step is to calculate the determinant of the coefficient matrix, which we call :

```math
D = \begin{vmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{vmatrix} = a_{11}a_{22} - a_{12}a_{21}
```

A system of linear equations will have a unique solution if and only if $$D \neq 0$$.

Visible text: A system of linear equations will have a unique solution if and only if .

Next, we calculate two other determinants:

1.  $$D_x$$, which is the determinant of the coefficient
    matrix where the first column (coefficients of $$x$$) is replaced
    by the constant column ($$b_1, b_2$$
    ):

    
    
    ```math
    D_x = \begin{vmatrix} b_1 & a_{12} \\ b_2 & a_{22} \end{vmatrix} = b_1a_{22} - a_{12}b_2
    ```

2.  $$D_y$$, which is the determinant of the coefficient
    matrix where the second column (coefficients of $$y$$) is replaced
    by the constant column ($$b_1, b_2$$
    ):

    
    
    ```math
    D_y = \begin{vmatrix} a_{11} & b_1 \\ a_{21} & b_2 \end{vmatrix} = a_{11}b_2 - b_1a_{21}
    ```

Visible text: 1. , which is the determinant of the coefficient
 matrix where the first column (coefficients of ) is replaced
 by the constant column (
 ):

 
 

2. , which is the determinant of the coefficient
 matrix where the second column (coefficients of ) is replaced
 by the constant column (
 ):

After obtaining the values of $$D$$, $$D_x$$, and $$D_y$$, we can find the values of $$x$$ and $$y$$ using the formulas:

Visible text: After obtaining the values of , , and , we can find the values of and using the formulas:

Component: MathContainer
Children:

```math
x = \frac{D_x}{D}
```

```math
y = \frac{D_y}{D}
```

These formulas are only valid if $$D \neq 0$$.

Visible text: These formulas are only valid if .

### Solving SPLDV with Determinants

Determine the solution of the following system of linear equations:

Component: MathContainer
Children:

```math
2x - y = 7
```

```math
x - 4y = 14
```

From the system above, we get:

$$a_{11} = 2$$, $$a_{12} = -1$$, $$b_1 = 7$$

Visible text: , ,

$$a_{21} = 1$$, $$a_{22} = -4$$, $$b_2 = 14$$

Visible text: , ,

**Step** $$1$$: Calculate the determinant $$D$$.

Visible text: **Step** : Calculate the determinant .

```math
D = \begin{vmatrix} 2 & -1 \\ 1 & -4 \end{vmatrix} = (2 \times -4) - (-1 \times 1) = -8 - (-1) = -8 + 1 = -7
```

Since $$D = -7 \neq 0$$, this system has a unique solution.

Visible text: Since , this system has a unique solution.

**Step** $$2$$: Calculate the determinant $$D_x$$.

Visible text: **Step** : Calculate the determinant .

```math
D_x = \begin{vmatrix} 7 & -1 \\ 14 & -4 \end{vmatrix} = (7 \times -4) - (-1 \times 14) = -28 - (-14) = -28 + 14 = -14
```

**Step** $$3$$: Calculate the determinant $$D_y$$.

Visible text: **Step** : Calculate the determinant .

```math
D_y = \begin{vmatrix} 2 & 7 \\ 1 & 14 \end{vmatrix} = (2 \times 14) - (7 \times 1) = 28 - 7 = 21
```

**Step** $$4$$: Calculate the values of $$x$$ and $$y$$.

Visible text: **Step** : Calculate the values of and .

Component: MathContainer
Children:

```math
x = \frac{D_x}{D} = \frac{-14}{-7} = 2
```

```math
y = \frac{D_y}{D} = \frac{21}{-7} = -3
```

So, the solution set of the system of linear equations is $$x=2$$ and $$y=-3$$, or can be written as the ordered pair $$(2, -3)$$.

Visible text: So, the solution set of the system of linear equations is and , or can be written as the ordered pair .

## Exercises

1.  Given matrix $$M = \begin{bmatrix} 9 & x \\ 8 & -7 \end{bmatrix}$$ and $$\det(M) = 9$$. Determine the value of $$x$$.
2.  Determine the solution of the following system of linear equations:

    
    
    ```math
    \begin{cases} 2x - y = 8 \\ x + 3y = -10 \end{cases}
    ```

Visible text: 1. Given matrix and . Determine the value of .
2. Determine the solution of the following system of linear equations:

### Answer Key

1.  For matrix $$M = \begin{bmatrix} 9 & x \\ 8 & -7 \end{bmatrix}$$, its determinant is:

    
    
    ```math
    \det(M) = (9 \times -7) - (x \times 8) = -63 - 8x
    ```

    Given $$\det(M) = 9$$, then:

    <MathContainer>
      
    
    ```math
    -63 - 8x = 9
    ```

      
    
    ```math
    -8x = 9 + 63
    ```

      
    
    ```math
    -8x = 72
    ```

      
    
    ```math
    x = \frac{72}{-8}
    ```

      
    
    ```math
    x = -9
    ```

    </MathContainer>

    So, the value of $$x$$ is $$-9$$.

2.  System of linear equations:

    <MathContainer>
      
    
    ```math
    2x - y = 8
    ```

      
    
    ```math
    x + 3y = -10
    ```

    </MathContainer>

    We determine $$D, D_x,$$ and $$D_y$$.

    <MathContainer>
      
    
    ```math
    D = \begin{vmatrix} 2 & -1 \\ 1 & 3 \end{vmatrix} = (2 \times 3) - (-1 \times 1) = 6 - (-1) = 6 + 1 = 7
    ```

      
    
    ```math
    D_x = \begin{vmatrix} 8 & -1 \\ -10 & 3 \end{vmatrix} = (8 \times 3) - (-1 \times -10) = 24 - 10 = 14
    ```

      
    
    ```math
    D_y = \begin{vmatrix} 2 & 8 \\ 1 & -10 \end{vmatrix} = (2 \times -10) - (8 \times 1) = -20 - 8 = -28
    ```

    </MathContainer>

    Then, the values of $$x$$ and $$y$$ are:

    <MathContainer>
      
    
    ```math
    x = \frac{D_x}{D} = \frac{14}{7} = 2
    ```

      
    
    ```math
    y = \frac{D_y}{D} = \frac{-28}{7} = -4
    ```

    </MathContainer>

    So, the solution of the system of linear equations is $$x=2$$ and $$y=-4$$, or the ordered pair $$(2, -4)$$.

Visible text: 1. For matrix , its determinant is:

 
 

 Given , then:

 <MathContainer>
 
 

 
 

 
 

 
 

 
 

 </MathContainer>

 So, the value of is .

2. System of linear equations:

 <MathContainer>
 
 

 
 

 </MathContainer>

 We determine and .

 <MathContainer>
 
 

 
 

 
 

 </MathContainer>

 Then, the values of and are:

 <MathContainer>
 
 

 
 

 </MathContainer>

 So, the solution of the system of linear equations is and , or the ordered pair .