Cramer's Rule for Two Equations

Solving a two-variable linear system with determinants alone: compute D from the coefficients, replace a column with the constants to get that variable determinant, then divide - with the D not equal to zero condition and a checked worked example.

--
Cramer's Rule for Two Equations — Moosa Academy

Cramer's rule solves a linear system with determinants alone. The steps never change, which makes it easy to apply by hand and easy to program.

Concept The system and its coefficients

A system of two linear equations in two unknowns is written:

 a_1 x + b_1 y = c_1
 a_2 x + b_2 y = c_2

The numbers multiplying  x and  y form the coefficient matrix; the numbers on the right form the constant column.

Theorem The rule
c₁b₁ c₂b₂ a₁c₁ a₂c₂ Dₓ D_y the shaded column is replaced by the constants
To build  D_x , replace the  x -column with the constants. To build  D_y , replace the  y -column instead. Everything else stays as it was.
 D = \begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix} \qquad x = \frac{D_x}{D} \qquad y = \frac{D_y}{D}

The rule requires  D \neq 0 . If  D = 0 the system has either no solution or infinitely many, and Cramer's rule cannot be used.

Note The five steps
1. Build the coefficient matrix and compute  D .
2. Replace the  x -column with the constants to form  D_x .
3. Replace the  y -column with the constants to form  D_y .
4. Divide:  x = D_x / D and  y = D_y / D .
5. Substitute back into the original equations to check.

Always compute  D first. If it turns out to be zero, stop — there is no unique solution to find.

Example A full solution

Solve  5x - 6y = 15 and  3x + 4y = -29 .

Step 1 —  D = (5)(4) - (-6)(3) = 20 + 18 = 38
Since  D \neq 0 , the rule applies.
Step 2 —  D_x = (15)(4) - (-6)(-29) = 60 - 174 = -114
Step 3 —  D_y = (5)(-29) - (15)(3) = -145 - 45 = -190
Step 4 —  x = \dfrac{-114}{38} = -3 and  y = \dfrac{-190}{38} = -5
⟹ x = −3, y = −5
Step 5 — check:  5(-3) - 6(-5) = -15 + 30 = 15
and  3(-3) + 4(-5) = -9 - 20 = -29

Watch the signs in  D_x :  -(-6)(-29) is a subtraction of a positive product, which is why the result drops to  -114 .

Note When the rule applies
The equations must be linear.
The number of equations must equal the number of unknowns.
 D must not be zero.
Substituting the answer back is always worth the few seconds it takes.
Summary
  1. Cramer's rule solves a linear system using determinants only.
  2. D is the determinant of the coefficient matrix; it must not be zero.
  3. Replace a variable's column with the constants to get that variable's determinant.
  4. x = Dₓ / D and y = D_y / D.
  5. For 5x − 6y = 15 and 3x + 4y = −29: D = 38, giving x = −3 and y = −5.