Cramer's Rule

Cramer's rule is a theorem in linear algebra that provides an explicit solution for a system of linear equations with a unique solution using determinants. This algebraic method states that the numerical value of each variable is found by dividing two determinants: the determinant of a modified matrix by the determinant of the original coefficient matrix.

For Cramer's method to be applicable to a system of linear equations, two mandatory conditions must be satisfied:

  1. The system must be square: The number of equations must exactly equal the number of variables (n × n).
  2. The coefficient determinant must be nonzero: The coefficient matrix associated with the system must be nonsingular (invertible); that is, its determinant \(\Delta\) cannot be zero (\(\Delta \neq 0\)).

In the study of matrices and linear systems, the determinant of a matrix A is commonly denoted either using the functional notation det(A) or by enclosing its entries between vertical bars, as |A|. Throughout this guide, we use vertical bars for compactness and visual clarity when writing out operations.

Cramer's Rule Formulas

To apply Cramer's rule, we begin by analyzing small systems of two and three equations where the substitution mechanism is clearly visible, and then extend the analytical formulation to the general case of any dimension.

2×2 Systems of Linear Equations

Consider a standard linear system of two equations with two variables, where we denote the coefficients of the variables using the first letters of the alphabet and highlight the constant terms in red:

$$\begin{cases} ax + by = {\color{red}e} \\ cx + dy = {\color{red}f} \end{cases}$$

The first step is to compute the determinant of the coefficient matrix, denoted as \(\Delta\), which is constructed by arranging only the numerical coefficients of the variables in their original positions:

$$\Delta = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$$

Next, we compute the determinants associated with each variable. To do this, we replace the column corresponding to that variable in \(\Delta\) with the column of constant terms, while keeping the coefficients in the other columns unchanged:

For the variable \(x\), we replace the first column:

$$\Delta_x = \begin{vmatrix} {\color{red}e} & b \\ {\color{red}f} & d \end{vmatrix} = {\color{red}e}d - b{\color{red}f}$$

For the variable \(y\), we replace the second column:

$$\Delta_y = \begin{vmatrix} a & {\color{red}e} \\ c & {\color{red}f} \end{vmatrix} = a{\color{red}f} - {\color{red}e}c$$

Provided that the condition \(\Delta \neq 0\) holds, the explicit solution to the system is obtained by dividing each variable determinant by the coefficient determinant:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{{\color{red}e}d - b{\color{red}f}}{ad - bc}$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{a{\color{red}f} - {\color{red}e}c}{ad - bc}$$

3×3 Systems of Linear Equations

In a system of three linear equations with three variables, we use numerical subscripts per equation to directly associate each coefficient with its corresponding variable (\(a_i\) for \(x\), \(b_i\) for \(y\), and \(c_i\) for \(z\)):

$$\begin{cases} a_1 x + b_1 y + c_1 z = {\color{red}d_1} \\ a_2 x + b_2 y + c_2 z = {\color{red}d_2} \\ a_3 x + b_3 y + c_3 z = {\color{red}d_3} \end{cases}$$

The coefficient determinant gathers the coefficients of all three variables arranged in rows and columns:

$$\Delta = \begin{vmatrix} a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \\ a_3 & b_3 & c_3 \end{vmatrix}$$

Following the same substitution rule, we obtain the determinants for each variable by successively replacing the respective column with the column of constant terms:

$$\Delta_x = \begin{vmatrix} {\color{red}d_1} & b_1 & c_1 \\ {\color{red}d_2} & b_2 & c_2 \\ {\color{red}d_3} & b_3 & c_3 \end{vmatrix}, \qquad \Delta_y = \begin{vmatrix} a_1 & {\color{red}d_1} & c_1 \\ a_2 & {\color{red}d_2} & c_2 \\ a_3 & {\color{red}d_3} & c_3 \end{vmatrix}, \qquad \Delta_z = \begin{vmatrix} a_1 & b_1 & {\color{red}d_1} \\ a_2 & b_2 & {\color{red}d_2} \\ a_3 & b_3 & {\color{red}d_3} \end{vmatrix}$$

Provided that the coefficient determinant is nonzero \(\Delta \neq 0\), the values of the variables are determined by the following ratios:

$$x = \dfrac{\Delta_x}{\Delta}, \qquad y = \dfrac{\Delta_y}{\Delta}, \qquad z = \dfrac{\Delta_z}{\Delta}$$

Unlike the second-order case, where evaluation simplifies to subtracting cross products, 3×3 determinants can be evaluated using two standard procedures:

  • Sarrus's rule (the diagonal method): Involves adding and subtracting the products formed along the main and secondary diagonals after recopying the first two rows or columns below or beside the matrix.
  • Cofactor expansion (Laplace expansion): Involves expanding the determinant into linear combinations of 2×2 minor determinants along a chosen row or column.

Both methods yield the exact same numerical result, and in the worked examples we use both to demonstrate when one approach is preferable over the other.

General Case (n×n)

Any system of \(n\) linear equations with \(n\) variables can be expressed compactly as a single matrix equation:

$$A \mathbf{x} = \mathbf{b}$$

In this formulation, \(A\) represents the \(n \times n\) square coefficient matrix, the column vector \(\mathbf{x}\) contains the variables of the system, and the column vector \(\mathbf{b}\) contains the constant terms:

$$A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{pmatrix}, \qquad \mathbf{x} = \begin{pmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{pmatrix}, \qquad \mathbf{b} = \begin{pmatrix} {b_1} \\ {b_2} \\ \vdots \\ {b_n} \end{pmatrix}$$

Cramer's theorem states that if the coefficient matrix has a nonzero determinant (\(|A| \neq 0\)), each variable \(x_i\) in the system is uniquely determined by the relation:

$$x_i = \dfrac{|A_i|}{|A|} = \dfrac{\Delta_i}{\Delta}$$

Where \(A_i\) is the matrix formed by replacing column \(i\) of matrix \(A\) with the vector of constants \(\mathbf{b}\). For convenience, the determinant of the coefficient matrix \(|A|\) is commonly written as \(\Delta\), while the determinant of the modified matrix \(|A_i|\) is abbreviated as \(\Delta_i\) (or \(\Delta_x, \Delta_y, \Delta_z\) depending on the variable being evaluated). This equation summarizes the analytical nature of the method, showing that the solution to any regular square linear system can be expressed directly as the quotient of two determinants.

Step-by-Step Examples

To master how Cramer's rule works in practice, let us examine the complete solution to two linear systems.

Example: 2×2 System

Solve the following linear system using Cramer's rule:

$$\begin{cases} 2x + 3y = {\color{red}13} \\ 5x - y = {\color{red}7} \end{cases}$$

Solution

First, we calculate the coefficient determinant \(\Delta\) using the coefficients of the variables, taking the cross product of the main diagonal minus the cross product of the secondary diagonal:

$$\Delta = \begin{vmatrix} 2 & 3 \\ 5 & -1 \end{vmatrix} = (2)(-1) - (3)(5) = -2 - 15 = -17$$

Since \(\Delta \neq 0\), the system has a unique solution. We proceed to calculate the determinant \(\Delta_x\) by replacing the first column with the constant terms:

$$\Delta_x = \begin{vmatrix} {\color{red}13} & 3 \\ {\color{red}7} & -1 \end{vmatrix} = ({\color{red}13})(-1) - (3)({\color{red}7}) = -13 - 21 = -34$$

Similarly, we compute the determinant \(\Delta_y\) by replacing the coefficients of the second column with the constant terms:

$$\Delta_y = \begin{vmatrix} 2 & {\color{red}13} \\ 5 & {\color{red}7} \end{vmatrix} = (2)({\color{red}7}) - ({\color{red}13})(5) = 14 - 65 = -51$$

We apply Cramer's rule formulas to determine the value of each variable:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{-34}{-17} = 2$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-51}{-17} = 3$$

The solution to the system is the ordered pair \((x, y) = (2, 3)\). To verify this result, substitute both values back into the original equations:

  • In the first equation: \(2(2) + 3(3) = 4 + 9 = 13\).
  • In the second equation: \(5(2) - (3) = 10 - 3 = 7\).

Both equations are satisfied simultaneously.

Example: 3×3 System

Solve the following system of three linear equations with three variables:

$$\begin{cases} x + y + z = {\color{red}6} \\ 2x - y + z = {\color{red}3} \\ x + 2y - z = {\color{red}2} \end{cases}$$

Solution

Set up the coefficient determinant \(\Delta\) using the coefficients of \(x\), \(y\), and \(z\):

$$\Delta = \begin{vmatrix} 1 & 1 & 1 \\ 2 & -1 & 1 \\ 1 & 2 & -1 \end{vmatrix}$$

To evaluate this determinant, we apply Sarrus's rule by rewriting the first two rows beneath the original matrix:

$$\begin{matrix} 1 & 1 & 1 \\ 2 & -1 & 1 \\ 1 & 2 & -1 \\ \hline 1 & 1 & 1 \\ 2 & -1 & 1 \end{matrix}$$

Add the products along the three downward diagonals and subtract the products along the three upward diagonals:

$$\text{Downward sum} = (1)(-1)(-1) + (2)(2)(1) + (1)(1)(1) = 1 + 4 + 1 = 6$$

$$\text{Upward sum} = (1)(-1)(1) + (1)(2)(1) + (2)(1)(-1) = -1 + 2 - 2 = -1$$

Subtract the upward sum from the downward sum to obtain the determinant of the system:

$$\Delta = 6 - (-1) = 6 + 1 = 7$$

Because \(\Delta \neq 0\), the system has a unique solution. We set up the variable determinants by successively replacing each column with the column of constant terms shown in red:

For the variable \(x\), replace the first column:

$$\Delta_x = \begin{vmatrix} {\color{red}6} & 1 & 1 \\ {\color{red}3} & -1 & 1 \\ {\color{red}2} & 2 & -1 \end{vmatrix} = 7$$

For the variable \(y\), replace the second column:

$$\Delta_y = \begin{vmatrix} 1 & {\color{red}6} & 1 \\ 2 & {\color{red}3} & 1 \\ 1 & {\color{red}2} & -1 \end{vmatrix} = 14$$

For the variable \(z\), replace the third column:

$$\Delta_z = \begin{vmatrix} 1 & 1 & {\color{red}6} \\ 2 & -1 & {\color{red}3} \\ 1 & 2 & {\color{red}2} \end{vmatrix} = 21$$

Divide each determinant by the coefficient determinant of the system:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{7}{7} = 1$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{14}{7} = 2$$

$$z = \dfrac{\Delta_z}{\Delta} = \dfrac{21}{7} = 3$$

The solution is the ordered triple \((x, y, z) = (1, 2, 3)\), which satisfies all three equations in the system.

Classifying Systems of Equations Using Determinants

The values of the coefficient determinant \(\Delta\) and the variable determinants provide insight into the nature of the solution to a linear system. However, the analytical scope of this classification differs significantly depending on the dimension of the problem.

To summarize how calculated determinants correspond to the nature of the solutions, consider the following cases:

Determinant ConditionSystem DimensionType of SystemConclusion via Cramer's Rule
\(\Delta \neq 0\)Any dimension
(\(n \times n\))
Consistent and independentUnique solution given by \(x_i = \dfrac{\Delta_i}{\Delta}\).
\(\Delta = 0\) and at least one \(\Delta_i \neq 0\)Any dimension
(\(n \times n\))
InconsistentThe system has no solution (inconsistency due to division by zero).
\(\Delta = 0\) and all \(\Delta_i = 0\)2×2 systemsConsistent and dependentInfinitely many solutions representing coincident lines (excluding degenerate contradictory cases).
\(\Delta = 0\) and all \(\Delta_i = 0\)3×3 systems or higherInconclusive via CramerThe method does not provide enough information. The system may have infinitely many solutions or no solution.

When \(\Delta = 0\) and all variable determinants also equal zero in systems of order 3 or higher, Cramer's rule reaches its operational limit and fails to provide a definitive diagnosis.

To definitively resolve these cases in dimensions greater than 2×2, it is necessary to move beyond determinants and turn to more general tools from linear algebra:

  • Gaussian elimination: Row reduces the augmented matrix of the system using elementary row operations to immediately reveal whether an inconsistent row of the form \(0 = k\) occurs (inconsistent system) or free variables arise (consistent and dependent system).
  • The Rouché-Capelli theorem (rank comparison): Formally determines consistency by comparing the rank of the coefficient matrix with the rank of the augmented matrix.

Worked Examples

To reinforce your understanding and master the algebraic steps commonly encountered on exams, here is a collection of step-by-step worked examples arranged by level of difficulty and matrix dimension.

2×2 Systems of Linear Equations

Example 1

Find the solution set of the following linear system using Cramer's rule:

$$\begin{cases} 3x + 2y - 11 = 0 \\ 7x - 4y = 9 \end{cases}$$

Solution

Before setting up the matrix arrays, rewrite the equations in standard form \(ax + by = c\). In the first equation, the constant term is on the left-hand side, so we move it to the right-hand side with the opposite sign (adding 11 to both sides) to avoid errors when identifying the constants:

$$\begin{cases} 3x + 2y = 11 \\ 7x - 4y = 9 \end{cases}$$

With the equations aligned, construct and evaluate the coefficient determinant \(\Delta\) using the coefficients of the variables:

$$\Delta = \begin{vmatrix} 3 & 2 \\ 7 & -4 \end{vmatrix} = (3)(-4) - (2)(7) = -12 - 14 = -26$$

Since \(\Delta \neq 0\), the system has a unique solution. Set up the determinant \(\Delta_x\) by replacing the first column with the constant terms:

$$\Delta_x = \begin{vmatrix} 11 & 2 \\ 9 & -4 \end{vmatrix} = (11)(-4) - (2)(9) = -44 - 18 = -62$$

Construct the determinant \(\Delta_y\) by placing the constant terms in the second column:

$$\Delta_y = \begin{vmatrix} 3 & 11 \\ 7 & 9 \end{vmatrix} = (3)(9) - (11)(7) = 27 - 77 = -50$$

Calculate the values of the variables by dividing each specific determinant by the coefficient determinant and simplifying the resulting fractions:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{-62}{-26} = \dfrac{31}{13}$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-50}{-26} = \dfrac{25}{13}$$

The solution is the ordered pair \((x, y) = \left(\dfrac{31}{13}, \dfrac{25}{13}\right)\). Obtaining irreducible fractions does not imply a calculation error; many linear systems in academic coursework result in rational values rather than integers.

If you are working through problems and want to verify your results, you can use our free tool:

Example 2

Find the values of \(x\) and \(y\) that satisfy the following system of linear equations:

$$\begin{cases} 2x - 5y = -4 \\ 3y + 4x = 18 \end{cases}$$

Solution

Inspecting the second equation shows that the variables appear in reverse order relative to the first equation. Extracting coefficients without rearranging them would place the coefficient of \(y\) into the \(x\) column, invalidating the computation. Rearrange the terms vertically:

$$\begin{cases} 2x - 5y = -4 \\ 4x + 3y = 18 \end{cases}$$

Evaluate the coefficient determinant \(\Delta\), paying close attention to signs when multiplying across the secondary diagonal:

$$\Delta = \begin{vmatrix} 2 & -5 \\ 4 & 3 \end{vmatrix} = (2)(3) - (-5)(4) = 6 - (-20) = 6 + 20 = 26$$

Now evaluate \(\Delta_x\) by substituting the column of \(x\) coefficients with the constant terms:

$$\Delta_x = \begin{vmatrix} -4 & -5 \\ 18 & 3 \end{vmatrix} = (-4)(3) - (-5)(18) = -12 - (-90) = -12 + 90 = 78$$

Form \(\Delta_y\) by placing the constant terms into the second column:

$$\Delta_y = \begin{vmatrix} 2 & -4 \\ 4 & 18 \end{vmatrix} = (2)(18) - (-4)(4) = 36 - (-16) = 36 + 16 = 52$$

Find the components of the solution by taking the ratios of the determinants:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{78}{26} = 3$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{52}{26} = 2$$

The final solution is the ordered pair \((x, y) = (3, 2)\).

Example 3

Solve the following system with rational coefficients using the determinant method:

$$\begin{cases} \dfrac{1}{2}x + \dfrac{3}{4}y = 3 \\\\ \dfrac{2}{3}x - \dfrac{1}{4}y = 1 \end{cases}$$

Solution

When working with fractional coefficients, two equivalent strategies exist: multiply each equation by the least common denominator of its terms to obtain integer coefficients, or compute the determinants directly using fractions. Both approaches are valid and yield the same result. Here, we compute directly with the fractions to practice rational arithmetic.

Set up the system determinant and subtract the product of its diagonals:

$$\Delta = \begin{vmatrix} \dfrac{1}{2} & \dfrac{3}{4} \\\\ \dfrac{2}{3} & -\dfrac{1}{4} \end{vmatrix} = \left(\dfrac{1}{2}\right)\left(-\dfrac{1}{4}\right) - \left(\dfrac{3}{4}\right)\left(\dfrac{2}{3}\right) = -\dfrac{1}{8} - \dfrac{6}{12}= -\dfrac{5}{8}$$

Since \(\Delta \neq 0\), proceed to compute \(\Delta_x\) by replacing the first column:

$$\Delta_x = \begin{vmatrix} 3 & \dfrac{3}{4} \\\\ 1 & -\dfrac{1}{4} \end{vmatrix} = (3)\left(-\dfrac{1}{4}\right) - \left(\dfrac{3}{4}\right)(1) = -\dfrac{3}{4} - \dfrac{3}{4} = -\dfrac{6}{4} = -\dfrac{3}{2}$$

Set up \(\Delta_y\) by replacing the second column:

$$\Delta_y = \begin{vmatrix} \dfrac{1}{2} & 3 \\\\ \dfrac{2}{3} & 1 \end{vmatrix} = \left(\dfrac{1}{2}\right)(1) - (3)\left(\dfrac{2}{3}\right) = \dfrac{1}{2} - 2 = \dfrac{1}{2} - \dfrac{4}{2} = -\dfrac{3}{2}$$

Solve for each variable by dividing the fractions (multiplying by the reciprocal of the denominator):

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{-\dfrac{3}{2}}{-\dfrac{5}{8}} = \left(-\dfrac{3}{2}\right) \cdot \left(-\dfrac{8}{5}\right) = \dfrac{24}{10} = \dfrac{12}{5}$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-\dfrac{3}{2}}{-\dfrac{5}{8}} = \left(-\dfrac{3}{2}\right) \cdot \left(-\dfrac{8}{5}\right) = \dfrac{24}{10} = \dfrac{12}{5}$$

The solution is \((x, y) = \left(\dfrac{12}{5}, \dfrac{12}{5}\right)\).

Example 4

Analyze and solve the following system of equations using Cramer's rule:

$$\begin{cases} 2x - 6y = 5 \\ -x + 3y = 4 \end{cases}$$

Solution

Start by evaluating the coefficient determinant \(\Delta\) of the system:

$$\Delta = \begin{vmatrix} 2 & -6 \\ -1 & 3 \end{vmatrix} = (2)(3) - (-6)(-1) = 6 - 6 = 0$$

Because the coefficient determinant is zero, we cannot divide to obtain a unique solution. To determine whether the system has no solution or infinitely many solutions, compute the determinant \(\Delta_x\):

$$\Delta_x = \begin{vmatrix} 5 & -6 \\ 4 & 3 \end{vmatrix} = (5)(3) - (-6)(4) = 15 - (-24) = 15 + 24 = 39$$

Because \(\Delta = 0\) and \(\Delta_x \neq 0\), the quotient \(x = \dfrac{\Delta_x}{\Delta} = \dfrac{39}{0}\) is undefined. We conclude that the system is inconsistent (has no solution), which geometrically represents two parallel, distinct lines in the plane.

Example 5

Examine the consistency of the following linear system using Cramer's rule:

$$\begin{cases} x - 2y = 3 \\ -2x + 4y = -6 \end{cases}$$

Solution

First, evaluate the determinant of the coefficient matrix:

$$\Delta = \begin{vmatrix} 1 & -2 \\ -2 & 4 \end{vmatrix} = (1)(4) - (-2)(-2) = 4 - 4 = 0$$

Since \(\Delta = 0\), evaluate the determinants for both variables:

$$\Delta_x = \begin{vmatrix} 3 & -2 \\ -6 & 4 \end{vmatrix} = (3)(4) - (-2)(-6) = 12 - 12 = 0$$

$$\Delta_y = \begin{vmatrix} 1 & 3 \\ -2 & -6 \end{vmatrix} = (1)(-6) - (3)(-2) = -6 - (-6) = -6 + 6 = 0$$

In 2×2 linear systems with non-degenerate equations, the simultaneous condition \(\Delta = 0\), \(\Delta_x = 0\), and \(\Delta_y = 0\) indicates that the two equations are multiples of each other (the second equation is \(-2\) times the first). Consequently, both equations represent the exact same line in the coordinate plane. The system is consistent and dependent, possessing infinitely many solutions.

3×3 Systems of Linear Equations

Example 6

Solve the following linear system:

$$\begin{cases} \frac{1}{3}x + y + z = 2 \\ 2x - y + z = 9 \\ x + 2y - z = -1 \end{cases}$$

Solution

To avoid dealing with fractions inside the matrix arrays, multiply the entire first equation by 3. This gives an equivalent system with integer coefficients:

$$\begin{cases} x + 3y + 3z = 6 \\ 2x - y + z = 9 \\ x + 2y - z = -1 \end{cases}$$

Set up the coefficient determinant \(\Delta\). To compute its value, use cofactor expansion along the entries of the first row. This expands the 3×3 determinant into a linear combination of three 2×2 minor determinants, using alternating signs \(+ - +\):

$$\Delta = \begin{vmatrix} 1 & 3 & 3 \\ 2 & -1 & 1 \\ 1 & 2 & -1 \end{vmatrix} = 1 \cdot \begin{vmatrix} -1 & 1 \\ 2 & -1 \end{vmatrix} - 3 \cdot \begin{vmatrix} 2 & 1 \\ 1 & -1 \end{vmatrix} + 3 \cdot \begin{vmatrix} 2 & -1 \\ 1 & 2 \end{vmatrix}$$

Evaluate each 2×2 minor determinant:

$$\begin{vmatrix} -1 & 1 \\ 2 & -1 \end{vmatrix} = (-1)(-1) - (1)(2) = 1 - 2 = -1$$

$$\begin{vmatrix} 2 & 1 \\ 1 & -1 \end{vmatrix} = (2)(-1) - (1)(1) = -2 - 1 = -3$$

$$\begin{vmatrix} 2 & -1 \\ 1 & 2 \end{vmatrix} = (2)(2) - (-1)(1) = 4 - (-1) = 4 + 1 = 5$$

Substitute these values to compute \(\Delta\):

$$\Delta = 1(-1) - 3(-3) + 3(5) = -1 + 9 + 15 = 23$$

Since \(\Delta \neq 0\), the system has a unique solution. Set up the determinant for each variable by replacing the corresponding column with the constant terms \((6, 9, -1)\):

$$\Delta_x = \begin{vmatrix} 6 & 3 & 3 \\ 9 & -1 & 1 \\ -1 & 2 & -1 \end{vmatrix} = 69$$

$$\Delta_y = \begin{vmatrix} 1 & 6 & 3 \\ 2 & 9 & 1 \\ 1 & -1 & -1 \end{vmatrix} = -23$$

$$\Delta_z = \begin{vmatrix} 1 & 3 & 6 \\ 2 & -1 & 9 \\ 1 & 2 & -1 \end{vmatrix} = 46$$

Calculate the values of the variables by dividing each determinant by the coefficient determinant:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{69}{23} = 3$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-23}{23} = -1$$

$$z = \dfrac{\Delta_z}{\Delta} = \dfrac{46}{23} = 2$$

The solution is the ordered triple \((x, y, z) = (3, -1, 2)\).

Example 7

Determine the consistency of the following system of three linear equations with three variables:

$$\begin{cases} x + 2y - z = 4 \\ 2x + 4y - 2z = 5 \\ 3x - y + 2z = 1 \end{cases}$$

Solution

Set up and evaluate the coefficient determinant \(\Delta\):

$$\Delta = \begin{vmatrix} 1 & 2 & -1 \\ 2 & 4 & -2 \\ 3 & -1 & 2 \end{vmatrix}$$

Notice that the coefficients in the second row are exactly twice the coefficients in the first row (\(2 = 2 \cdot 1\), \(4 = 2 \cdot 2\), \(-2 = 2 \cdot (-1)\)). By determinant properties, if two rows are proportional, the determinant is zero:

$$\Delta = 0$$

To determine if the system has no solution, evaluate the determinant for \(x\) by replacing the first column with the constant terms:

$$\Delta_x = \begin{vmatrix} 4 & 2 & -1 \\ 5 & 4 & -2 \\ 1 & -1 & 2 \end{vmatrix}$$

Expand along the first row using cofactors:

$$\Delta_x = 4 \cdot \begin{vmatrix} 4 & -2 \\ -1 & 2 \end{vmatrix} - 2 \cdot \begin{vmatrix} 5 & -2 \\ 1 & 2 \end{vmatrix} + (-1) \cdot \begin{vmatrix} 5 & 4 \\ 1 & -1 \end{vmatrix}$$

$$\Delta_x = 4(8 - 2) - 2(10 - (-2)) - 1(-5 - 4) = 4(6) - 2(12) - 1(-9) = 24 - 24 + 9 = 9$$

Since \(\Delta = 0\) and \(\Delta_x = 9 \neq 0\), the system admits no solution. We conclude that this is an inconsistent system.

Example 8

Find the values of \(x\), \(y\), and \(z\) for the following linear system:

$$\begin{cases} 2x - y + z = 1 \\ x + y + 2z = 3 \\ 3x + y - z = 2 \end{cases}$$

Solution

Compute the determinant of the coefficient matrix:

$$\Delta = \begin{vmatrix} 2 & -1 & 1 \\ 1 & 1 & 2 \\ 3 & 1 & -1 \end{vmatrix} = -15$$

Because \(\Delta \neq 0\), the system is guaranteed to have a unique solution. Evaluate the variable determinants by replacing the respective columns with the vector of constants \((1, 3, 2)\):

$$\Delta_x = \begin{vmatrix} 1 & -1 & 1 \\ 3 & 1 & 2 \\ 2 & 1 & -1 \end{vmatrix} = -9$$

$$\Delta_y = \begin{vmatrix} 2 & 1 & 1 \\ 1 & 3 & 2 \\ 3 & 2 & -1 \end{vmatrix} = -14$$

$$\Delta_z = \begin{vmatrix} 2 & -1 & 1 \\ 1 & 1 & 3 \\ 3 & 1 & 2 \end{vmatrix} = -11$$

Find each variable by evaluating the corresponding ratios and simplifying the signs:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{-9}{-15} = \dfrac{3}{5}$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-14}{-15} = \dfrac{14}{15}$$

$$z = \dfrac{\Delta_z}{\Delta} = \dfrac{-11}{-15} = \dfrac{11}{15}$$

The system has the rational solution \((x, y, z) = \left(\dfrac{3}{5}, \dfrac{14}{15}, \dfrac{11}{15}\right)\).

Example 9

Analyze the behavior of the following linear system using determinants:

$$\begin{cases} x + y + z = 2 \\ 2x + 2y + 2z = 4 \\ 3x + 3y + 3z = 7 \end{cases}$$

Solution

Set up the coefficient determinant and the determinants associated with each variable:

$$\Delta = \begin{vmatrix} 1 & 1 & 1 \\ 2 & 2 & 2 \\ 3 & 3 & 3 \end{vmatrix} = 0$$

$$\Delta_x = \begin{vmatrix} 2 & 1 & 1 \\ 4 & 2 & 2 \\ 7 & 3 & 3 \end{vmatrix} = 0, \qquad \Delta_y = \begin{vmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 3 & 7 & 3 \end{vmatrix} = 0, \qquad \Delta_z = \begin{vmatrix} 1 & 1 & 2 \\ 2 & 2 & 4 \\ 3 & 3 & 7 \end{vmatrix} = 0$$

Whenever two rows or columns in a matrix are identical, the determinant equals zero. In the determinants above, at least two columns are identical (repeating 1, 2, 3).

In this system, \(\Delta = 0\) and \(\Delta_x = \Delta_y = \Delta_z = 0\) hold simultaneously. In dimensions 3×3 or higher, the vanishing of all determinants leaves Cramer's rule inconclusive, making it impossible to determine whether there are infinitely many solutions or no solution.

To resolve this ambiguity, compare the equations algebraically. Multiplying the first equation by 3 yields \(3x + 3y + 3z = 6\), which directly contradicts the third equation (\(3x + 3y + 3z = 7\)). This contradiction (\(6 = 7\)) proves that the system is inconsistent.

Example 10

Solve the following system of linear equations:

$$\begin{cases} 3x - y = 5 \\ 2x + z = 7 \\ y - 2z = -5 \end{cases}$$

Solution

Notice that each equation is missing a different variable. Before assembling the determinants, fill in the missing variables with a coefficient of zero to keep the columns aligned:

$$\begin{cases} 3x - y + 0z = 5 \\ 2x + 0y + z = 7 \\ 0x + y - 2z = -5 \end{cases}$$

Construct the coefficient determinant \(\Delta\) and evaluate it using cofactor expansion along the first row, taking advantage of the zero in the third column:

$$\Delta = \begin{vmatrix} 3 & -1 & 0 \\ 2 & 0 & 1 \\ 0 & 1 & -2 \end{vmatrix} = 3 \cdot \begin{vmatrix} 0 & 1 \\ 1 & -2 \end{vmatrix} - (-1) \cdot \begin{vmatrix} 2 & 1 \\ 0 & -2 \end{vmatrix} + 0$$

$$\Delta = 3(0 - 1) + 1(-4 - 0) = -3 - 4 = -7$$

Because \(\Delta \neq 0\), the system has a unique solution. Form and evaluate the variable determinants by replacing each column with the vector of constants \((5, 7, -5)\):

$$\Delta_x = \begin{vmatrix} 5 & -1 & 0 \\ 7 & 0 & 1 \\ -5 & 1 & -2 \end{vmatrix} = -14$$

$$\Delta_y = \begin{vmatrix} 3 & 5 & 0 \\ 2 & 7 & 1 \\ 0 & -5 & -2 \end{vmatrix} = -7$$

$$\Delta_z = \begin{vmatrix} 3 & -1 & 5 \\ 2 & 0 & 7 \\ 0 & 1 & -5 \end{vmatrix} = -21$$

Divide each variable determinant by the coefficient determinant:

$$x = \dfrac{\Delta_x}{\Delta} = \dfrac{-14}{-7} = 2$$

$$y = \dfrac{\Delta_y}{\Delta} = \dfrac{-7}{-7} = 1$$

$$z = \dfrac{\Delta_z}{\Delta} = \dfrac{-21}{-7} = 3$$

The solution is the ordered triple \((x, y, z) = (2, 1, 3)\).

Applications and Limitations of Cramer's Rule

Given how straightforward Cramer's rule is for solving small systems using determinants, a natural question arises: if this method gives direct formulas for each variable, why is it not widely used in engineering, computer science, or financial modeling?

Theoretical Utility and Analytical Applications

The primary power of Cramer's rule lies in its theoretical value. Unlike iterative numerical methods or row elimination algorithms that alter equations step by step, this theorem provides a closed-form, explicit formula for each variable expressed in terms of the system's original parameters.

This property is particularly valuable when you do not need to solve for all variables, but rather need to analyze a single variable in isolation:

  • Multivariable calculus: Enables calculating implicit derivatives and rates of change via Jacobian matrices without needing to solve for all interrelated functions.
  • Parametric models and sensitivity analysis: Facilitates studying how an individual variable responds to minor fluctuations in a specific coefficient or constant term.
  • Algebraic proofs: Serves as a foundational tool to derive theoretical properties of invertible matrices, matrix norms, and analytical solutions in mathematical physics.

The Computational Cost Barrier

The major drawback of the method becomes apparent when increasing the dimension of the system. For a 2×2 system, we compute only two multiplications per determinant; for a 3×3 system, we compute six products per determinant. However, for an n×n system evaluated using cofactor expansion, the operations required per determinant grow factorially (n!).

Because the rule requires computing the coefficient determinant plus the \(n\) variable determinants (a total of \(n + 1\) determinants), the total number of arithmetic operations scales with \((n + 1)!\):

To put this growth into perspective, consider a system of 20 equations with 20 variables—a common scale in electric circuit analysis or distribution networks. If solved via cofactor expansion, the algorithm would require approximately \(21!\) operations, equivalent to more than \(5.1 \times 10^{19}\) elementary calculations. Even the fastest supercomputer on Earth, executing trillions of operations per second, would take centuries to complete the task.

In contrast, alternative methods such as Gaussian elimination or the Gauss-Jordan method reduce the system using row operations, solving the exact same 20×20 system in a tiny fraction of a second.

Algorithmic Complexity and More Efficient Methods

In computer science, this difference in performance is formally classified using Big O notation, which describes how computation time scales with system size \(n\):

  • Cramer's rule via cofactors: Has factorial complexity \(O((n+1)!)\), making it computationally impractical for any real-world problem where \(n \ge 4\).
  • Gaussian elimination and Gauss-Jordan elimination: Feature cubic polynomial complexity \(O(n^3)\). This means that doubling the size of the system only increases computing time roughly eightfold, keeping computation well within manageable limits for modern processors.

For this reason, large numerical linear systems are solved using Gaussian elimination or advanced matrix factorizations (such as LU or Cholesky decomposition), reserving Cramer's rule for theoretical proofs and educational 2×2 and 3×3 systems.

Did you find this useful? Rate it!

0.0 / 5 — 0 votes

Daniel Machado

Mathematics teacher and administrator of Flamath, where he shares content about Mathematical Logic

HOW TO CITE THIS ARTICLE
Machado, D. (2026, October 21). Cramer's Rule. Flamath. https://en.flamath.com/cramers-rule

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *