Cramer's Rule with Questions and Solutions
Cramer's rule is an explicit formula used to solve systems of \( n \) linear equations with \( n \) variables using determinants. This guide starts with a proof for \( 2 \times 2 \) systems, presents rules for \( 3 \times 3 \) systems, and provides comprehensive step-by-step examples and practice problems.
To check your answers when solving linear systems, you can use the online Systems of Equations Calculator and Solver.
Table of Contents
Cramer's Rule for a \( 2 \times 2 \) System of Equations
To find the explicit formulas for solving any \( 2 \times 2 \) system of linear equations, consider the general system:
\[ \begin{cases} a_1 x + b_1 y = c_1 \\ a_2 x + b_2 y = c_2 \end{cases} \]Proof / Derivation: Multiply equation (1) by \( b_2 \) and equation (2) by \( -b_1 \):
\[ \begin{cases} a_1 b_2 x + b_1 b_2 y = c_1 b_2 \\ -a_2 b_1 x - b_2 b_1 y = -c_2 b_1 \end{cases} \]Adding the left and right sides yields:
\[ a_1 b_2 x - a_2 b_1 x = c_1 b_2 - c_2 b_1 \implies x(a_1 b_2 - a_2 b_1) = b_2 c_1 - b_1 c_2 \]Solving for \( x \) and similarly for \( y \):
\[ x = \dfrac{c_1 b_2 - c_2 b_1}{a_1 b_2 - a_2 b_1}, \quad y = \dfrac{a_1 c_2 - a_2 c_1}{a_1 b_2 - a_2 b_1} \]Using determinant notation, the solution is given by Cramer's rule:
\[ x = \dfrac{D_x}{D}, \quad y = \dfrac{D_y}{D} \]Where the determinants are defined as:
\[ D = \begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix} = a_1 b_2 - b_1 a_2 \] \[ D_x = \begin{vmatrix} c_1 & b_1 \\ c_2 & b_2 \end{vmatrix} = c_1 b_2 - b_1 c_2 \] \[ D_y = \begin{vmatrix} a_1 & c_1 \\ a_2 & c_2 \end{vmatrix} = a_1 c_2 - c_1 a_2 \]Important: Cramer's rule applies only when \( D \neq 0 \). If \( D = 0 \), the system has either no solution or infinitely many solutions, and other methods must be used.
Example 1: Solving a \( 2 \times 2 \) System Using Cramer's Rule
Show Solution
Use Cramer's rule to solve the system:
\[ \begin{cases} 2x - 3y = 5 \\ -4x + 7y = -11 \end{cases} \]Solution
Calculate the determinants \( D, D_x, \) and \( D_y \):
\[ D = \begin{vmatrix} 2 & -3 \\ -4 & 7 \end{vmatrix} = (2)(7) - (-3)(-4) = 14 - 12 = 2 \] \[ D_x = \begin{vmatrix} 5 & -3 \\ -11 & 7 \end{vmatrix} = (5)(7) - (-3)(-11) = 35 - 33 = 2 \] \[ D_y = \begin{vmatrix} 2 & 5 \\ -4 & -11 \end{vmatrix} = (2)(-11) - (5)(-4) = -22 + 20 = -2 \]Apply Cramer's rule to find \( x \) and \( y \):
\[ x = \dfrac{D_x}{D} = \dfrac{2}{2} = 1 \] \[ y = \dfrac{D_y}{D} = \dfrac{-2}{2} = -1 \]Verification: Substitute \( x = 1 \) and \( y = -1 \) into the original system:
\[ 2(1) - 3(-1) = 2 + 3 = 5 \quad \checkmark \] \[ -4(1) + 7(-1) = -4 - 7 = -11 \quad \checkmark \]Cramer's Rule for a \( 3 \times 3 \) System of Equations
Consider a general \( 3 \times 3 \) system of linear equations:
\[ \begin{cases} a_1 x + b_1 y + c_1 z = d_1 \\ a_2 x + b_2 y + c_2 z = d_2 \\ a_3 x + b_3 y + c_3 z = d_3 \end{cases} \]Cramer's rule gives the solution as:
\[ x = \dfrac{D_x}{D}, \quad y = \dfrac{D_y}{D}, \quad z = \dfrac{D_z}{D} \]Where \( D, D_x, D_y, \) and \( D_z \) are determinants of \( 3 \times 3 \) matrices:
\[ D = \begin{vmatrix} a_1 & b_1 & c_1 \\ a_2 & b_2 & c_2 \\ a_3 & b_3 & c_3 \end{vmatrix} \] \[ D_x = \begin{vmatrix} d_1 & b_1 & c_1 \\ d_2 & b_2 & c_2 \\ d_3 & b_3 & c_3 \end{vmatrix}, \quad D_y = \begin{vmatrix} a_1 & d_1 & c_1 \\ a_2 & d_2 & c_2 \\ a_3 & d_3 & c_3 \end{vmatrix}, \quad D_z = \begin{vmatrix} a_1 & b_1 & d_1 \\ a_2 & b_2 & d_2 \\ a_3 & b_3 & d_3 \end{vmatrix} \]Pattern: To find \( D_x \), replace the \( x \)-column (first column) with the constants \( d_1, d_2, d_3 \). Similarly, \( D_y \) replaces the \( y \)-column, and \( D_z \) replaces the \( z \)-column.
Example 2: Solving a \( 3 \times 3 \) System Using Cramer's Rule
Show Solution
Use Cramer's rule to solve the system:
\[ \begin{cases} -x - 3y - z = 6 \\ 2x - 5y - 2z = 14 \\ x + y = -1 \end{cases} \]Solution
Step 1: Identify the coefficient matrix and the constants. Note that the third equation has no \( z \) term, so its coefficient is 0.
Step 2: Calculate the determinant \( D \):
\[ D = \begin{vmatrix} -1 & -3 & -1 \\ 2 & -5 & -2 \\ 1 & 1 & 0 \end{vmatrix} \]Expanding along the first row:
\[ D = -1\begin{vmatrix}-5 & -2 \\ 1 & 0\end{vmatrix} - (-3)\begin{vmatrix}2 & -2 \\ 1 & 0\end{vmatrix} + (-1)\begin{vmatrix}2 & -5 \\ 1 & 1\end{vmatrix} \] \[ D = -1(0 + 2) + 3(0 + 2) - 1(2 + 5) = -2 + 6 - 7 = -3 \]Step 3: Calculate \( D_x \), \( D_y \), and \( D_z \):
\[ D_x = \begin{vmatrix} 6 & -3 & -1 \\ 14 & -5 & -2 \\ -1 & 1 & 0 \end{vmatrix} = 6(0 + 2) + 3(0 - 2) - 1(14 - 5) = 12 - 6 - 9 = -3 \] \[ D_y = \begin{vmatrix} -1 & 6 & -1 \\ 2 & 14 & -2 \\ 1 & -1 & 0 \end{vmatrix} = -1(0 - 2) - 6(0 + 2) - 1(-2 - 14) = 2 - 12 + 16 = 6 \] \[ D_z = \begin{vmatrix} -1 & -3 & 6 \\ 2 & -5 & 14 \\ 1 & 1 & -1 \end{vmatrix} = -1(5 - 14) + 3(-2 - 14) + 6(2 + 5) = 9 - 48 + 42 = 3 \]Step 4: Apply Cramer's rule to find \( x, y, \) and \( z \):
\[ x = \dfrac{D_x}{D} = \dfrac{-3}{-3} = 1 \] \[ y = \dfrac{D_y}{D} = \dfrac{6}{-3} = -2 \] \[ z = \dfrac{D_z}{D} = \dfrac{3}{-3} = -1 \]Verification: Substitute \( (x, y, z) = (1, -2, -1) \) into the original system:
\[ -(1) - 3(-2) - (-1) = -1 + 6 + 1 = 6 \quad \checkmark \] \[ 2(1) - 5(-2) - 2(-1) = 2 + 10 + 2 = 14 \quad \checkmark \] \[ 1 + (-2) = -1 \quad \checkmark \]Questions with Detailed Solutions
Part 1: Solving Systems with Fractions and Decimals
Show Solutions
Use Cramer's rule to solve the following linear systems:
a) \( \begin{cases} 5x - \frac{2}{3}y = \frac{1}{3} \\ -x + \frac{1}{2}y = -\frac{1}{2} \end{cases} \)
Solution a:
\[ D = \begin{vmatrix} 5 & -2/3 \\ -1 & 1/2 \end{vmatrix} = (5)(\frac{1}{2}) - (-\frac{2}{3})(-1) = \frac{5}{2} - \frac{2}{3} = \frac{15 - 4}{6} = \frac{11}{6} \] \[ D_x = \begin{vmatrix} 1/3 & -2/3 \\ -1/2 & 1/2 \end{vmatrix} = (\frac{1}{3})(\frac{1}{2}) - (-\frac{2}{3})(-\frac{1}{2}) = \frac{1}{6} - \frac{1}{3} = -\frac{1}{6} \] \[ D_y = \begin{vmatrix} 5 & 1/3 \\ -1 & -1/2 \end{vmatrix} = (5)(-\frac{1}{2}) - (\frac{1}{3})(-1) = -\frac{5}{2} + \frac{1}{3} = -\frac{15}{6} + \frac{2}{6} = -\frac{13}{6} \] \[ x = \dfrac{D_x}{D} = \dfrac{-1/6}{11/6} = -\dfrac{1}{11}, \quad y = \dfrac{D_y}{D} = \dfrac{-13/6}{11/6} = -\dfrac{13}{11} \]b) \( \begin{cases} 0.1x - 0.3y = 1.1 \\ -0.2x + 1.3y = -1.5 \end{cases} \)
Solution b:
\[ D = \begin{vmatrix} 0.1 & -0.3 \\ -0.2 & 1.3 \end{vmatrix} = (0.1)(1.3) - (-0.3)(-0.2) = 0.13 - 0.06 = 0.07 \] \[ D_x = \begin{vmatrix} 1.1 & -0.3 \\ -1.5 & 1.3 \end{vmatrix} = (1.1)(1.3) - (-0.3)(-1.5) = 1.43 - 0.45 = 0.98 \] \[ D_y = \begin{vmatrix} 0.1 & 1.1 \\ -0.2 & -1.5 \end{vmatrix} = (0.1)(-1.5) - (1.1)(-0.2) = -0.15 + 0.22 = 0.07 \] \[ x = \dfrac{0.98}{0.07} = 14, \quad y = \dfrac{0.07}{0.07} = 1 \]c) \( \begin{cases} -3x + 5y - z = \frac{1}{2} \\ \frac{1}{5}x - 5y - \frac{3}{5}z = 0 \\ -4x + \frac{4}{5}y - z = -7 \end{cases} \)
Solution c: Evaluating the determinants gives:
\[ D = \frac{82}{5}, \quad D_x = \frac{2937}{50}, \quad D_y = \frac{153}{10}, \quad D_z = -\frac{2698}{25} \]Applying Cramer's rule:
\[ x = \dfrac{D_x}{D} = \dfrac{2937/50}{82/5} = \dfrac{2937}{50} \cdot \dfrac{5}{82} = \dfrac{2937}{820} \] \[ y = \dfrac{D_y}{D} = \dfrac{153/10}{82/5} = \dfrac{153}{10} \cdot \dfrac{5}{82} = \dfrac{153}{164} \] \[ z = \dfrac{D_z}{D} = \dfrac{-2698/25}{82/5} = -\dfrac{2698}{25} \cdot \dfrac{5}{82} = -\dfrac{1349}{205} \]Part 2: Systems with Parameter \( k \)
Show Solutions
Use Cramer's rule to solve the systems in terms of parameter \( k \):
a) \( \begin{cases} 5x - ky = 6 \\ -2x + 2ky = -3 \end{cases} \)
Solution a:
\[ D = \begin{vmatrix} 5 & -k \\ -2 & 2k \end{vmatrix} = (5)(2k) - (-k)(-2) = 10k - 2k = 8k \] \[ D_x = \begin{vmatrix} 6 & -k \\ -3 & 2k \end{vmatrix} = (6)(2k) - (-k)(-3) = 12k - 3k = 9k \] \[ D_y = \begin{vmatrix} 5 & 6 \\ -2 & -3 \end{vmatrix} = (5)(-3) - (6)(-2) = -15 + 12 = -3 \]For \( k \neq 0 \):
\[ x = \dfrac{9k}{8k} = \dfrac{9}{8}, \quad y = \dfrac{-3}{8k} = -\dfrac{3}{8k} \]b) \( \begin{cases} 2x - 3y = k \\ x + 2y = -2k \end{cases} \)
Solution b:
\[ D = \begin{vmatrix} 2 & -3 \\ 1 & 2 \end{vmatrix} = (2)(2) - (-3)(1) = 4 + 3 = 7 \] \[ D_x = \begin{vmatrix} k & -3 \\ -2k & 2 \end{vmatrix} = (k)(2) - (-3)(-2k) = 2k - 6k = -4k \] \[ D_y = \begin{vmatrix} 2 & k \\ 1 & -2k \end{vmatrix} = (2)(-2k) - (k)(1) = -4k - k = -5k \] \[ x = \dfrac{-4k}{7} = -\dfrac{4}{7}k, \quad y = \dfrac{-5k}{7} = -\dfrac{5}{7}k \]Part 3: Systems with Parameters \( p \) and \( q \)
Show Solutions
a) Solve the system in terms of \( p \) and \( q \):
\[ \begin{cases} -x - 3y = 5p \\ -2x - 5y = -2q \end{cases} \]Solution a:
\[ D = \begin{vmatrix} -1 & -3 \\ -2 & -5 \end{vmatrix} = (-1)(-5) - (-3)(-2) = 5 - 6 = -1 \] \[ D_x = \begin{vmatrix} 5p & -3 \\ -2q & -5 \end{vmatrix} = (5p)(-5) - (-3)(-2q) = -25p - 6q \] \[ D_y = \begin{vmatrix} -1 & 5p \\ -2 & -2q \end{vmatrix} = (-1)(-2q) - (5p)(-2) = 2q + 10p \] \[ x = \dfrac{-25p - 6q}{-1} = 25p + 6q, \quad y = \dfrac{2q + 10p}{-1} = -2q - 10p \]b) Using part (a), solve for specific values:
- For \( p = 2, q = 2 \): \( x = 25(2) + 6(2) = 62, \; y = -2(2) - 10(2) = -24 \)
- For \( p = 1/2, q = 1 \): \( x = 25(1/2) + 6(1) = 12.5 + 6 = 18.5 = \frac{37}{2}, \; y = -2(1) - 10(1/2) = -2 - 5 = -7 \)
- For \( p = 10, q = -3 \): \( x = 25(10) + 6(-3) = 250 - 18 = 232, \; y = -2(-3) - 10(10) = 6 - 100 = -94 \)
Part 4: Parameter Independence
Show Solution
Solve the system and show that the solution does not depend on parameter \( p \):
\[ \begin{cases} 5x - 6y + 6z = -14 \\ 9x - py - z = 22 \\ -2x - 6y = -4 \end{cases} \]Solution
Calculating the determinants:
\[ D = -12p - 366, \quad D_x = -24p - 732, \quad D_y = 0, \quad D_z = 48p + 1464 \]Applying Cramer's rule:
\[ x = \dfrac{-24p - 732}{-12p - 366} = \dfrac{-12(2p + 61)}{-6(2p + 61)} = 2 \] \[ y = \dfrac{0}{-12p - 366} = 0 \] \[ z = \dfrac{48p + 1464}{-12p - 366} = \dfrac{24(2p + 61)}{-6(2p + 61)} = -4 \]The solution \( (x, y, z) = (2, 0, -4) \) contains no occurrences of \( p \), proving the solution is independent of \( p \) (for \( p \neq -\frac{61}{2} \), where \( D = 0 \)).
Verification: Substitute \( (x, y, z) = (2, 0, -4) \):
\[ 5(2) - 6(0) + 6(-4) = 10 - 24 = -14 \quad \checkmark \] \[ 9(2) - p(0) - (-4) = 18 + 4 = 22 \quad \checkmark \] \[ -2(2) - 6(0) = -4 \quad \checkmark \]Frequently Asked Questions
What is Cramer's rule?
Cramer's rule is an explicit formula that solves a system of \( n \) linear equations with \( n \) variables using determinants. For each variable, the solution is the ratio of two determinants: the determinant of the matrix with the variable's column replaced by the constants, divided by the determinant of the coefficient matrix.
When can Cramer's rule be used?
Cramer's rule can only be used when the system has the same number of equations as variables (a square coefficient matrix) AND the determinant of the coefficient matrix is non-zero. If the determinant is zero, the system either has no solution or infinitely many solutions.
What is the formula for Cramer's rule in a 2×2 system?
For a 2×2 system \( a_1x + b_1y = c_1 \) and \( a_2x + b_2y = c_2 \), Cramer's rule gives \( x = D_x/D \) and \( y = D_y/D \), where \( D = a_1b_2 - b_1a_2 \), \( D_x = c_1b_2 - b_1c_2 \), and \( D_y = a_1c_2 - c_1a_2 \).
What happens if the determinant is zero in Cramer's rule?
If the determinant \( D \) equals zero, Cramer's rule cannot be applied. The system is either inconsistent (no solution) or has infinitely many solutions. Other methods such as Gaussian elimination must be used to determine which case applies.
Can Cramer's rule be used for systems with more than 3 variables?
Yes, Cramer's rule works for any \( n \times n \) system. However, computing determinants of large matrices is computationally expensive (on the order of \( n! \) operations), so Gaussian elimination is usually preferred for systems with more than 4 variables.
References and Links Related to Systems of Equations and Determinants
- Gaussian Elimination to Solve Systems - Questions with Solutions
- Gaussian Elimination Solver Calculator for a 3 by 3 Systems of Equations
- Solver Calculator to Solve 3 by 3 Systems of Equations Using Cramer's Rules
- Solve Systems of Equations - Tutorial
- Determinant of a Matrix and Cramer's rule
- Systems of Equations Calculator and Solver
- Linear Algebra and its Applications - 5th Edition - David C. Lay, Steven R. Lay, Judi J. McDonald
- Elementary Linear Algebra - 7th Edition - Howard Anton and Chris Rorres