NapkinCalc

Linear Algebra B — Inverses & Solving Systems

Solving systems — Cramer's rule

continues from lesson 1 — values defined earlier in the course stay live here

ELI5: a system like 2x + y = 8, x − y = 1 is secretly a matrix equation A·[x, y] = [8, 1]. Cramer's rule solves it with determinants alone: to get x, swap the right-hand side into column 1 and divide by det(A); for y, swap it into column 2.

Am:=[2,1;1,1]A_{m} := [2, 1; 1, -1] = [[2,1],[1,1]][[2, 1], [1, -1]] coefficient matrix
dA=det(Am)d_{A} = \mathrm{det}\left(A_{m}\right) = 3-3 must be nonzero for a unique solution
xc:=det([8,1;1,1])/dAx_{c} := det([8, 1; 1, -1]) / d_{A} = 33 x: RHS replaces column 1
yc:=det([2,8;1,1])/dAy_{c} := det([2, 8; 1, 1]) / d_{A} = 22 y: RHS replaces column 2
✓ pass abs(xc3)<1e9andabs(yc2)<1e9abs(x_{c} - 3) < 1e-9 and abs(y_{c} - 2) < 1e-9 the solution (3, 2)

Real-world hook: systems are matrix equations, and that's how software solves circuit mesh currents, structural forces in a truss, and the millions-of-unknowns systems behind weather models (with faster algorithms than Cramer, but the same idea).

Try it yourself: solve 3x + 2y = 12 and x + y = 5 for x.

xyou=2x_{you} = 2 ✏️ Your turn: solve the system for x. The check substitutes y = 5 − x (from the 2nd equation) into the first — so you must find the real x.
✓ pass abs(3xyou+2(5xyou)12)<109\mathrm{abs}\left(3 \cdot x_{you} + 2 \cdot \left(5 - x_{you}\right) - 12\right) < 10^{-9} green when your x satisfies both equations

Where next: Differential Equations — where calculus and these systems join forces to model anything that evolves.