Math ClubMath Club
v1 · padrão canônico

Lesson 35 — Solving Systems via Matrices

Cramer, Gaussian elimination, matrix inverse. When each method is best.

Used in: 1.º ano EM (15 anos) · Equiv. Math II japonês · Equiv. Klasse 11 alemã

Ax=bx=A1bA\mathbf{x} = \mathbf{b} \quad \Rightarrow \quad \mathbf{x} = A^{-1}\mathbf{b}
Choose your door

Rigorous notation, full derivation, hypotheses

Solution methods

Matrix form

{a1x+b1y+c1z=d1a2x+b2y+c2z=d2a3x+b3y+c3z=d3\begin{cases} a_1 x + b_1 y + c_1 z = d_1 \\ a_2 x + b_2 y + c_2 z = d_2 \\ a_3 x + b_3 y + c_3 z = d_3 \end{cases}Ax=bA\mathbf{x} = \mathbf{b} with A3×3A_{3 \times 3}, x,bR3\mathbf{x}, \mathbf{b} \in \mathbb{R}^3.

Method 1 — Gaussian elimination

Elementary operations (do not change solution):

  1. Swap two rows.
  2. Multiply a row by a non-zero scalar.
  3. Add a multiple of one row to another.

Goal: triangularize [Ab][A | \mathbf{b}] to row-echelon form. Then back-substitute.

Method 2 — Cramer

For Ax=bA\mathbf{x} = \mathbf{b} with detA0\det A \neq 0: xi=detAidetAx_i = \frac{\det A_i}{\det A}

where AiA_i is AA with the ii-th column replaced by b\mathbf{b}.

Method 3 — Inverse

x=A1b\mathbf{x} = A^{-1} \mathbf{b}. A1A^{-1} can be computed via [AI][IA1][A | I] \to [I | A^{-1}] by row reduction.

When to use each

MethodCostWhen to use
CramerO(n4)O(n^4)n3n \leq 3, didactic
GaussO(n3)O(n^3)practical default
InverseO(n3)O(n^3) + O(n2)O(n^2)/systemmany b\mathbf b with same AA
LUO(n3)O(n^3) + O(n2)O(n^2)/systemmany systems, better than inverse

Classification of systems

  • Determinate (unique): unique solution (detA0\det A \neq 0, or rank(A)=rank([Ab])=n\text{rank}(A) = \text{rank}([A|\mathbf b]) = n).
  • Indeterminate: infinitely many solutions (rank(A)=rank([Ab])<n\text{rank}(A) = \text{rank}([A|\mathbf b]) < n).
  • Impossible: no solution (rank(A)<rank([Ab])\text{rank}(A) < \text{rank}([A|\mathbf b])).

Rouché-Capelli theorem

Ax=bA\mathbf x = \mathbf b has a solution ⟺ rank(A)=rank([Ab])\text{rank}(A) = \text{rank}([A|\mathbf b]). Solution is unique if both equal the number of unknowns.

Exercise list

46 exercises · 11 with worked solution (25%)

Application 32Understanding 2Modeling 10Challenge 1Proof 1
  1. Ex. 35.1Application
    Solve by Cramer: {x+y=52xy=1\begin{cases} x + y = 5 \\ 2x - y = 1 \end{cases}. (Ans: x=2,y=3x = 2, y = 3.)
  2. Ex. 35.2ApplicationAnswer key
    Solve by row reduction: {3x+2y=11xy=2\begin{cases} 3x + 2y = 11 \\ x - y = 2 \end{cases}. (Ans: x=3,y=1x = 3, y = 1.)
  3. Ex. 35.3Application
    Solve {x+2yz=42x+y+z=6xy+2z=3\begin{cases} x + 2y - z = 4 \\ 2x + y + z = 6 \\ x - y + 2z = 3 \end{cases} by row reduction.
  4. Ex. 35.4ApplicationAnswer key
    Homogeneous system Ax=0A\mathbf{x} = \mathbf{0} with detA=50\det A = 5 \neq 0. Solution? (Ans: trivial x=0\mathbf x = \mathbf 0.)
  5. Ex. 35.5Application
    For which kk does the system {x+2y=3kx+4y=6\begin{cases} x + 2y = 3 \\ kx + 4y = 6 \end{cases} have infinitely many solutions? (Ans: k=2k = 2.)
  6. Ex. 35.6Application
    For which kk does the system above have no solution?
  7. Ex. 35.7Application
    Matrix form of {2x+y=5x3y=1\begin{cases} 2x + y = 5 \\ x - 3y = 1 \end{cases}. Compute A1bA^{-1}\mathbf{b}.
  8. Ex. 35.8Application
    Solve {xy+z=12x+yz=4x+2y+z=0\begin{cases} x - y + z = 1 \\ 2x + y - z = 4 \\ -x + 2y + z = 0 \end{cases} via Cramer.
  9. Ex. 35.9Application
    Solve {2xy=0x+3y=7\begin{cases} 2x - y = 0 \\ x + 3y = 7 \end{cases} by row reduction. (Ans: x=1,y=2x = 1, y = 2.)
  10. Ex. 35.10ApplicationAnswer key
    Use row reduction to verify that {x+y+z=32x+2y+2z=63x+3y+3z=9\begin{cases} x + y + z = 3 \\ 2x + 2y + 2z = 6 \\ 3x + 3y + 3z = 9 \end{cases} has infinitely many solutions.
  11. Ex. 35.11Application
    Solve via inverse: {4x+3y=112x+y=5\begin{cases} 4x + 3y = 11 \\ 2x + y = 5 \end{cases}. (Ans: x=2,y=1x = 2, y = 1.)
  12. Ex. 35.12Application
    Compute A1A^{-1} of (121011001)\begin{pmatrix} 1 & 2 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 1 \end{pmatrix} via row reduction [AI][A|I].
  13. Ex. 35.13Application
    System {x+y+z=1x+y+z=2\begin{cases} x + y + z = 1 \\ x + y + z = 2 \end{cases} — solutions? (Ans: none — incompatible.)
  14. Ex. 35.14Application
    System with 4 equations and 2 unknowns — generally overdetermined, no exact solution. In practice, least squares is used.
  15. Ex. 35.15Application
    System with 2 equations and 4 unknowns — underdetermined, infinitely many solutions.
  16. Ex. 35.16ApplicationAnswer key
    Solve {0.1x+0.2y=0.30.4x0.5y=0.1\begin{cases} 0.1 x + 0.2 y = 0.3 \\ 0.4 x - 0.5 y = 0.1 \end{cases} — multiply by 10 first.
  17. Ex. 35.17Application
    General solution of {x+yz=02xy+z=0\begin{cases} x + y - z = 0 \\ 2x - y + z = 0 \end{cases} (homogeneous 2x3 system).
  18. Ex. 35.18Application
    Show that homogeneous solution + particular solution of the non-homogeneous gives the general solution.
  19. Ex. 35.19Application
    Check consistency: {x+y=32x+2y=7\begin{cases} x + y = 3 \\ 2x + 2y = 7 \end{cases}. (Ans: incompatible.)
  20. Ex. 35.20Application
    Cramer gives x=Dx/Dx = D_x/D. For which DD does the method fail? (Ans: D=0D = 0.)
  21. Ex. 35.21Application
    Solve {x+2y+3z=64x+5y+6z=157x+8y+10z=25\begin{cases} x + 2y + 3z = 6 \\ 4x + 5y + 6z = 15 \\ 7x + 8y + 10z = 25 \end{cases} by row reduction.
  22. Ex. 35.22Application
    Solve {2xy+3z=9x+yz=03x+2y+z=5\begin{cases} 2x - y + 3z = 9 \\ x + y - z = 0 \\ 3x + 2y + z = 5 \end{cases} via Cramer.
  23. Ex. 35.23ApplicationAnswer key
    For what values of kk does {x+y+z=1x+2y+kz=2x+4y+k2z=4\begin{cases} x + y + z = 1 \\ x + 2y + kz = 2 \\ x + 4y + k^2 z = 4 \end{cases} have a unique solution?
  24. Ex. 35.24Application
    Find all x\mathbf x that satisfy (123456)x=(00)\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{pmatrix} \mathbf x = \begin{pmatrix} 0 \\ 0 \end{pmatrix}.
  25. Ex. 35.25Application
    Solve the row-echelon system {x+2yz=33y+2z=15z=10\begin{cases} x + 2y - z = 3 \\ 3y + 2z = 1 \\ 5z = 10 \end{cases} by back substitution.
  26. Ex. 35.26Application
    For the system {x+ky=1kx+y=1\begin{cases} x + ky = 1 \\ kx + y = 1 \end{cases}, classify for each kk.
  27. Ex. 35.27ApplicationAnswer key
    Solve {x+2yz=12x+4y2z=2x+y+z=3\begin{cases} x + 2y - z = 1 \\ 2x + 4y - 2z = 2 \\ x + y + z = 3 \end{cases} — note redundancy.
  28. Ex. 35.28ApplicationAnswer key
    Find A1A^{-1} via Gauss-Jordan for A=(123014001)A = \begin{pmatrix} 1 & 2 & 3 \\ 0 & 1 & 4 \\ 0 & 0 & 1 \end{pmatrix}.
  29. Ex. 35.29ApplicationAnswer key
    Use A1A^{-1} from 35.28 to solve Ax=(6,5,1)TA\mathbf x = (6, 5, 1)^T.
  30. Ex. 35.30Application
    Solve 4×44 \times 4: {x1+x2=1x2+x3=2x3+x4=3x1+x4=4\begin{cases} x_1 + x_2 = 1 \\ x_2 + x_3 = 2 \\ x_3 + x_4 = 3 \\ x_1 + x_4 = 4 \end{cases}.
  31. Ex. 35.31Application
    Identify the rank of the matrix (123246111)\begin{pmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 1 & 1 \end{pmatrix}.
  32. Ex. 35.32Application
    Apply Rouché-Capelli to {x+y=12x+2y=3\begin{cases} x + y = 1 \\ 2x + 2y = 3 \end{cases} — classify.
  33. Ex. 35.33Modeling
    In a 3-loop circuit, Kirchhoff's laws give a 3x3 system. Model: 3 mesh currents, resistors, sources.
  34. Ex. 35.34ModelingAnswer key
    In economics, the IS-LM model produces a 2x2 system: simultaneous output YY and interest rate rr.
  35. Ex. 35.35Modeling
    Mixture: 100 ml of solution with 3 substances. Known concentrations — 3×33 \times 3 system.
  36. Ex. 35.36ModelingAnswer key
    Truss with 4 nodes and 3 unknown forces — row reduction.
  37. Ex. 35.37Modeling
    In statistics, least squares XTXβ=XTyX^TX\beta = X^Ty is a linear system. For XMn×pX \in M_{n\times p} with npn \gg p, dimension of the system?
  38. Ex. 35.38ModelingAnswer key
    In control, find u\mathbf u such that y=C(sIA)1Bu\mathbf y = C(sI - A)^{-1}B \mathbf u approximates a reference.
  39. Ex. 35.39Modeling
    In CG, lighting via radiosity leads to the system (IF)B=E(I - F)\mathbf B = \mathbf E — sparse.
  40. Ex. 35.40Modeling
    In quadratic optimization min12xTHx+cTx\min \frac{1}{2}\mathbf x^T H \mathbf x + \mathbf c^T \mathbf x, critical point: Hx=cH\mathbf x = -\mathbf c.
  41. Ex. 35.41Modeling
    In ML, ridge regression: (XTX+λI)β=XTy(X^TX + \lambda I)\beta = X^T\mathbf y. Why regularization?
  42. Ex. 35.42Modeling
    In PDE, discretization of 1D heat leads to a tridiagonal system — Thomas algorithm O(n)O(n).
  43. Ex. 35.43Understanding
    Show that the system Ax=0A\mathbf{x} = \mathbf{0} always has x=0\mathbf{x} = \mathbf{0}.
  44. Ex. 35.44Understanding
    Show that if AA is invertible, Ax=0A\mathbf{x} = \mathbf{0} has only x=0\mathbf{x} = \mathbf{0}.
  45. Ex. 35.45Challenge
    Solve via Cramer and via Gauss the same 3x3 system — compare the number of operations.
  46. Ex. 35.46Proof
    Prove that row reduction preserves the solution set — operation by operation.

Sources

Updated on 2026-04-30 · Author(s): Clube da Matemática

Found an error? Open an issue on GitHub or submit a PR — open source forever.