---
title: "Solution methods of linear equations with examples"
subject: "Computational Techniques in Civil Engineering"
chapter: 2
key: "semester_8/computational_techniques_in_civil_engineering:solution-methods-linear-examples"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/solution-methods-linear-examples
site: BCT Engineering
---

# Solution methods of linear equations with examples

Computational Techniques in Civil Engineering · Chapter 2: Solutions of linear equations

- Asked in: 2079 Jestha, 8 marks
- Video: [Introduction to Linear Algebra: Systems of Linear Equations](https://www.youtube.com/watch?v=csgNflj69-Y) — Professor Dave Explains
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/solution-methods-linear-examples
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-2

## Question

Explain the solution methods of solving a system 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.

## Answer

A system $[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 $A$ to upper triangular form, then back-substitute.
- **LU decomposition / Cholesky ($A=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=10$. Eliminating, $R_2\to R_2-\tfrac12R_1$ gives $2.5y=7.5$, so $y=3$, $x=1$.

#### Iterative methods
Start from a guess and improve it until the change is small. They suit large sparse systems.
- **Jacobi:** $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 $\tfrac12x^TAx-b^Tx$ for symmetric positive definite $A$.

Example (Gauss-Seidel): $4x+y=9,\ x+3y=7$, start $(0,0)$.
- Iteration 1: $x=9/4=2.25$, $y=(7-2.25)/3=1.583$.
- Iteration 2: $x=(9-1.583)/4=1.854$, $y=(7-1.854)/3=1.715$.

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

#### Comparison

| Direct | Iterative |
|---|---|
| Fixed operations, exact | Approximate, needs convergence |
| Fill-in destroys sparsity | Keeps sparsity, low memory |
| Best for small/medium systems | Best for very large sparse systems |

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What distinguishes direct methods?
   A. Exact (up to round-off) after a fixed number of operations
   B. Need an initial guess
   C. Need diagonal dominance
   D. Converge in unknown iterations
   Answer: A. Iterative methods use guesses and tolerance. (Key point: Direct vs iterative)

2. How does Gauss-Seidel differ from Jacobi?
   A. It uses only previous values
   B. It needs a symmetric matrix
   C. It uses a relaxation factor 1<omega<2
   D. It uses newly computed values immediately
   Answer: D. Jacobi uses only old values. (Key point: Gauss-Seidel vs Jacobi)

3. For 2x + y = 5, x + 3y = 10, what are x and y?
   A. x = 3, y = 1
   B. x = 2, y = 1
   C. x = 1, y = 3
   D. x = 1, y = 2
   Answer: C. R2 - R1/2 gives 2.5y = 7.5, y = 3, x = 1. (Key point: Gauss elimination example)

4. Which is better for very large sparse systems?
   A. Direct methods, since fill-in preserves sparsity
   B. Iterative methods, since they keep sparsity and use low memory
   C. Matrix inverse
   D. Cramer's rule
   Answer: B. Direct elimination fill-in destroys sparsity. (Key point: Large systems)

## Related in Computational Techniques in Civil Engineering

- [Linear solution techniques; CG two iterations](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asolution-techniques-cg-numerical-two-iter) — Computational Techniques in Civil Engineering, chapter 2
- [Linear solution techniques; CG algorithm](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asolution-techniques-cg-algorithm) — Computational Techniques in Civil Engineering, chapter 2
- [Iterative methods for linear equations](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Aiterative-methods-linear-equations) — Computational Techniques in Civil Engineering, chapter 2
- [Numerical solution techniques, advantages and suitability](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Anumerical-solution-techniques-compare) — Computational Techniques in Civil Engineering, chapter 1, asked 4×
- [Characteristic form FD solution (velocity, pressure)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acharacteristic-fd-velocity-pressure) — Computational Techniques in Civil Engineering, chapter 6, asked 2×
- [Non-linear kinematic wave, trapezoidal river](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Akinematic-wave-trapezoidal-river) — Computational Techniques in Civil Engineering, chapter 5

## Related in other subjects

- [Consistency of a linear system](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Aconsistency-of-a-linear-system-nine) — Mathematics III, chapter 1
- [Linear system solvable for which λ](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Alinear-system-solvable-for-which) — Mathematics III, chapter 1
- [Two-mass system equations, X2/F, F-I and F-V analogies](https://www.bctengineer.com/question.md?key=semester_3%2Fcontrol_systems%3Ade-tf-fi-fv-m1-m2) — Control Systems, chapter 2
- [Consistency of a linear system](https://www.bctengineer.com/question.md?key=semester_3%2Fmathematics_iii%3Aconsistency-of-a-linear-system-three) — Mathematics III, chapter 1, asked 9×
