Linear Algebra • Problem-Solving & Modeling Tools

Choosing Solution Methods — Choosing Efficient Methods (Elimination vs Inverse vs Decomposition)

Learn when to use elimination, matrix inverses, or decomposition to solve systems of equations quickly and accurately.

Linear Algebra emblem with a matrix grid, a variable, and three-dimensional axes.
Inside this lesson 10 sections 5 questions 10 figures

SECTION 1

Historical Context & Motivation

People have been solving systems of equations for thousands of years. Ancient Chinese mathematicians recorded methods for solving multiple unknowns at once in a text called The Nine Chapters on the Mathematical Art around 200 BCE. Their approach looked a lot like what we now call elimination — systematically removing variables until you find each answer.

As math advanced, new tools appeared. Mathematicians realized that writing equations in grid-like arrangements called matrices (a matrix is a rectangular array of numbers) opened the door to powerful new techniques. Some methods are fast for small problems, while others shine when problems get enormous. Choosing the right method can mean the difference between solving a problem in seconds and waiting hours — or even days.

~200 BCE • Ancient Elimination Methods

Chinese mathematicians develop row-reduction techniques to solve systems of linear equations, recorded in The Nine Chapters on the Mathematical Art.

1810 • Gaussian Elimination Formalized

Carl Friedrich Gauss popularizes the systematic elimination method for solving systems, which becomes known as Gaussian elimination.

1855 • Matrix Inverses Developed

Arthur Cayley formalizes matrix algebra, including the concept of an inverse matrix — a matrix that 'undoes' another matrix, much like dividing undoes multiplication.

1938 • LU Decomposition Emerges

Tadeusz Banachiewicz and others develop LU decomposition, which breaks a matrix into simpler pieces. This becomes essential for efficient computation on early computers.

1960s–Today • Computers and Method Selection

With computers handling millions of equations, choosing the most efficient method becomes critical. Software like MATLAB and NumPy automatically selects strategies based on problem structure.

Today, we have three major families of solution methods: elimination, matrix inverses, and decomposition. The key question this lesson answers is: how do you pick the best one for a given problem?

SECTION 2

Core Principles & Definitions

Before choosing a method, you need to understand what each one does. All three methods solve the same basic problem: given a system of linear equations (a set of equations where each variable is raised to the first power only), find the values of the unknowns. The difference lies in how they find those values and how quickly they do it.

1

Elimination

Combine equations to cancel out variables one at a time. You work through the system step by step until each variable is isolated. Think of it like peeling layers off an onion.
2

Matrix Inverse

Find a special matrix that 'undoes' the coefficient matrix. Multiplying both sides of the equation by this inverse gives you the answer directly — like using a master key.
3

Decomposition

Break the original matrix into simpler matrices (like factoring a number into primes). Then solve two easier problems instead of one hard one. Great for large or repeated problems.
4

Efficiency Matters

A 2-equation system can be solved by any method in seconds. But a 1,000-equation system? The wrong method could take millions of extra calculations. Choosing wisely saves time and reduces errors.
✦

KEY TAKEAWAY

Imagine you need to get across town. You could walk (elimination — steady and reliable), take a taxi (inverse — fast but costs more setup), or ride a bus route that you've already planned (decomposition — efficient when you travel the same route often). No single option is always best; it depends on the situation.

SECTION 3

Visual Explanation — The Decision Flowchart

Which Method Should You Choose?Start: Ax = bHow many right-hand sides (b)?Just oneManyHow big is the system?SmallLargeElimination(Gaussian)Decomposition(LU)Need A⁻¹ explicitly?YesNoInverse(A⁻¹b)Decomposition(LU, reuse L & U)Rule of ThumbElimination for one-off small systems · Inverse when you need A⁻¹ · Decomposition for large or repeated solves
This flowchart guides you through the decision process. Start at the top with your system Ax = b and follow the arrows based on your situation: how many right-hand sides you have, how large the system is, and whether you need the inverse matrix itself.

The diagram above captures the main idea: there is no single 'best' method. The right choice depends on the size of the system, the number of times you need to solve it, and whether you need the inverse matrix for another purpose. As you work through more problems, this decision process will become second nature.

SECTION 4

Mathematical Framework

Every system of linear equations can be written in matrix form. Instead of writing out each equation separately, we pack the coefficients into a matrix A, the unknowns into a column vector x, and the constants into a column vector b.

MATRIX FORM OF A SYSTEM

Ax=bAx = b

A = coefficient matrix (the numbers in front of your variables), x = unknown vector (what you're solving for), b = constant vector (the numbers on the right side of the equals signs).

Method 1: Elimination (Gaussian Elimination)

In elimination, you perform row operations on the augmented matrix [A | b] (the coefficient matrix with the constants column attached). You add or subtract multiples of one row from another to create zeros below the diagonal. This transforms the system into a simpler triangular shape that you can solve by back-substitution — working from the bottom equation upward.

ELIMINATION OPERATION COUNT

Operations≈(2/3)n3Operations ≈ (2/3)n³

n = number of equations. For a 3×3 system, that's about 18 operations. For a 100×100 system, it's roughly 667,000.

Method 2: Matrix Inverse

If A has an inverse (written A⁻¹), you can multiply both sides of Ax = b by A⁻¹ to get x directly. The inverse is a special matrix such that A⁻¹ × A = I, where I is the identity matrix (a matrix with 1s on the diagonal and 0s everywhere else — it acts like the number 1 in multiplication).

INVERSE METHOD

x=A−1bx = A⁻¹b

Finding A⁻¹ takes about 2n³ operations — roughly three times as much work as elimination for a single solve. However, once you have A⁻¹, each new b vector only costs n² operations.

Method 3: Decomposition (LU Factorization)

Decomposition splits A into two triangular matrices: L (lower triangular, with zeros above the diagonal) and U (upper triangular, with zeros below the diagonal). Instead of solving one complex equation Ax = b, you solve two simpler ones: Ly = b (forward substitution) and Ux = y (back-substitution).

LU DECOMPOSITION

A=LU→Ly=b,thenUx=yA = LU → Ly = b, then Ux = y

The factoring step costs (2/3)n³ (same as elimination), but each additional solve with a new b costs only n² operations — a massive savings when you have many right-hand sides.

SECTION 5

Detailed Comparison — When Each Method Shines

Now that you know how each method works, let's compare them side by side. The chart below shows how the computational cost (number of arithmetic operations) grows with the size of the system. Think of computational cost as the 'price tag' of each method in terms of time and effort.

Operation Count Comparison (First Solve)System size (n × n)Operations25102050Inverse (~2n³)Elimination (~⅔n³)LU Decomp (~⅔n³ setup)
For a single solve, elimination and LU decomposition have similar costs. The inverse method costs roughly three times more. However, when you solve with many different b vectors, decomposition wins because the expensive setup is done only once.
FeatureEliminationInverseDecomposition (LU)
Setup cost~(2/3)n³~2n³~(2/3)n³
Each extra solve~(2/3)n³ (redo all work)~n² (just multiply)~n² (forward + back sub)
Best forOne-time small systemsNeeding A⁻¹ explicitlyLarge systems; repeated solves
Ease of hand calculationStraightforwardTedious for n > 2Moderate

Side-by-side comparison of solution methods

SECTION 6

Worked Example — Solving a 2×2 System Three Ways

Let's solve the same small system using all three methods so you can see how they compare. Our system is:

SYSTEM

2x+y=5,x+3y=72x + y = 5, x + 3y = 7

In matrix form: A = [[2, 1], [1, 3]], x = [[x], [y]], b = [[5], [7]].

Method A: Elimination

  1. 1

    Step 1 — Write the augmented matrix

    Place A and b side by side: [2 1 | 5] on row 1 and [1 3 | 7] on row 2.
  2. 2

    Step 2 — Eliminate x from row 2

    Replace row 2 with (row 2 − ½ × row 1). Row 2 becomes: [1 − 1, 3 − 0.5, 7 − 2.5] = [0, 2.5, 4.5].
  3. 3

    Step 3 — Back-substitute

    From row 2: 2.5y = 4.5, so y = 1.8. Substitute into row 1: 2x + 1.8 = 5, so 2x = 3.2, giving x = 1.6.
    x = 1.6, y = 1.8

Method B: Matrix Inverse

  1. 1

    Step 1 — Find the determinant of A

    det(A) = (2)(3) − (1)(1) = 6 − 1 = 5. Since det(A) ≠ 0, the inverse exists.
  2. 2

    Step 2 — Compute A⁻¹

    For a 2×2 matrix [[a, b], [c, d]], the inverse is (1/det) × [[d, −b], [−c, a]]. So A⁻¹ = (1/5) × [[3, −1], [−1, 2]] = [[0.6, −0.2], [−0.2, 0.4]].
  3. 3

    Step 3 — Multiply A⁻¹ × b

    x = A⁻¹b = [[0.6 × 5 + (−0.2) × 7], [(−0.2) × 5 + 0.4 × 7]] = [[3 − 1.4], [−1 + 2.8]] = [[1.6], [1.8]].
    x = 1.6, y = 1.8 ✓

Method C: LU Decomposition

  1. 1

    Step 1 — Factor A into L and U

    We want A = LU where L is lower triangular and U is upper triangular. Start with U as the result of elimination: U = [[2, 1], [0, 2.5]]. The multiplier we used was ½, so L = [[1, 0], [0.5, 1]].
  2. 2

    Step 2 — Solve Ly = b (forward substitution)

    [[1, 0], [0.5, 1]] × [[y₁], [y₂]] = [[5], [7]]. From row 1: y₁ = 5. From row 2: 0.5(5) + y₂ = 7, so y₂ = 4.5.
  3. 3

    Step 3 — Solve Ux = y (back-substitution)

    [[2, 1], [0, 2.5]] × [[x], [y]] = [[5], [4.5]]. From row 2: 2.5y = 4.5, so y = 1.8. From row 1: 2x + 1.8 = 5, so x = 1.6.
    x = 1.6, y = 1.8 ✓
💡

Notice

All three methods give the same answer! For this small 2×2 system, elimination was the quickest to carry out by hand. If we had ten different b vectors to solve, the inverse or LU methods would save us time because the setup work is reused.

SECTION 7

Strengths & Limitations

Each method has clear strengths and weaknesses. Understanding these trade-offs is the key to making smart choices. The table below summarizes what each method does well and where it struggles.

MethodStrengthsLimitations
EliminationSimple to learn and apply by hand. Works for any size system. No setup required — just start solving.Must redo all work if b changes. Round-off errors can accumulate in large systems without careful pivoting.
Matrix InverseOnce computed, any new b is solved instantly (just a matrix-vector multiplication). The inverse itself may be useful for analysis.Computing A⁻¹ is expensive (~2n³ operations). Not all matrices have inverses. Numerically less stable than elimination for large systems.
Decomposition (LU)Best of both worlds: setup cost similar to elimination, and each new b is cheap (n² operations). Standard in professional software.Slightly more complex to learn. Requires the matrix to be decomposable (some matrices need row swapping, handled by a 'permutation matrix' P).

Strengths and limitations of each method

✦

KEY TAKEAWAY

Think of it like choosing tools in a workshop. Elimination is your trusty hand saw — reliable for small jobs. The inverse is like a custom jig — it takes time to build, but then you can cut the same shape perfectly every time. LU decomposition is a power tool — a bit of setup, but once it's running, it handles big jobs fast.

SECTION 8

Connections to Advanced Topics

The three methods you've learned are the foundation for much more advanced techniques. As systems grow to thousands or millions of equations (common in engineering, data science, and physics simulations), mathematicians and computer scientists have developed specialized variations.

What You LearnedAdvanced VersionWhere It's Used
Gaussian eliminationGauss-Jordan elimination (reduces to identity matrix, not just triangular)Finding inverses, solving augmented systems
LU decompositionCholesky decomposition (for symmetric positive-definite matrices, twice as fast)Statistics, machine learning, physics simulations
Direct methods (all three)Iterative methods (approximate answers that improve with each step)Huge sparse systems (millions of equations)
Matrix inversePseudoinverse (handles non-square or singular matrices)Least-squares fitting, data regression

How today's methods connect to advanced linear algebra

Don't worry about mastering these advanced topics right now. The important thing is that the decision-making skills you're building — asking 'How big is the system? How many times do I solve it? What structure does the matrix have?' — are exactly the same questions professionals ask when choosing algorithms for real-world problems.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

A classmate says, 'The inverse method is always the best because once you have A⁻¹, solving is super fast.' Explain why this reasoning is incomplete. When would the inverse method not be the best choice?
Show answer
Your classmate is right that once A⁻¹ is computed, each new solve is fast (only n² operations). However, computing A⁻¹ itself takes about 2n³ operations — roughly three times more than elimination or LU decomposition for the initial solve. If you only need to solve the system once, elimination is cheaper. Also, for very large systems, computing the inverse can introduce more round-off errors than elimination with partial pivoting, making the answer less accurate.

Question 2: BASIC CALCULATION

Use Gaussian elimination to solve the system: 3x + 2y = 12 and x − y = 1.
Show answer
Write the augmented matrix: [3 2 | 12] and [1 −1 | 1]. Replace row 1 with (row 1 − 3 × row 2): [3 − 3, 2 − (−3), 12 − 3] = [0, 5, 9]. So from the new row 1: 5y = 9, giving y = 9/5 = 1.8. Substitute into row 2: x − 1.8 = 1, so x = 2.8. The solution is x = 2.8, y = 1.8.

Question 3: INTERMEDIATE

You have a 4×4 system Ax = b. You need to solve it for 20 different b vectors, but the matrix A stays the same. Compare the approximate total operation counts for (a) using elimination 20 times and (b) using LU decomposition once and then solving 20 times. Which is more efficient?
Show answer
For n = 4, elimination costs roughly (2/3)(4³) = (2/3)(64) ≈ 43 operations per solve. Doing this 20 times: 20 × 43 ≈ 860 operations. For LU decomposition, the setup costs the same ~43 operations (factoring A into L and U). Each subsequent solve costs about n² = 16 operations. Total: 43 + 20 × 16 = 43 + 320 = 363 operations. LU decomposition is about 2.4 times faster. The savings grow dramatically as n and the number of solves increase.

Question 4: APPLIED

A weather simulation models temperature at 500 grid points. The physics produces a 500×500 system of equations that must be solved at every time step (there are 1,000 time steps). The coefficient matrix A stays the same across all time steps, but the right-hand side b changes each step. Which solution method would you recommend and why?
Show answer
LU decomposition is the clear winner here. The setup cost is (2/3)(500³) ≈ 83 million operations, done only once. Each of the 1,000 subsequent solves costs about 500² = 250,000 operations, totaling 250 million operations for the solves. Grand total: about 333 million operations. If you used elimination for each time step, the cost would be 1,000 × 83 million = 83 billion operations — roughly 250 times more work. The inverse method would also work (setup cost ~2 × 500³ ≈ 250 million, plus 1,000 × 250,000 = 250 million for solves), but it's less numerically stable than LU decomposition and has a higher setup cost.

Question 5: CRITICAL THINKING

Imagine you're designing a calculator app. A user enters a 3×3 system and wants the solution displayed instantly. Later, they might change just the right-hand side (the constants) and solve again, or they might change the entire system. Describe a strategy that handles both cases efficiently. Which method(s) would your app use internally, and when would it switch between them?
Show answer
A smart strategy is to use LU decomposition as the default. When the user enters the system for the first time, the app factors A = LU (very fast for 3×3). If the user changes only b, the app reuses L and U and just performs forward and back substitution — almost instant. If the user changes any entry in A, the app re-factors the new matrix. You would not use the inverse method because computing A⁻¹ for a 3×3 is more work than LU and offers no advantage when only one b is present. Plain elimination would also work fine for a 3×3 system since the sizes are so small, but it doesn't let you efficiently reuse work when only b changes. By defaulting to LU, your app is prepared for both scenarios without needing to ask the user what they plan to do next.

SUMMARY

Lesson Summary

Summary

When faced with a system Ax = b, you now have three powerful tools to choose from. Gaussian elimination is your go-to for small, one-time problems — it's simple, reliable, and easy to do by hand. The matrix inverse method (x = A⁻¹b) shines when you specifically need A⁻¹ for other purposes or when you have many right-hand sides and the system is small enough that the higher setup cost is worth it. LU decomposition is the professional's choice for large systems or situations where the same coefficient matrix is reused with different right-hand sides — it offers elimination-level setup cost with the reuse benefits of the inverse.

The key decision factors are: system size (how many equations?), number of solves (one b or many?), and whether you need the inverse itself. Mastering this decision process is just as important as mastering the methods themselves — it's what separates someone who can solve problems from someone who can solve them efficiently.

Varsity Tutors • Linear Algebra • Choosing Solution Methods — Choosing Efficient Methods (Elimination vs Inverse vs Decomposition)