The math optional, made finite. Daily Practice

Gaussian Elimination

At a Glance

Why This Chapter Matters

Gaussian elimination is the workhorse algorithm for solving linear systems and is tested as a direct computation — write the augmented matrix, apply row operations to reach upper-triangular form, then back-substitute. UPSC 2022 set a 3×33 \times 3 or 4×44 \times 4 system; the marks are earned by showing each elimination step clearly, not just writing the answer.

Minimum Theory

Problem. Solve Ax=bAx = b where AA is n×nn \times n and non-singular.

Augmented matrix. Write [Ab][A \mid b] and apply elementary row operations:

RiRimijRj,mij=aijajjR_i \leftarrow R_i - m_{ij}\, R_j, \quad m_{ij} = \frac{a_{ij}}{a_{jj}}

The scalar mijm_{ij} is the multiplier for eliminating entry (i,j)(i,j) using row jj as the pivot row.

Forward elimination. For j=1,2,,n1j = 1, 2, \ldots, n-1 (pivot columns):

After n1n-1 stages the system is upper triangular: Ux=cUx = c.

Back substitution. Solve from the last equation upward:

xn=cnunn,xi=1uii ⁣(cik=i+1nuikxk),i=n1,,1x_n = \frac{c_n}{u_{nn}}, \qquad x_i = \frac{1}{u_{ii}}\!\left(c_i - \sum_{k=i+1}^{n} u_{ik}\, x_k\right), \quad i = n-1, \ldots, 1

Operation count.

Partial pivoting. Before eliminating column jj, find the row rjr \ge j with the largest arj(j)|a_{rj}^{(j)}| and swap rows rr and jj. This prevents division by a small pivot and improves numerical stability. UPSC problems on small integer systems do not require pivoting, but mentioning it earns method marks.

Distinction from Gauss–Jordan. Gaussian elimination stops at upper-triangular form and uses back substitution. Gauss–Jordan continues to reduced row echelon form (zeros above and below each pivot), obtaining xx directly without back substitution. UPSC tests these as separate atoms.

Question Archetypes

ArchetypeRecognition
solve-systemSolve a given 3×33\times3 or 4×44\times4 system; show elimination steps
identify-methodDistinguish Gaussian elimination from Gauss–Jordan or LU decomposition

solve-system (1 question; 2022)

Recognition Cues

Solution Template

  1. Write the augmented matrix [Ab][A \mid b].
  2. Use R1R_1 as pivot row; eliminate x1x_1 from rows 2 and 3 (and 4 if 4×44\times4).
  3. Use R2R_2 (updated) as pivot row; eliminate x2x_2 from remaining rows below.
  4. Continue until upper triangular.
  5. Back-substitute from the bottom row upward; box each xix_i.

Worked Example

2022 Paper 2, 2022-P2-Q2a (10 marks)

Solve the system using Gaussian elimination:

2x+yz=82x + y - z = 8

3xy+2z=11-3x - y + 2z = -11

2x+y+2z=3-2x + y + 2z = -3

Augmented matrix.

[Ab]=[2118312112123][A \mid b] = \begin{bmatrix} 2 & 1 & -1 & \bigm| & 8 \\ -3 & -1 & 2 & \bigm| & -11 \\ -2 & 1 & 2 & \bigm| & -3 \end{bmatrix}

Stage 1 — eliminate xx from rows 2 and 3 using row 1 as pivot.

Multipliers: m21=3/2m_{21} = -3/2, m31=2/2=1m_{31} = -2/2 = -1.

R2R2(32)R1=R2+32R1R_2 \leftarrow R_2 - \left(-\tfrac{3}{2}\right)R_1 = R_2 + \tfrac{3}{2}R_1

Row 2: [3+32(2), 1+32(1), 2+32(1)  11+32(8)]=[0, 12, 12  1]\text{Row 2: } \left[-3 + \tfrac{3}{2}(2),\ -1 + \tfrac{3}{2}(1),\ 2 + \tfrac{3}{2}(-1)\ \bigm|\ -11 + \tfrac{3}{2}(8)\right] = \left[0,\ \tfrac{1}{2},\ \tfrac{1}{2}\ \bigm|\ 1\right]

R3R3(1)R1=R3+R1R_3 \leftarrow R_3 - (-1)R_1 = R_3 + R_1

Row 3: [2+2, 1+1, 2+(1)  3+8]=[0, 2, 1  5]\text{Row 3: } [-2+2,\ 1+1,\ 2+(-1)\ \bigm|\ -3+8] = [0,\ 2,\ 1\ \bigm|\ 5]

Matrix after stage 1:

[21180121210215]\begin{bmatrix} 2 & 1 & -1 & \bigm| & 8 \\ 0 & \tfrac{1}{2} & \tfrac{1}{2} & \bigm| & 1 \\ 0 & 2 & 1 & \bigm| & 5 \end{bmatrix}

Stage 2 — eliminate yy from row 3 using row 2 as pivot.

Multiplier: m32=2/(1/2)=4m_{32} = 2 / (1/2) = 4.

R3R34R2R_3 \leftarrow R_3 - 4 R_2

Row 3: [0, 24(12), 14(12)  54(1)]=[0, 0, 1  1]\text{Row 3: } [0,\ 2-4(\tfrac{1}{2}),\ 1-4(\tfrac{1}{2})\ \bigm|\ 5-4(1)] = [0,\ 0,\ -1\ \bigm|\ 1]

Upper-triangular system:

[21180121210011]\begin{bmatrix} 2 & 1 & -1 & \bigm| & 8 \\ 0 & \tfrac{1}{2} & \tfrac{1}{2} & \bigm| & 1 \\ 0 & 0 & -1 & \bigm| & 1 \end{bmatrix}

Back substitution.

Row 3: z=1    z=1-z = 1 \implies z = -1.

Row 2: 12y+12(1)=1    12y=32    y=3\tfrac{1}{2}y + \tfrac{1}{2}(-1) = 1 \implies \tfrac{1}{2}y = \tfrac{3}{2} \implies y = 3.

Row 1: 2x+3(1)=8    2x=4    x=22x + 3 - (-1) = 8 \implies 2x = 4 \implies x = 2.

x=2,y=3,z=1\boxed{x = 2,\quad y = 3,\quad z = -1}

Verification. 2(2)+3(1)=82(2)+3-(-1)=8 ✓; 3(2)3+2(1)=11-3(2)-3+2(-1)=-11 ✓; 2(2)+3+2(1)=3-2(2)+3+2(-1)=-3 ✓.

Common Traps

Marks-Aware Writing

For 10 marks in Section A, the examiner expects: (i) the augmented matrix written explicitly, (ii) each row operation labelled with its multiplier, (iii) the resulting matrix after each stage, (iv) back substitution with each variable solved in turn, and (v) a verification line. Skipping to the answer without showing row operations will lose the bulk of the marks.

Practice Set

Only one historical question on this atom (shown above).

We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.