UNIHIVE

Study Hub UNIPORT ENG 303

ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)

Linear systems: Gaussian elimination, LU and determinants

Gaussian elimination with back substitution, partial pivoting, LU decomposition, determinants and operation counts.

Our notes

2 min read

The problem

Solve Ax = b, for example node voltages in a circuit, forces in a truss, or flows in a pipe network. Cramer's rule is fine for 2 × 2 but far too slow for large systems.

Gaussian elimination

Use row operations to reduce A to an upper triangular matrix, then back substitute.
Worked example.
2x + y − z = 8
−3x − y + 2z = −11
−2x + y + 2z = −3

  • R₂ ← R₂ + 1.5R₁: 0.5y + 0.5z = 1.
  • R₃ ← R₃ + R₁: 2y + z = 5.
  • R₃ ← R₃ − 4R₂: −z = 1, so z = −1.
  • Back substitute: 0.5y + 0.5(−1) = 1 gives y = 3; 2x + 3 − (−1) = 8 gives x = 2.

Check in equation 3: −4 + 3 − 2 = −3. ✓

Partial pivoting

Before eliminating a column, swap rows so the entry with the largest absolute value in that column becomes the pivot. This avoids dividing by zero or tiny numbers and keeps round-off small. (In the example, pivoting would first swap rows 1 and 2, since |−3| > |2|; the answer is the same.)

LU decomposition

Write A = LU, with L lower triangular (1s on the diagonal, the multipliers below it) and U the upper triangular matrix from elimination. For the example:
L = [1, 0, 0; −1.5, 1, 0; −1, 4, 1], U = [2, 1, −1; 0, 0.5, 0.5; 0, 0, −1].
(The multipliers are the negatives of the numbers used in the row operations: R₂ + 1.5R₁ means l₂₁ = −1.5.) Solve Ly = b by forward substitution, then Ux = y. LU is efficient when the same A is solved with many right-hand sides b.

Determinants

det A = product of the diagonal of U (times −1 for each row swap). Here det A = 2 × 0.5 × (−1) = −1; expanding by cofactors gives the same: 2(−2 − 2) − 1(−6 + 4) − 1(−3 − 2) = −8 + 2 + 5 = −1. ✓

Cost

Elimination takes about (2/3)n³ operations for n equations. For n = 1,000, that is about 6.7 × 10⁸: under a second on a laptop. Cramer's rule with cofactor determinants would be hopeless.

Ill-conditioning

If small changes in A or b cause large changes in x, the system is ill-conditioned (nearly singular; the condition number is large). No method can fully cure it; use more precision and check the model.

Exams usually ask: solve a 3 × 3 system by Gaussian elimination with back substitution; explain and apply partial pivoting; find L and U; compute a determinant from U.

Common mistake: applying a row operation to A but forgetting the right-hand side. Always work on the augmented matrix [A | b].

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All ENG 303 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.