Skip to main content

Solution methods of linear equations with examples

Short answer

Direct methods (Gauss elimination, LU decomposition) give exact solutions after fixed operations, suitable for small systems. Iterative methods (Jacobi, Gauss-Seidel, conjugate gradient) refine an initial guess, preserving sparsity for large systems. Example: Gauss elimination on 2x+y=5, x+3y=10 yields y=3, x=1.

Explain the solution methods of solving a system of linear equations with examples.

A system [A]{x}={b}[A]\{x\}=\{b\} is solved by direct or iterative methods.

Direct methods

They give the exact answer (apart from round-off) after a fixed number of operations.

  • Gauss elimination: reduce AA to upper triangular form, then back-substitute.
  • LU decomposition / Cholesky (A=LLTA=LL^T for symmetric positive definite matrices): factor once, then solve for several right-hand sides.
  • Gauss-Jordan and matrix inverse.

Example: 2x+y=5, x+3y=102x+y=5,\ x+3y=10. Eliminating, R2→R2−12R1R_2\to R_2-\tfrac12R_1 gives 2.5y=7.52.5y=7.5, so y=3y=3, x=1x=1.

Iterative methods

Start from a guess and improve it until the change is small. They suit large sparse systems.

  • Jacobi: xi(k+1)=1aii(bi−∑j≠iaijxj(k))x_i^{(k+1)}=\dfrac{1}{a_{ii}}\Big(b_i-\sum_{j\ne i}a_{ij}x_j^{(k)}\Big)
  • Gauss-Seidel: same but uses new values immediately.
  • SOR: Gauss-Seidel with relaxation factor ω\omega.
  • Conjugate gradient: minimises 12xTAx−bTx\tfrac12x^TAx-b^Tx for symmetric positive definite AA.

Example (Gauss-Seidel): 4x+y=9, x+3y=74x+y=9,\ x+3y=7, start (0,0)(0,0).

  • Iteration 1: x=9/4=2.25x=9/4=2.25, y=(7−2.25)/3=1.583y=(7-2.25)/3=1.583.
  • Iteration 2: x=(9−1.583)/4=1.854x=(9-1.583)/4=1.854, y=(7−1.854)/3=1.715y=(7-1.854)/3=1.715.

The values move to the exact solution x=20/11=1.818x=20/11=1.818, y=19/11=1.727y=19/11=1.727.

Comparison

DirectIterative
Fixed operations, exactApproximate, needs convergence
Fill-in destroys sparsityKeeps sparsity, low memory
Best for small/medium systemsBest for very large sparse systems

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computational Techniques in Civil Engineering chapter 2 questions →