Solving systems of linear equations with matrices
NCERT Class 12 Mathematics Chapter 4 Section 4.6
Quick answer
Write the system as AX = B, with A the matrix of coefficients. If |A| ≠ 0, A is invertible and the system has exactly one solution, X = AB. If |A| = 0, compute (adj A)B: if it is not the zero matrix the system has no solution, and if it is zero the system has either infinitely many solutions or none.
With your textbook
NCERT Mathematics Part I (Class 12), Chapter 4 “Determinants”, Section 4.6 “Applications of Determinants and Matrices”, pages 93–98.
Open the official NCERT chapter (PDF, 2.1 MB, ncert.nic.in) (opens in a new tab)
Checked against the 2026-27 reprint on .
When does a system of equations have a solution?
Consistent and inconsistent systems
A system of equations is said to be consistent if its solution (one or more) exists.
NCERT Mathematics Part I (Class 12), Section 4.6, page 94
- A system is inconsistent if it has no solution (NCERT page 94).
In plain words: two linear equations in x and y, each with at least one non-zero coefficient of the unknowns, represent two lines. If the lines meet in exactly one point, there is one solution; if they are parallel, there is none; if they are the same line, there are infinitely many. Determinants and matrices tell these cases apart without drawing, and work the same way for three equations in three unknowns.
Writing the system as AX = B
The equations ax + by + cz = d, ax + by + cz = d and ax + by + cz = d become one matrix equation AX = B (NCERT Section 4.6.1, page 94). A is the matrix of coefficients, X the column of unknowns x, y, z, and B the column of constants d, d, d:
Multiplying out AX row by row gives back the three left-hand sides.
|A| ≠ 0: one solution, X = AB
If A is non-singular, A exists. Multiplying AX = B on the left by A gives A(AX) = (AA)X = IX = X (NCERT Case I, page 94):
The matrix method
X = AB, when |A| ≠ 0
Because the inverse is unique, so is the solution.
This method of solving system of equations is known as Matrix Method.
NCERT Mathematics Part I (Class 12), Section 4.6.1, page 94
|A| = 0: none, or infinitely many
If A is singular there is no inverse, and NCERT (Case II, pages 94–95) looks at (adj A)B instead:
- If (adj A)B ≠ O, the system has no solution: it is inconsistent.
- If (adj A)B = O, the system may have infinitely many solutions (consistent) or none (inconsistent), and must be checked further.
The first rule follows from (adj A)A = |A| I = O: if AX = B had a solution, then (adj A)B = (adj A)AX = O. For example, NCERT Exercise 4.5, Q3: x + 3y = 5 and 2x + 6y = 8 give |A| = 6 − 6 = 0, adj A with rows 6, −3 and −2, 1, and (adj A)B with entries 30 − 24 = 6 and −10 + 8 = −2. That is not O, so the system is inconsistent; the second equation halves to x + 3y = 4, a parallel line.
For x + y = 2 and 2x + 2y = 4, adj A has rows 2, −1 and −2, 1, and (adj A)B has entries 4 − 4 and −4 + 4, so it is O. Here the second equation is twice the first, and every point of the line x + y = 2 is a solution.
NCERT itself notes (page 95) that (adj A)B = O may still give no solution. An example, beyond the NCERT text: for x + y + z = 1, x + y + z = 2, x + y + z = 3, every 2 × 2 minor of A is 0, so adj A = O and (adj A)B = O, yet the equations contradict each other. In this case, eliminate directly.
Beyond the NCERT text (JEE): the entries of (adj A)B are Cramer’s determinants D, D, D (the determinant of A with column 1, 2 or 3 replaced by B), so (adj A)B = O means D = D = D = 0, and when |A| ≠ 0, x = D/|A|, y = D/|A|, z = D/|A|. A homogeneous system AX = O always has the solution X = O; it has other solutions exactly when |A| = 0.
Solved examples
Example 1: Two equations (NCERT Example 16, page 95)
Solve 2x + 5y = 1 and 3x + 2y = 7.
A has rows 2, 5 and 3, 2, so |A| = 4 − 15 = −11 ≠ 0. A = −(1/11) times the matrix with rows 2, −5 and −3, 2. Then X = AB = −(1/11) times the column with entries 2 − 35 = −33 and −3 + 14 = 11.
Answer: x = 3, y = −1.
Example 2: Three equations (NCERT Example 17, pages 95–96)
Solve by the matrix method: 3x − 2y + 3z = 8, 2x + y − z = 1, 4x − 3y + 2z = 4.
|A| = 3(2 − 3) + 2(4 + 4) + 3(−6 − 4) = −3 + 16 − 30 = −17. The cofactors are A11 = −1, A12 = −8, A13 = −10, A21 = −5, A22 = −6, A23 = 1, A31 = −1, A32 = 9, A33 = 7, so
X = AB: the rows of adj A times the column 8, 1, 4 give −8 − 5 − 4 = −17, −64 − 6 + 36 = −34 and −80 + 1 + 28 = −51, and dividing by −17 gives 1, 2, 3.
Answer: x = 1, y = 2, z = 3.
Example 3: A word problem (NCERT Example 18, pages 96–97)
The sum of three numbers is 6. Three times the third number plus the second is 11. The first and third numbers add up to twice the second. Find the numbers by the matrix method.
With numbers x, y, z: x + y + z = 6, y + 3z = 11 and x − 2y + z = 0. A has rows 1, 1, 1; 0, 1, 3; 1, −2, 1, and |A| = 1(1 + 6) − 1(0 − 3) + 1(0 − 1) = 9. adj A has rows 7, −3, 2; 3, 0, −3; −1, 3, 1, and (adj A)B has entries 42 − 33 + 0 = 9, 18 + 0 + 0 = 18 and −6 + 33 + 0 = 27. Dividing by 9:
Answer: the numbers are 1, 2 and 3.
Example 4: A singular system (NCERT Exercise 4.5, Q5)
Examine the consistency of 3x − y − 2z = 2, 2y − z = −1, 3x − 5y = 3.
|A| = 3(0 − 5) + 1(0 + 3) − 2(0 − 6) = −15 + 3 + 12 = 0, so A is singular. adj A has rows −5, 10, 5; −3, 6, 3; −6, 12, 6, and (adj A)B has entries −10 − 10 + 15 = −5, −6 − 6 + 9 = −3 and −12 − 12 + 18 = −6. This is not O. (Directly: the first equation minus the third gives 4y − 2z = −1, while twice the second gives 4y − 2z = −2.)
Answer: the system is inconsistent.
Example 5: Reciprocals as unknowns (NCERT Miscellaneous Exercise, Q7, page 100)
Solve 2/x + 3/y + 10/z = 4, 4/x − 6/y + 5/z = 1 and 6/x + 9/y − 20/z = 2.
The original denominators require x, y, z ≠ 0. Put u = 1/x, v = 1/y, w = 1/z, and check that the resulting u, v, w are non-zero before taking reciprocals: then 2u + 3v + 10w = 4, 4u − 6v + 5w = 1, 6u + 9v − 20w = 2 is linear, with |A| = 2(120 − 45) − 3(−80 − 30) + 10(36 + 36) = 150 + 330 + 720 = 1200. adj A has rows 75, 150, 75; 110, −100, 30; 72, 0, −24, and (adj A)B has entries 600, 400, 240; dividing by 1200 gives u = 1/2, v = 1/3, w = 1/5. Check: 1 + 1 + 2 = 4, 2 − 2 + 1 = 1, 3 + 3 − 4 = 2.
Answer: x = 2, y = 3, z = 5.
NCERT slips (page 100): just above this question the Miscellaneous Exercise prints “Using properties of determinants in Exercises 11 to 15, prove that:”, but the exercise has only 9 questions and the 2026–27 book no longer covers those properties. Its next instruction, “Choose the correct answer in Exercise 17 to 19”, introduces what are Questions 8 and 9.
Common mistakes to avoid
Common mistake
Multiplying B by A on the wrong side
From AX = B, multiply on the left: X = AB. BA is not even defined when B is a single column and A is 3 × 3.
Common mistake
Stopping at |A| = 0
|A| = 0 only says there is no single solution. Check (adj A)B: if it is not O there is no solution; if it is O, look further, since there may be infinitely many solutions or none.
Common mistake
Taking the wrong columns as A
Each row of A holds the coefficients of one equation, in the same order of unknowns. In Example 3, y + 3z = 11 has no x, so its row is 0, 1, 3, not 1, 3, 0.
Quick revision summary
- A system is consistent if it has a solution (one or more) and inconsistent if it has none.
- Write the system as AX = B. If |A| ≠ 0, the only solution is X = AB (the matrix method).
- If |A| = 0: (adj A)B ≠ O means no solution; (adj A)B = O means infinitely many solutions or none.
Formula sheet
- AX = B, with A the coefficient matrix
- X = AB = (1/|A|)(adj A)B, for |A| ≠ 0
- |A| = 0 and (adj A)B ≠ O: inconsistent
Questions students ask
Is Cramer’s rule in NCERT Class 12 and the JEE Main 2027 syllabus?
Cramer’s rule is not taught in NCERT Class 12 Mathematics: the 2026–27 reprint solves systems only by the matrix method, X = AB, in Section 4.6 (pages 93–98). The JEE Main 2027 syllabus, Unit 3, does not name it either; it lists the “Test of consistency and solution of simultaneous linear equations in two or three variables using matrices”. Cramer’s rule gives the same solution written with determinants, since the entries of (adj A)B are Cramer’s determinants D, D, D, so it is the matrix method in another form.
What is the difference between Cramer’s rule and the matrix method?
Beyond the NCERT text, Cramer’s quotient formulas and the inverse-matrix method both require |A| ≠ 0 and give the same solution, but the matrix method finds the whole inverse A and multiplies it by B, while Cramer’s rule finds each unknown alone as a ratio of determinants, x = D/|A|, D being |A| with column 1 replaced by the constants. For 5x − 2y = 1 and 2x + 3y = 8, |A| = 15 + 4 = 19, D = 1 × 3 − (−2) × 8 = 19 and D = 5 × 8 − 2 × 1 = 38, so x = 1 and y = 2. When |A| = 0, Cramer’s rule can only show that there is no solution (some D ≠ 0); if every D is 0, the system needs further checks, as in the case (adj A)B = O.
What are dependent and independent equations in a system of linear equations?
Beyond the NCERT text, an equation is called dependent on the others when it is a sum of multiples of them, adding no new condition, and equations none of which is such a sum are independent (Wikipedia, “System of linear equations”); for three equations in three unknowns, the left-hand sides are independent exactly when |A| ≠ 0, which gives one solution. In x + 2y + z = 7, 2x + y − z = 2 and 3x + 3y = 9, the third equation is the sum of the first two, so |A| = 0 and there are infinitely many solutions, x = t − 1, y = 4 − t, z = t for every t. With 3x + 3y = 8 instead, its left side is still the sum of the other two but 8 ≠ 7 + 2, so there is no solution.
What is the difference between homogeneous and non-homogeneous systems of linear equations?
Beyond the NCERT text, a homogeneous system has every constant term 0, AX = O, and unlike a non-homogeneous one, AX = B with B ≠ O, it is never inconsistent, because X = O, the trivial solution, always works; for n equations in n unknowns, other solutions exist exactly when |A| = 0. So to give such a system a non-trivial solution, choose its unknown coefficient to make |A| = 0. For x + y + z = 0, 2x − y + kz = 0 and x + 2y − z = 0, |A| = 8 − k, so k = 8 gives the non-trivial solutions x = −3t, y = 2t, z = t, while every other k leaves only x = y = z = 0.
Practice questions
Try each question first, then open the answer to check your working.
-
Q1. Examine the consistency of (i) x + 2y = 2, 2x + 3y = 3; (ii) 2x − y = 5, x + y = 4 (NCERT Exercise 4.5, Q1 and Q2).
Show answerHide answer
(i) |A| = 3 − 4 = −1 ≠ 0, so the system is consistent, with the one solution x = 0, y = 1. (ii) |A| = 2 + 1 = 3 ≠ 0, so it is consistent, with x = 3, y = 1.
-
Q2. Solve 5x + 2y = 4 and 7x + 3y = 5 by the matrix method (NCERT Exercise 4.5, Q7).
Show answerHide answer
|A| = 15 − 14 = 1, so A has rows 3, −2 and −7, 5. X = AB has entries 12 − 10 = 2 and −28 + 25 = −3: x = 2, y = −3.
-
Q3. Solve x − y + z = 4, 2x + y − 3z = 0, x + y + z = 2 by the matrix method (NCERT Exercise 4.5, Q12).
Show answerHide answer
|A| = 1(1 + 3) + 1(2 + 3) + 1(2 − 1) = 10. adj A has rows 4, 2, 2; −5, 0, 5; 1, −2, 3, and (adj A)B has entries 16 + 0 + 4 = 20, −20 + 0 + 10 = −10 and 4 + 0 + 6 = 10. Dividing by 10: x = 2, y = −1, z = 1.
-
Q4. 4 kg onion, 3 kg wheat and 2 kg rice cost ₹60; 2 kg onion, 4 kg wheat and 6 kg rice cost ₹90; 6 kg onion, 2 kg wheat and 3 kg rice cost ₹70. Find the cost of each per kg by the matrix method (NCERT Exercise 4.5, Q16).
Show answerHide answer
With prices x, y, z per kg: 4x + 3y + 2z = 60, 2x + 4y + 6z = 90, 6x + 2y + 3z = 70. |A| = 4(12 − 12) − 3(6 − 36) + 2(4 − 24) = 0 + 90 − 40 = 50, and X = (1/50)(adj A)B gives x = 5, y = 8, z = 8: onion ₹5, wheat ₹8 and rice ₹8 per kg.