Source: algebrica.org - CC BY-NC 4.0 https://algebrica.org/cramers-rule/ Fetched from algebrica.org post 12277; source modified 2026-03-20T22:31:14.
What is Cramer’s rule?
Cramer’s Rule provides a method for solving systems of $n$ linear equations in $n$ unknowns, by using the determinant of the system’s coefficient matrix. This rule applies only when the coefficient matrix is square and its determinant is non-zero, ensuring that the system has a unique solution.
Applying Cramer’s Rule
Let us consider a general system of $n$ equations in $n$ unknowns:
We can rewrite the system using matrix notation as $A \cdot \mathbf{X} = \mathbf{B}$. The system becomes:
The constant terms and variables can be organized into two column vectors:
Suppose that the coefficient matrix $A$ is invertible, which means that its determinant is non-zero ($\det(A) \ne 0$). Under this condition, the system has a unique solution, and it can be expressed using the inverse of $A$ as:
This is the general form of Cramer’s Rule, where each $A_{ij}$ is the cofactor of the element $a_{ji}$ in the original matrix $A$.
In this context, $A_{ij}$ refers to the cofactor of the element $a_{ji}$ from the original matrix $A$, not to the entry of the matrix itself. The matrix used here is the adjugate of $A$, denoted as $\text{adj}(A)$.
The value of the unknown in position $k$ is given by a fraction. Its denominator is $\det(A)$ and its numerator is the determinant of the matrix obtained by replacing the $k$-th column of $A$ with the column of constants:
For a clearer understanding of this step, see the detailed explanation in Example 2.
Solutions of homogeneous systems
A homogeneous system is a system of linear equations where all the constant terms are zero. These systems always have at least one solution: the trivial solution, where all the variables are zero. But something interesting happens when we look at the determinant of the coefficient matrix:
- If $\det(A) \ne 0$, the system has only the trivial solution.
- If $\det(A) = 0$, the system admits infinitely many solutions, including non-trivial ones, where at least one variable is not zero.
Homogeneous systems never have no solution. They’re always consistent, but the number of solutions depends entirely on the determinant.
Example 1
Let’s consider the following homogeneous system of three equations in three unknowns:
This system can be written in matrix form as $A \cdot \mathbf{x} = \mathbf{0}$, where the coefficient matrix is:
To understand the nature of the solutions, we compute the determinant of the matrix $A$:
Since the determinant is non-zero, the system admits only the trivial solution:
This outcome aligns with Cramer’s Rule: when $\det(A) \ne 0$, the only possible solution to a homogeneous system is the trivial one, since all the determinants in the numerators of Cramer’s formula become zero.
Example 2
Let’s solve the following system of two linear equations in two unknowns:
We identify the coefficient matrix $A$, the vector of unknowns $\mathbf{x}$, and the constants vector $\mathbf{b}$:
We compute the determinant of the coefficient matrix $A$:
Since the determinant is non-zero, the system has exactly one solution, and we can apply Cramer’s rule.
We build the matrix $A_1$ by replacing the first column of $A$ with the constants:
We now build $A_2$ by replacing the second column of $A$ with the constants:
Now we compute the values of the unknowns using the formula:
The solution to the system is: