Writing a system as AX = B
Before you start: you need the rank of a matrix and row reduction.
Three equations in three unknowns, such as
\[x + y + z = 6,\quad x - y + z = 2,\quad 2x + y - z = 1\]
can be packed into one matrix equation \(AX = B\):
\[\underbrace{\begin{bmatrix} 1 & 1 & 1 \\ 1 & -1 & 1 \\ 2 & 1 & -1 \end{bmatrix}}_{A}\,\begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 6 \\ 2 \\ 1 \end{bmatrix}\]
\(A\) is the coefficient matrix, \(X\) the column of unknowns and \(B\) the column of constants. Put \(B\) next to \(A\) as an extra column and you get the augmented matrix \([A \mid B]\). All the work happens on \([A \mid B]\).
If \(B = 0\) the system is homogeneous; otherwise it is non-homogeneous.
Consistency: when is there a solution?
A system is consistent if it has at least one solution and inconsistent if it has none. The ranks of \(A\) and \([A \mid B]\) decide which, with no guessing. This is the Rouché–Capelli theorem.
| Ranks | Result |
|---|---|
| \(\rho(A) \ne \rho([A \mid B])\) | No solution (inconsistent) |
| \(\rho(A) = \rho([A \mid B]) = n\) | Exactly one solution |
| \(\rho(A) = \rho([A \mid B]) = r < n\) | Infinitely many, with \(n - r\) free parameters |
Homogeneous system AX = 0
Always consistent, because \(X = 0\) works. It has a non-trivial solution if and only if \(\rho(A) < n\). For a square \(A\), that means \(|A| = 0\).
Why it works: after row reduction, a row like \([\,0\;\;0\;\;0 \mid 1\,]\) says \(0 = 1\). That row exists exactly when the augmented matrix has one more non-zero row than \(A\). If it doesn't exist, each non-zero row fixes one unknown, and any unknowns left over are free.
Gauss elimination, step by step
- Write \([A \mid B]\).
- Row-reduce to echelon form, using row operations only. Never use column operations here: they would mix up the unknowns.
- Read off the two ranks and decide: none, one, or infinitely many.
- Back-substitute. Solve the last non-zero row first, then work upwards. If there are free unknowns, set each one equal to a parameter such as \(t\).
- Check your answer in one of the original equations.
Solved examples
Example 1: A unique solution
EasySolve \(x + y + z = 6\), \(x - y + z = 2\), \(2x + y - z = 1\) by Gauss elimination.
- \[[A \mid B] = \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 1 & -1 & 1 & 2 \\ 2 & 1 & -1 & 1 \end{array}\right]\]
- \(R_2 \to R_2 - R_1\), \(R_3 \to R_3 - 2R_1\): \[\sim \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -2 & 0 & -4 \\ 0 & -1 & -3 & -11 \end{array}\right]\]
- \(R_3 \to 2R_3 - R_2\): \[\sim \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -2 & 0 & -4 \\ 0 & 0 & -6 & -18 \end{array}\right]\]
- \(\rho(A) = \rho([A \mid B]) = 3 = n\), so there is exactly one solution.
- Back-substitute: \(-6z = -18\) gives \(z = 3\); \(-2y = -4\) gives \(y = 2\); \(x = 6 - 2 - 3 = 1\).
Answer\(x = 1,\ y = 2,\ z = 3\)
Example 2: Infinitely many solutions
MediumSolve \(x + 2y + 3z = 6\), \(2x + 3y + 4z = 9\), \(3x + 4y + 5z = 12\).
- \(R_2 \to R_2 - 2R_1\), \(R_3 \to R_3 - 3R_1\): \[\sim \left[\begin{array}{ccc|c} 1 & 2 & 3 & 6 \\ 0 & -1 & -2 & -3 \\ 0 & -2 & -4 & -6 \end{array}\right]\]
- \(R_3 \to R_3 - 2R_2\): \[\sim \left[\begin{array}{ccc|c} 1 & 2 & 3 & 6 \\ 0 & -1 & -2 & -3 \\ 0 & 0 & 0 & 0 \end{array}\right]\]
- \(\rho(A) = \rho([A \mid B]) = 2 < 3\): infinitely many solutions with \(3 - 2 = 1\) free unknown.
- Let \(z = t\). Row 2: \(-y - 2t = -3\), so \(y = 3 - 2t\). Row 1: \(x = 6 - 2(3 - 2t) - 3t = t\).
Answer\(x = t,\ y = 3 - 2t,\ z = t\) for any real \(t\). For example \(t = 1\) gives \((1, 1, 1)\).
Example 3: No solution
MediumTest for consistency: \(x + y + z = 3\), \(x + 2y + 3z = 4\), \(2x + 3y + 4z = 8\).
- \(R_2 \to R_2 - R_1\), \(R_3 \to R_3 - 2R_1\): \[\sim \left[\begin{array}{ccc|c} 1 & 1 & 1 & 3 \\ 0 & 1 & 2 & 1 \\ 0 & 1 & 2 & 2 \end{array}\right]\]
- \(R_3 \to R_3 - R_2\): \[\sim \left[\begin{array}{ccc|c} 1 & 1 & 1 & 3 \\ 0 & 1 & 2 & 1 \\ 0 & 0 & 0 & 1 \end{array}\right]\]
- The last row says \(0 = 1\). \(\rho(A) = 2\) but \(\rho([A \mid B]) = 3\).
AnswerInconsistent: no solution.
Example 4: Homogeneous, trivial solution only
EasyDoes \(x + 2y + 3z = 0\), \(y + 4z = 0\), \(5x + 6y = 0\) have a non-trivial solution?
- \(|A| = \begin{vmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 5 & 6 & 0 \end{vmatrix} = 1(0 - 24) - 2(0 - 20) + 3(0 - 5) = 1\).
- \(|A| \ne 0\), so \(\rho(A) = 3 = n\).
AnswerNo. The only solution is \(x = y = z = 0\).
Example 5: Homogeneous, non-trivial solution
MediumSolve \(x + y + z = 0\), \(x + 2y + 3z = 0\), \(2x + 3y + 4z = 0\).
- Reduce \(A\) (the augmented column is all zeros, so leave it out): \[\begin{bmatrix} 1 & 1 & 1 \\ 1 & 2 & 3 \\ 2 & 3 & 4 \end{bmatrix} \sim \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 1 & 2 \end{bmatrix} \sim \begin{bmatrix} 1 & 1 & 1 \\ 0 & 1 & 2 \\ 0 & 0 & 0 \end{bmatrix}\]
- \(\rho(A) = 2 < 3\): non-trivial solutions exist, with one free unknown.
- Let \(z = t\). Then \(y = -2t\) and \(x = -y - z = t\).
Answer\(x = t,\ y = -2t,\ z = t\)
Example 6: Values of λ and μ
Exam levelFor what values of \(\lambda\) and \(\mu\) does the system \(x + y + z = 6\), \(x + 2y + 3z = 10\), \(x + 2y + \lambda z = \mu\) have (i) no solution, (ii) a unique solution, (iii) infinitely many solutions?
- \(R_2 \to R_2 - R_1\), \(R_3 \to R_3 - R_1\), then \(R_3 \to R_3 - R_2\): \[[A \mid B] \sim \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & 2 & 4 \\ 0 & 0 & \lambda - 3 & \mu - 10 \end{array}\right]\]
- If \(\lambda \ne 3\): \(\rho(A) = \rho([A \mid B]) = 3\). Unique solution, whatever \(\mu\) is.
- If \(\lambda = 3\) and \(\mu \ne 10\): the last row reads \(0 = \mu - 10 \ne 0\), so \(\rho(A) = 2\), \(\rho([A \mid B]) = 3\). No solution.
- If \(\lambda = 3\) and \(\mu = 10\): both ranks are 2. Infinitely many solutions: \(z = t\), \(y = 4 - 2t\), \(x = 2 + t\).
Answer(i) \(\lambda = 3,\ \mu \ne 10\); (ii) \(\lambda \ne 3\); (iii) \(\lambda = 3,\ \mu = 10\).
Example 7: A homogeneous system with a parameter
Exam levelFind the values of \(k\) for which \(x + ky + 3z = 0\), \(4x + 3y + kz = 0\), \(2x + y + 2z = 0\) has a non-trivial solution, and solve it for each.
- Non-trivial solution \(\iff |A| = 0\): \[\begin{vmatrix} 1 & k & 3 \\ 4 & 3 & k \\ 2 & 1 & 2 \end{vmatrix} = (6 - k) - k(8 - 2k) + 3(4 - 6) = 2k^2 - 9k\]
- \(2k^2 - 9k = k(2k - 9) = 0\), so \(k = 0\) or \(k = \tfrac{9}{2}\).
- \(k = 0\): \(x + 3z = 0\) and \(4x + 3y = 0\). With \(z = t\): \(x = -3t\), \(y = 4t\). Check in the third equation: \(-6t + 4t + 2t = 0\). ✓
- \(k = \tfrac{9}{2}\): solving the first and third equations gives \(x : y : z = 3 : 2 : -4\). Check in the second: \(12 + 6 - 18 = 0\). ✓
Answer\(k = 0\): \((x, y, z) = t(-3, 4, 1)\). \(k = \tfrac{9}{2}\): \((x, y, z) = t(3, 2, -4)\).
In a \(\lambda, \mu\) question, aim to get the unknown letters into the last row only. Then read the answer off that row: the coefficient of \(z\) decides unique or not, and the right-hand side decides none or infinitely many.
Common mistakes
1. Checking only \(\rho(A)\)
In Example 3, \(\rho(A) = 2 < 3\), and it is tempting to say "infinitely many solutions". Wrong: you must compare with \(\rho([A \mid B]) = 3\). Different ranks mean no solution at all.
2. Saying a homogeneous system has no solution
\(AX = 0\) always has \(X = 0\). The real question is whether it has a non-trivial solution, which needs \(\rho(A) < n\).
3. Forgetting the \(\mu\) part of the answer
When \(\lambda = 3\) in Example 6, the answer is not decided yet. It splits into \(\mu \ne 10\) (no solution) and \(\mu = 10\) (infinitely many). Write both cases.
Practice questions
Try each one on paper before you open the answer.
Q1Solve \(x + y + z = 9\), \(2x + 5y + 7z = 52\), \(2x + y - z = 0\).
Echelon form gives \(z = 5\), then \(y = 3\), \(x = 1\). Check: \(2 + 15 + 35 = 52\). ✓
Q2Show that \(x + 2y - z = 3\), \(3x - y + 2z = 1\), \(2x - 2y + 3z = 2\), \(x - y + z = -1\) is consistent and solve it.
Four equations, three unknowns. Row reduction gives \(\rho(A) = \rho([A \mid B]) = 3\) (the fourth row becomes zero), so there is one solution: \(x = -1,\ y = 4,\ z = 4\).
Q3Test for consistency: \(x + y + z = 2\), \(2x + 2y + 2z = 5\), \(x - y + z = 1\).
\(R_2 - 2R_1\) gives \([\,0\;\;0\;\;0 \mid 1\,]\). \(\rho(A) = 2\), \(\rho([A \mid B]) = 3\). Inconsistent.
Q4Solve \(x + 3y - 2z = 0\), \(2x - y + 4z = 0\), \(x - 11y + 14z = 0\).
\(\rho(A) = 2\). With \(z = 7t\): \(y = 8t\), \(x = -10t\). So \((x, y, z) = t(-10, 8, 7)\).
Q5Discuss \(2x + 3y + 5z = 9\), \(7x + 3y - 2z = 8\), \(2x + 3y + \lambda z = \mu\) for all \(\lambda, \mu\).
\(R_3 - R_1\) gives \([\,0\;\;0\;\;\lambda - 5 \mid \mu - 9\,]\). Unique if \(\lambda \ne 5\); no solution if \(\lambda = 5,\ \mu \ne 9\); infinitely many if \(\lambda = 5,\ \mu = 9\).
Q6Find \(k\) so that \(kx + y + z = 0\), \(x + ky + z = 0\), \(x + y + kz = 0\) has a non-trivial solution.
\(|A| = k^3 - 3k + 2 = (k - 1)^2(k + 2)\). So \(k = 1\) or \(k = -2\).
Bring it to a free demo class and work through it with Vipul Sir. Book on WhatsApp.
Frequently asked questions
How do you know if a system of linear equations is consistent?
Reduce the augmented matrix \([A \mid B]\) to echelon form. The system is consistent if and only if \(\rho(A) = \rho([A \mid B])\).
When does a system have infinitely many solutions?
When \(\rho(A) = \rho([A \mid B]) = r\) and \(r\) is less than the number of unknowns \(n\). There are \(n - r\) free parameters.
When does a homogeneous system have a non-trivial solution?
When \(\rho(A) < n\). For a square coefficient matrix, that is the same as \(|A| = 0\).
Is Gauss elimination the same as Cramer's rule?
No. Cramer's rule uses determinants and only works when \(A\) is square with \(|A| \ne 0\). Gauss elimination works for any system and also tells you when there is no solution or infinitely many.