Systems of Linear Equations: Cramer's Rule and Consistency

A system of linear equations either has exactly one solution, infinitely many, or none at all. Determinants tell you quickly which case you are in, Cramer's rule and the inverse method find the unique solution, and the idea of rank settles the harder cases where the determinant is zero. Questions on 'for what value of k' and on homogeneous systems appear every year in ECAT, NUST NET, JEE Main and board papers.

Asked in: ECAT, NUST NET, JEE Main, FSc and Class 11-12 boards

Matrix form and the three possible outcomes

A system such as a₁x + b₁y + c₁z = d₁, aβ‚‚x + bβ‚‚y + cβ‚‚z = dβ‚‚, a₃x + b₃y + c₃z = d₃ is written AX = B, where A is the coefficient matrix, X the column of unknowns and B the column of constants. The augmented matrix [A | B] is A with B attached as an extra column.

A system with at least one solution is consistent; it has either a unique solution or infinitely many. A system with no solution is inconsistent. Two linear equations can never have exactly two solutions: if two different solutions exist, every point on the line through them is also a solution.

Cramer's rule

Let D = det A. Form Dx by replacing the x-column of A with the constants, and similarly Dy and Dz. If D β‰  0, the system has the unique solution x = Dx/D, y = Dy/D, z = Dz/D.

Cramer's rule is fastest for 2 Γ— 2 systems and for 3 Γ— 3 systems where you only need one unknown. It cannot be used to find a solution when D = 0.

Two equations in two unknowns: the ratio test

Each equation is a line. If a₁/aβ‚‚ β‰  b₁/bβ‚‚ the lines cross at one point (unique solution). If a₁/aβ‚‚ = b₁/bβ‚‚ β‰  c₁/cβ‚‚ the lines are parallel (no solution). If all three ratios are equal the lines coincide (infinitely many solutions).

In determinant language: D β‰  0 gives a unique solution; D = 0 with Dx or Dy non-zero gives no solution; D = Dx = Dy = 0 gives infinitely many (for two equations in two unknowns, not both trivial).

When D = 0 for three equations

If D = 0 and at least one of Dx, Dy, Dz is non-zero, the system is inconsistent. If D = Dx = Dy = Dz = 0, the system may have infinitely many solutions or none, so you must check further, usually by elimination.

In the inverse method X = A⁻¹B = (adj A)B/|A|. When |A| = 0: if (adj A)B β‰  O the system is inconsistent; if (adj A)B = O it is either inconsistent or has infinitely many solutions.

Rank and row reduction

The rank of a matrix is the number of non-zero rows left after reducing it to echelon form by row operations (equivalently, the order of its largest non-zero minor). Reduce the augmented matrix [A | B] and compare ranks.

If rank A β‰  rank [A | B] the system is inconsistent. If both ranks equal the number of unknowns n, the solution is unique. If both equal r with r less than n, there are infinitely many solutions with n βˆ’ r free parameters.

Homogeneous systems

A system AX = O (all constants zero) is homogeneous. It is always consistent, because x = y = z = 0 (the trivial solution) works.

If |A| β‰  0 the trivial solution is the only one. A non-trivial solution exists exactly when |A| = 0, and then there are infinitely many solutions, all multiples of one (or more) basic solutions.

Solved examples

  1. Solve by Cramer's rule: 4x βˆ’ 3y = 5 and 3x + 2y = 8.
    1. D = 4(2) βˆ’ 3(βˆ’3) = 8 + 9 = 17.
    2. Dx = 5(2) βˆ’ 8(βˆ’3) = 10 + 24 = 34 and Dy = 4(8) βˆ’ 3(5) = 32 βˆ’ 15 = 17.
    3. x = 34/17 = 2 and y = 17/17 = 1.
    4. Check: 4(2) βˆ’ 3(1) = 5 and 3(2) + 2(1) = 8.
    Answer: x = 2, y = 1
  2. Solve by Cramer's rule: 2x βˆ’ y + z = 3, x + 3y βˆ’ 2z = 1, 3x + y βˆ’ z = 2.
    1. D = det [[2, βˆ’1, 1], [1, 3, βˆ’2], [3, 1, βˆ’1]] = 2(βˆ’3 + 2) + 1(βˆ’1 + 6) + 1(1 βˆ’ 9) = βˆ’2 + 5 βˆ’ 8 = βˆ’5.
    2. Replacing columns by (3, 1, 2): Dx = βˆ’5, Dy = βˆ’10, Dz = βˆ’15.
    3. x = βˆ’5/βˆ’5 = 1, y = βˆ’10/βˆ’5 = 2, z = βˆ’15/βˆ’5 = 3.
    4. Check in the first equation: 2 βˆ’ 2 + 3 = 3.
    Answer: x = 1, y = 2, z = 3
  3. For the system x + 2y = 3 and 3x + ky = m, find the conditions on k and m for (a) a unique solution, (b) infinitely many solutions, (c) no solution.
    1. D = k βˆ’ 6. A unique solution needs D β‰  0, so k β‰  6.
    2. If k = 6, the ratios of the x and y coefficients are 1/3 and 2/6, both equal to 1/3.
    3. Infinitely many solutions need the constants in the same ratio: 3/m = 1/3, so m = 9.
    4. If k = 6 and m β‰  9 the lines are parallel and distinct, so there is no solution.
    Answer: (a) k β‰  6; (b) k = 6 and m = 9; (c) k = 6 and m β‰  9
  4. Discuss the system x + y + z = 4, x + 3y + 2z = 7, x + 5y + Ξ»z = ΞΌ for all values of Ξ» and ΞΌ.
    1. Subtract the first equation from the others: 2y + z = 3 and 4y + (Ξ» βˆ’ 1)z = ΞΌ βˆ’ 4.
    2. Subtract twice the first of these from the second: (Ξ» βˆ’ 3)z = ΞΌ βˆ’ 10.
    3. If Ξ» β‰  3, z = (ΞΌ βˆ’ 10)/(Ξ» βˆ’ 3) and back-substitution gives a unique solution.
    4. If Ξ» = 3 and ΞΌ = 10 the last equation is 0 = 0, so there are infinitely many solutions; if Ξ» = 3 and ΞΌ β‰  10 it reads 0 = non-zero, so there is no solution.
    Answer: Unique if Ξ» β‰  3; infinitely many if Ξ» = 3, ΞΌ = 10; none if Ξ» = 3, ΞΌ β‰  10
  5. Use ranks to decide the nature of the system x + 2y βˆ’ z = 1, 2x + 4y βˆ’ 2z = 2, 3x + y + z = 4, and solve it.
    1. The second equation is twice the first, so after row reduction [A | B] has only two non-zero rows: rank A = rank [A | B] = 2.
    2. There are 3 unknowns, so the system is consistent with infinitely many solutions and 3 βˆ’ 2 = 1 free parameter.
    3. Put z = t: x + 2y = 1 + t and 3x + y = 4 βˆ’ t. Solving, x = (7 βˆ’ 3t)/5 and y = (4t βˆ’ 1)/5.
    4. Check in the first equation: (7 βˆ’ 3t)/5 + 2(4t βˆ’ 1)/5 βˆ’ t = (5 + 5t βˆ’ 5t)/5 = 1.
    Answer: Infinitely many: x = (7 βˆ’ 3t)/5, y = (4t βˆ’ 1)/5, z = t
  6. Find k so that the system x + y + z = 0, 2x βˆ’ y + kz = 0, x + 2y βˆ’ z = 0 has a non-trivial solution, and find that solution.
    1. A homogeneous system has a non-trivial solution only when det A = 0.
    2. det [[1, 1, 1], [2, βˆ’1, k], [1, 2, βˆ’1]] = 1(1 βˆ’ 2k) βˆ’ 1(βˆ’2 βˆ’ k) + 1(4 + 1) = 8 βˆ’ k. So k = 8.
    3. From the first and third equations, subtracting gives y βˆ’ 2z = 0, so y = 2z and then x = βˆ’y βˆ’ z = βˆ’3z.
    4. Check in the second: 2(βˆ’3z) βˆ’ 2z + 8z = 0. Taking z = t gives (x, y, z) = t(βˆ’3, 2, 1).
    Answer: k = 8; (x, y, z) = t(βˆ’3, 2, 1) for any t

Exam shortcuts

Common mistakes

Practice MCQs

  1. What is the solution of 3x + y = 7 and x βˆ’ 2y = 0?
    A) x = 1, y = 2
    B) x = βˆ’2, y = βˆ’1
    C) x = 2, y = 1
    D) x = 2, y = βˆ’1
    Answer: C) x = 2, y = 1 β€” D = 3(βˆ’2) βˆ’ 1(1) = βˆ’7, Dx = 7(βˆ’2) βˆ’ 0(1) = βˆ’14 and Dy = 3(0) βˆ’ 1(7) = βˆ’7, so x = 2 and y = 1. Swapping the values fails x βˆ’ 2y = 0, the all-negative pair comes from a sign slip in D, and y = βˆ’1 fails 3x + y = 7.
  2. For the system 2x + 5y = 1 and 3x βˆ’ y = 10, what is Dy in Cramer's rule?
    A) 23
    B) 17
    C) βˆ’17
    D) βˆ’51
    Answer: B) 17 β€” Dy replaces the y-column by the constants: det [[2, 1], [3, 10]] = 20 βˆ’ 3 = 17. βˆ’17 is D itself, βˆ’51 is Dx, and 23 adds 20 + 3 instead of subtracting. (The solution is x = 3, y = βˆ’1.)
  3. Ali buys 3 kg of apples and 2 kg of bananas for Rs 760. Priya buys 2 kg of apples and 5 kg of bananas for Rs 800. What is the price of 1 kg of apples?
    A) Rs 180
    B) Rs 80
    C) Rs 200
    D) Rs 160
    Answer: C) Rs 200 β€” 3a + 2b = 760 and 2a + 5b = 800 give D = 15 βˆ’ 4 = 11 and Da = 760(5) βˆ’ 800(2) = 2200, so a = 200. Rs 80 is the price of bananas, and Rs 160 and Rs 180 do not satisfy both equations (for example 3(160) + 2(80) = 640, not 760).
  4. How many solutions does the pair 2x + 3y = 5 and 4x + 6y = 9 have?
    A) None
    B) Exactly two
    C) Exactly one
    D) Infinitely many
    Answer: A) None β€” The ratios 2/4 = 3/6 = 1/2 are equal but 5/9 is different, so the lines are parallel and distinct: no solution. Exactly one would need unequal coefficient ratios, infinitely many would need 5/9 to equal 1/2 as well, and two straight lines can never meet in exactly two points.
  5. For what value of k does the system kx + 4y = 8, 3x + 6y = 12 have infinitely many solutions?
    A) 2
    B) 3
    C) βˆ’2
    D) 6
    Answer: A) 2 β€” We need k/3 = 4/6 = 8/12. Since 4/6 = 8/12 = 2/3, k/3 = 2/3 gives k = 2. k = 3 and k = 6 make D non-zero, so the solution is unique, and k = βˆ’2 also gives D = βˆ’24, a unique solution.
  6. A system of three linear equations in three unknowns has rank A = 2 and rank [A | B] = 3. The system has:
    A) a unique solution
    B) no solution
    C) only the trivial solution
    D) infinitely many solutions
    Answer: B) no solution β€” When rank A differs from rank [A | B], the constants cannot be matched by any combination of the equations, so the system is inconsistent. A unique solution needs both ranks equal to 3, infinitely many needs both ranks equal, and 'trivial solution' applies only to homogeneous systems, which are never inconsistent.
  7. Using Cramer's rule for x + y + z = 2, 2x βˆ’ y + 3z = 8, x + 2y βˆ’ z = βˆ’1, the values of D and Dx are:
    A) D = 5, Dx = 2
    B) D = 5, Dx = βˆ’10
    C) D = βˆ’5, Dx = 10
    D) D = 5, Dx = 10
    Answer: D) D = 5, Dx = 10 β€” D = 1(1 βˆ’ 6) βˆ’ 1(βˆ’2 βˆ’ 3) + 1(4 + 1) = βˆ’5 + 5 + 5 = 5. Dx = det [[2, 1, 1], [8, βˆ’1, 3], [βˆ’1, 2, βˆ’1]] = 2(βˆ’5) βˆ’ 1(βˆ’5) + 1(15) = 10, so x = 2. A sign slip in the middle cofactor gives βˆ’5 or βˆ’10, and Dx = 2 confuses Dx with the value of x.
  8. What is the rank of the matrix [[1, 2, 3], [2, 4, 6], [1, 1, 1]]?
    A) 0
    B) 2
    C) 1
    D) 3
    Answer: B) 2 β€” The second row is twice the first, so the determinant is 0 and the rank is less than 3. The first and third rows are not multiples of each other, so two independent rows remain: rank 2. Rank 1 would need every row to be a multiple of one row, rank 3 needs a non-zero determinant, and rank 0 is only for the zero matrix.
  9. For a consistent system of 3 equations in 3 unknowns with rank A = rank [A | B] = 2, the solution set is:
    A) infinitely many solutions with two free parameters
    B) infinitely many solutions with one free parameter
    C) a unique solution
    D) empty
    Answer: B) infinitely many solutions with one free parameter β€” Equal ranks mean the system is consistent, and the number of free parameters is n βˆ’ r = 3 βˆ’ 2 = 1. Two free parameters would need rank 1, a unique solution needs rank 3, and an empty set needs the two ranks to differ.
  10. The system x + y + z = 1, x + 2y + 3z = 2, x + 3y + Ξ»z = ΞΌ has no solution when:
    A) Ξ» = 5 and ΞΌ = 3
    B) Ξ» β‰  5 and ΞΌ = 3
    C) Ξ» = 3 and ΞΌ β‰  5
    D) Ξ» = 5 and ΞΌ β‰  3
    Answer: D) Ξ» = 5 and ΞΌ β‰  3 β€” Eliminating x gives y + 2z = 1 and 2y + (Ξ» βˆ’ 1)z = ΞΌ βˆ’ 1; eliminating y then gives (Ξ» βˆ’ 5)z = ΞΌ βˆ’ 3. With Ξ» = 5 and ΞΌ β‰  3 this reads 0 = non-zero, so there is no solution. Ξ» = 5, ΞΌ = 3 gives 0 = 0 (infinitely many), Ξ» β‰  5 gives a unique solution, and Ξ» = 3 also gives a unique solution because Ξ» βˆ’ 5 β‰  0.
  11. Solving 5x + 2y = 3 and 7x + 3y = 5 by the inverse method gives:
    A) x = 25, y = 36
    B) x = 1, y = βˆ’1
    C) x = βˆ’1, y = 4
    D) x = βˆ’1, y = βˆ’4
    Answer: C) x = βˆ’1, y = 4 β€” |A| = 15 βˆ’ 14 = 1, so A⁻¹ = [[3, βˆ’2], [βˆ’7, 5]] and X = A⁻¹B gives x = 9 βˆ’ 10 = βˆ’1, y = βˆ’21 + 25 = 4. x = 1, y = βˆ’1 fails the second equation, y = βˆ’4 has a sign slip, and 25, 36 come from multiplying B by A instead of A⁻¹.
  12. For what value of k does the system 2x + y βˆ’ z = 0, x βˆ’ y + 2z = 0, kx + 2y + z = 0 have a non-trivial solution?
    A) 13
    B) βˆ’13
    C) 7
    D) 1
    Answer: A) 13 β€” A non-trivial solution needs det A = 0. Expanding, det = 2(βˆ’1 βˆ’ 4) βˆ’ 1(1 βˆ’ 2k) βˆ’ 1(2 + k) = βˆ’10 βˆ’ 1 + 2k βˆ’ 2 βˆ’ k = k βˆ’ 13, so k = 13. βˆ’13 comes from a sign slip in the expansion, and 7 and 1 give non-zero determinants (βˆ’6 and βˆ’12), so only the trivial solution exists for them.
  13. For the homogeneous system x + 2y + z = 0, 2x + 3y + 4z = 0, 3x + 5y + 5z = 0, which statement is true?
    A) It has no solution
    B) It has exactly two solutions
    C) It has only the trivial solution
    D) It has infinitely many solutions
    Answer: D) It has infinitely many solutions β€” The third equation is the sum of the first two, so det A = 0 and the homogeneous system has non-trivial solutions, hence infinitely many. Only the trivial solution would need det A β‰  0, a homogeneous system always has at least x = y = z = 0, and a linear system never has exactly two solutions.
  14. For which values of a and b does x + y + z = 6, x + 2y + 3z = 14, 2x + 5y + az = b have infinitely many solutions?
    A) a = 8, b = 36
    B) a = 36, b = 8
    C) a = 8, b = 30
    D) a = 6, b = 36
    Answer: A) a = 8, b = 36 β€” Subtracting gives y + 2z = 8 and 3y + (a βˆ’ 2)z = b βˆ’ 12; then subtracting three times the first gives (a βˆ’ 8)z = b βˆ’ 36. Infinitely many solutions need 0 = 0, so a = 8 and b = 36. With a = 8, b = 30 the last row is 0 = βˆ’6 (no solution), a = 6 gives a unique solution, and swapping the values is a misreading.
  15. For which values of k does the system kx + y + z = 0, x + ky + z = 0, x + y + kz = 0 have non-trivial solutions?
    A) k = βˆ’1 or k = 2
    B) k = 1 only
    C) k = 1 or k = βˆ’2
    D) k = βˆ’2 only
    Answer: C) k = 1 or k = βˆ’2 β€” det A = kΒ³ βˆ’ 3k + 2 = (k βˆ’ 1)Β²(k + 2), which is zero for k = 1 and k = βˆ’2. Both give non-trivial solutions (k = 1 makes all three equations x + y + z = 0). The pair βˆ’1 and 2 has the signs of the roots reversed, and listing only one value misses a root of the cubic.

Questions

Can I use Cramer's rule when D = 0?

No. When D = 0 the formulas x = Dx/D and so on break down. Use the values of Dx, Dy, Dz or row reduction to decide whether there is no solution or infinitely many.

Is rank in the FSc and Class 12 syllabus?

The determinant tests and Cramer's rule are core in both. Rank and echelon form appear in FSc and in many entry-test questions, and they are the cleanest way to handle the D = 0 cases, so it is worth learning.

Why does a homogeneous system always have a solution?

Because putting every unknown equal to zero makes each left side zero, which matches the zero right side. The real question is whether other solutions exist, and that happens exactly when det A = 0.

What does 'one free parameter' mean?

It means one unknown can be chosen freely, say z = t, and the others are then fixed in terms of t. Geometrically the solutions form a line; with two free parameters they form a plane.