Skip to content
GATEiit

GATE CSE · Engineering Mathematics

Systems of linear equations

Writing a system as Ax = b, Gaussian elimination and echelon forms, the rank test for no, one or infinitely many solutions, homogeneous systems and the null space, Cramer's rule, and systems with a parameter.

Before you start

This topic comes before: Eigenvalues and eigenvectors, LU decomposition

Concept notes

1. Matrix form and Gaussian elimination

A system of m equations in n unknowns is written Ax=b, where A is the m×n coefficient matrix. The augmented matrix [A∣b] carries the right-hand side along.

Elementary row operations do not change the solution set:

  1. swap two rows;
  2. multiply a row by a non-zero constant;
  3. add a multiple of one row to another.

Gaussian elimination uses them to reach row echelon form: each row's first non-zero entry (the pivot) is to the right of the pivot above it, and zero rows are at the bottom. Then solve by back substitution from the last pivot row upwards.

Gauss-Jordan elimination goes further to reduced row echelon form (RREF): every pivot is 1 and is the only non-zero entry in its column. The solution can then be read off directly. The RREF of a matrix is unique.

Variables:

  • a column with a pivot gives a basic (pivot) variable;
  • a column without one gives a free variable, which can take any value;
  • the number of free variables is n−rank⁡A.

Cost: elimination on an n×n system takes about 23n3 arithmetic operations, that is O(n3), and back substitution takes O(n2).

Reading the final echelon form:

Last non-zero row of [A∣b] Meaning
(0  0  ⋯  0∣c) with c≠0 0=c: inconsistent, no solution
a pivot in every column of A unique solution
fewer pivots than unknowns, no 0=c row infinitely many solutions

2. The rank test for consistency

Let r=rank⁡A and r′=rank⁡ [A∣b]. Always r≤r′≤r+1.

Condition Solutions
r<r′ none (inconsistent)
r=r′=n exactly one
r=r′<n infinitely many, with n−r free parameters

Over the real numbers a linear system never has exactly two (or any finite number above one) solutions: if x1≠x2 both solve it, so does every point x1+t(x2−x1) on the line through them.

Square systems (m=n):

  • det⁡A≠0: a unique solution x=A−1b for every b.
  • det⁡A=0: either no solution or infinitely many, depending on b; use the rank test.

Shape shortcuts for A of size m×n:

  • m<n (more unknowns than equations): never a unique solution. Either none or infinitely many.
  • m>n: may be inconsistent for some b. If rank⁡A=n there is at most one solution.
  • rank⁡A=m (full row rank): consistent for every b.

Geometric picture: in two unknowns each equation is a line. Two lines meet in one point, are parallel (no solution), or coincide (infinitely many). In three unknowns each equation is a plane.

Unique solutionrank A = rank [A|b] = nNo solutionrank A < rank [A|b]Infinitely manyrank A = rank [A|b] < n
Two equations in two unknowns: the three possible outcomes and the rank condition for each.

3. Homogeneous systems and the solution structure

A homogeneous system Ax=0 is always consistent, since x=0 (the trivial solution) works.

  • It has a non-trivial solution if and only if rank⁡A<n.
  • For a square A: non-trivial solutions exist   ⟺  det⁡A=0.
  • If m<n (fewer equations than unknowns), non-trivial solutions always exist.

The solutions form a subspace, the null space of A. Its dimension, the nullity, is n−rank⁡A (rank-nullity theorem). A basis is found by setting each free variable to 1 in turn (others 0) and solving for the pivot variables.

Structure of the general solution. If xp is any one solution of Ax=b, then every solution is x=xp+xh,Axh=0. So the solution set of a consistent system is the null space shifted by xp. It has the same number of free parameters, n−r, whatever b is.

Consequences:

  • If Ax=0 has only the trivial solution, then Ax=b has at most one solution for each b.
  • If Ax=0 has non-trivial solutions, then Ax=b has either no solution or infinitely many.
  • The difference of two solutions of Ax=b solves Ax=0; the sum of two solutions solves Ax=2b, so the solution set of Ax=b with b≠0 is not a subspace.

4. Cramer's rule and systems with a parameter

Cramer's rule: if A is n×n and det⁡A≠0, then xi=det⁡Aidet⁡A, where Ai is A with column i replaced by b. It is handy for 2×2 and 3×3 systems or when only one unknown is asked. For large systems it is far slower than elimination.

Systems with a parameter (k, λ, μ) are the most common GATE form. Method:

  1. Row-reduce [A∣b] keeping the parameter symbolic. Avoid dividing by an expression that might be zero.
  2. The last row typically becomes (0    0    f(λ)∣g(λ,μ)).
  3. Read off the cases:
Last row Result
f(λ)≠0 unique solution
f(λ)=0 and g=0 infinitely many
f(λ)=0 and g≠0 no solution

For a square system there is a shortcut: compute det⁡A as a function of the parameter. Values with det⁡A≠0 give a unique solution. Only the roots of det⁡A=0 need the rank test.

A homogeneous system with a parameter has a non-trivial solution exactly at the roots of det⁡A=0. For example

Formulas to remember

Consistency (rank test)Necessary and sufficient for at least one solution
rank⁡A=rank⁡ [A∣b]
Number of free parameters
n−rank⁡A
Cramer's rule
xi=det⁡Aidet⁡A,det⁡A≠0
Unique solution of a square system
x=A−1b
General solution
x=xp+xh,Axh=0
Rank-nullity
dim⁡N(A)=n−rank⁡A

Common mistakes

  • Concluding 'no solution' from det⁡A=0; it could also mean infinitely many. Use the rank test.
  • Dividing by an expression like λ−2 during elimination without treating λ=2 separately.
  • Forgetting that a homogeneous system is always consistent.
  • Counting free parameters as m−r (equations) instead of n−r (unknowns).
  • Believing a linear system can have exactly two solutions.
  • Applying Cramer's rule when det⁡A=0.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Gaussian elimination with back substitution

numerical

Solve x+2y+z=8, 2x+y−z=1, 3x−y+2z=7.

  1. Step 1: Eliminate x from rows 2 and 3.

    Try it on paper first.

Example 2: Classifying a system with two parameters

numerical

For x+y+z=3, x+2y+2z=5, x+2y+λz=μ, find when the system has a unique solution, infinitely many, or none.

  1. Step 1: Reduce the augmented matrix.

    Try it on paper first.

Example 3: Null space of a wide homogeneous system

numerical

Find all solutions of x1+x2+x3+x4=0 and x1−x2+x3−x4=0.

  1. Step 1: Find the rank and the number of free variables.

    Try it on paper first.

Example 4: Cramer's rule for a 2 by 2 system

numerical

Solve 3x+2y=7, x−y=−1 by Cramer's rule.

  1. Step 1: Compute det A.

    Try it on paper first.

Previous year questions

9 official GATE CSE questions on this topic, newest first.

Practise these 9 PYQs →

Topic test

10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.