ENG 303 · Engineering Mathematics V (Numerical Methods and Computer Application)
Our notes
2 min readThe 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
-
Best pick Kaw, Numerical Methods with Applications: Gaussian elimination
Textbook chapter (PDF, about 0.4 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: Gaussian elimination, CC BY-NC-ND 4.0 · licence
-
NOUN MTH 213: Numerical Analysis I
NOUN course book (PDF, about 1.4 MB). Interpolation, linear systems (direct and iterative), eigenvalues, non-linear equations.
(opens nou.edu.ng in a new tab)
-
Kaw, Numerical Methods with Applications: LU decomposition
Textbook chapter (PDF, about 0.8 MB) with worked examples and a short quiz at the end.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications: LU decomposition, CC BY-NC-ND 4.0 · licence
-
Gaussian elimination
(opens en.wikipedia.org in a new tab)
Wikipedia, Gaussian elimination, CC BY-SA 4.0 · licence
-
LU decomposition
(opens en.wikipedia.org in a new tab)
Wikipedia, LU decomposition, CC BY-SA 4.0 · licence
-
Kaw, Numerical Methods with Applications (the whole free textbook)
Every chapter as a separate PDF (0.2 to 1.5 MB each), with videos and quizzes for each method.
(opens nm.mathforcollege.com in a new tab)
Kaw, Numerical Methods with Applications, Kaw, Numerical Methods with Applications (the whole free textbook), CC BY-NC-ND 4.0 · licence
Watch
-
Naive Gaussian elimination: Theory
12 min · ≈ 54 MB · about ₦30
(opens youtube.com in a new tab)
-
Chapter 04.06: Lesson: Naive Gaussian Elimination: Example: Part 1 of 2 (Forward Elimination)
11 min · ≈ 50 MB · about ₦28
(opens youtube.com in a new tab)
-
Chapter 04.07:Lesson: An Example of LU Decomposition Method of Solving Simultaneous Linear Equations
8 min · ≈ 36 MB · about ₦20
(opens youtube.com in a new tab)
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.