• Practice
  • About 17 min
  • 5 practice questions

Solving equations: Cramer's rule, the matrix method and consistency

Solve systems of two and three linear equations by Cramer's rule and by X = A⁻¹B, decide when a system has no solution or infinitely many, and use determinants for areas and for the line through two points.

If something looks wrong, please tell us.

Determinants were invented to solve linear equations, and this is where the course comes together. Two methods give the same answer when the determinant is not zero: Cramer's rule, which uses determinants only, and the matrix method, which uses the inverse. When the determinant is zero, you need to decide whether the system has no solution or infinitely many.

Cramer's rule

For a₁x + b₁y + c₁z = d₁, a₂x + b₂y + c₂z = d₂, a₃x + b₃y + c₃z = d₃, let D be the determinant of the coefficients. Let D₁, D₂ and D₃ be the determinants obtained by replacing the first, second and third column of D by the constants d₁, d₂, d₃. If D ≠ 0, the unique solution is x = D₁/D, y = D₂/D and z = D₃/D. For two equations, use 2 × 2 determinants in the same way.

Worked example 1: Cramer's rule in three variables

Solve x + y + z = 6, x − y + z = 2, 2x + y − z = 1. D = |1 1 1; 1 −1 1; 2 1 −1| = 1(1 − 1) − 1(−1 − 2) + 1(1 + 2) = 0 + 3 + 3 = 6. Replace column 1 by (6, 2, 1): D₁ = |6 1 1; 2 −1 1; 1 1 −1| = 6(0) − 1(−2 − 1) + 1(2 + 1) = 6. Similarly D₂ = 12 and D₃ = 18. So x = 1, y = 2, z = 3. Check in the third equation: 2 + 2 − 3 = 1.

Worked example 2: the matrix method

Solve 2x − 3y + 5z = 11, 3x + 2y − 4z = −5, x + y − 2z = −3. With A the coefficient matrix, |A| = 2(−4 + 4) + 3(−6 + 4) + 5(3 − 2) = 0 − 6 + 5 = −1. The adjoint is adj A = [0 −1 2; 2 −9 23; 1 −5 13]. Then X = A⁻¹B = −adj A × [11; −5; −3]. First entry: −(0 + 5 − 6) = 1. Second: −(22 + 45 − 69) = 2. Third: −(11 + 25 − 39) = 3. So x = 1, y = 2, z = 3.

When the determinant is zero

If D = 0, there is no unique solution. In the matrix method, compute (adj A)B. If it is not the zero matrix, the system is inconsistent: no solution. If it is zero, the system has either infinitely many solutions or none, and you must check the equations themselves. For two equations the picture is simple: D = 0 means the lines are parallel or the same. x + 2y = 3 and 2x + 4y = 6 are the same line (infinitely many solutions); x + 2y = 3 and 2x + 4y = 7 are parallel (no solution). A homogeneous system, with all constants zero, always has the solution x = y = z = 0, and it has other solutions exactly when D = 0.

Consistency of AX = B
ConditionResult
D ≠ 0Unique solution
D = 0 and (adj A)B ≠ ONo solution (inconsistent)
D = 0 and (adj A)B = OInfinitely many solutions or none: check the equations

Worked example 3: geometry with determinants

Find the area of the triangle with vertices (−2, −3), (3, 2) and (−1, −8). Area = ½ |−2(2 + 8) + 3(−8 + 3) + (−1)(−3 − 2)| = ½ |−20 − 15 + 5| = ½ × 30 = 15 square units. If a vertex has an unknown and the area is given, remember the absolute value: setting the expression equal to plus or minus twice the area usually gives two answers.

The line through two points (x₁, y₁) and (x₂, y₂) is |x y 1; x₁ y₁ 1; x₂ y₂ 1| = 0, because any point (x, y) on it makes a zero-area triangle with the two points. For (1, 2) and (3, 6): x(2 − 6) − y(1 − 3) + (6 − 6) = −4x + 2y = 0, so y = 2x.

Cramer's rule: x = D₁/D, y = D₂/D, z = D₃/D when D ≠ 0. Matrix method: X = A⁻¹B. D = 0 means no unique solution; (adj A)B ≠ O means no solution at all.

— Rule to remember

Key takeaways

Compute D first; it decides which case you are in. Use Cramer's rule for one unknown at a time and the matrix method when the inverse is wanted anyway. When D = 0, test (adj A)B, or for two equations compare the ratios of coefficients. Determinants also give areas, collinearity and the equation of a line.

Check your understanding

  1. 1. For 2x + 3y = 8 and x − y = −1, Cramer's rule uses D = −5. What is D₂, the determinant for y?

    1. −10
    2. 10
    3. −5
    4. 5
    Show answer

    Answer: A. Replace the y-column by the constants: D₂ = |2 8; 1 −1| = −2 − 8 = −10. So y = −10/−5 = 2, and x = 1.

  2. 2. For which value of k does the system x + 2y = 3, 2x + 4y = k have infinitely many solutions?

    1. 3
    2. any k ≠ 6
    3. 6
    4. no value of k
    Show answer

    Answer: C. D = 4 − 4 = 0. The second equation is twice the first exactly when k = 6; for any other k the lines are parallel and there is no solution.

  3. 3. What is the solution of x + y + z = 6, y + 3z = 11, x − 2y + z = 0?

    1. x = 2, y = 1, z = 3
    2. x = 1, y = 2, z = 3
    3. x = 3, y = 2, z = 1
    4. x = 1, y = 3, z = 2
    Show answer

    Answer: B. D = |1 1 1; 0 1 3; 1 −2 1| = 1(1 + 6) − 1(0 − 3) + 1(0 − 1) = 9 ≠ 0, so the solution is unique. Check (1, 2, 3): 6, 2 + 9 = 11, 1 − 4 + 3 = 0.

  4. 4. Using |x y 1; 0 0 1; 1 3 1| = 0, what is the equation of the line through (0, 0) and (1, 3)?

    1. y = x/3
    2. x + 3y = 0
    3. y = 3x + 1
    4. y = 3x
    Show answer

    Answer: D. Expand along row 1: x(0 − 3) − y(0 − 1) + 1(0 − 0) = −3x + y = 0, so y = 3x.

  5. 5. What is the area of the triangle with vertices (−2, −3), (3, 2) and (−1, −8)?

    1. 30 square units
    2. 20 square units
    3. 10 square units
    4. 15 square units
    Show answer

    Answer: D. ½ |−2(2 + 8) + 3(−8 + 3) − 1(−3 − 2)| = ½ |−20 − 15 + 5| = ½ × 30 = 15.

Privacy · Terms · Refunds · Delivery