2.6.12Matrices & Determinants — Introduction

Solving systems using matrix inversion

1,437 words7 min readdifficulty · medium

A linear system like 2x+3y=5, xy=12x+3y=5,\ x-y=1 can be packed into ONE matrix equation AX=BAX=B, and solved in one shot with X=A1BX=A^{-1}B.

The Big Picture

WHY learn this? Because it converts "solve 3 equations by elimination" into "compute one inverse and multiply" — a mechanical, mistake-proof recipe that also tells you when a unique solution exists at all.


Step 1 — Writing a system as AX=BAX=B

HOW does this equal the system? Multiply row ii of AA by column XX: you get ai1x1++ainxna_{i1}x_1+\dots+a_{in}x_n, and setting it equal to entry bib_i of BB reproduces equation ii exactly. So AX=BAX=B is the system, just repackaged.


Step 2 — Deriving the solution from scratch

We want XX. Start from AX=B.AX=B.

Why can we "divide"? There is no division of matrices, but there IS an inverse. Suppose A1A^{-1} exists (i.e. A1A=IA^{-1}A=I). Multiply both sides on the LEFT by A1A^{-1} — left, because matrix multiplication is not commutative and AA sits on the left of XX: A1(AX)=A1B.A^{-1}(AX)=A^{-1}B. Use associativity: (A1A)X=A1B.(A^{-1}A)X=A^{-1}B. Since A1A=IA^{-1}A=I (identity) and IX=XIX=X:

WHY the detA0\det A\neq0 condition? Because A1=1detAadj(A)A^{-1}=\dfrac{1}{\det A}\,\operatorname{adj}(A), and dividing by detA=0\det A=0 is illegal. Geometrically detA=0\det A=0 means AA collapses space, so information is lost and you can't undo it.


Consistency: what happens when detA=0\det A=0?

WHY? Multiply AX=BAX=B by adj(A)\operatorname{adj}(A): (adjA)AX=(adjA)B(\operatorname{adj}A)AX=(\operatorname{adj}A)B. But (adjA)A=(detA)I(\operatorname{adj}A)A=(\det A)I. If detA=0\det A=0 the left side is OO, forcing (adjA)B=O(\operatorname{adj}A)B=O; if that's violated, no XX can exist.

Figure — Solving systems using matrix inversion

Worked Example 1 — a clean 2×22\times2

Solve 2x+3y=52x+3y=5,  xy=1\ x-y=1.

A=[2311],B=[51].A=\begin{bmatrix}2&3\\1&-1\end{bmatrix},\quad B=\begin{bmatrix}5\\1\end{bmatrix}.

Step A: detA=2(1)3(1)=5\det A=2(-1)-3(1)=-5. Why this step? Non-zero ⇒ unique solution exists, safe to invert.

Step B: A1=15[1312]A^{-1}=\dfrac{1}{-5}\begin{bmatrix}-1&-3\\-1&2\end{bmatrix}. Why? 2×22\times2 rule: swap diagonal, negate off-diagonal, divide by det\det.

Step C: X=A1B=15[1312][51]=15[535+2]=15[83]=[8/53/5].X=A^{-1}B=\dfrac{1}{-5}\begin{bmatrix}-1&-3\\-1&2\end{bmatrix}\begin{bmatrix}5\\1\end{bmatrix}=\dfrac{1}{-5}\begin{bmatrix}-5-3\\-5+2\end{bmatrix}=\dfrac{1}{-5}\begin{bmatrix}-8\\-3\end{bmatrix}=\begin{bmatrix}8/5\\3/5\end{bmatrix}. Why order A1BA^{-1}B? Because X=A1BX=A^{-1}BBB is on the right.

Check: 2(8/5)+3(3/5)=16/5+9/5=25/5=5.2(8/5)+3(3/5)=16/5+9/5=25/5=5.


Worked Example 2 — a 3×33\times3

Solve x+y+z=6x+y+z=6,  y+3z=11\ y+3z=11,  x+z=2z\ x+z=2z (i.e. xz=0x-z=0).

A=[111013101], B=[6110].A=\begin{bmatrix}1&1&1\\0&1&3\\1&0&-1\end{bmatrix},\ B=\begin{bmatrix}6\\11\\0\end{bmatrix}.

Step A: detA\det A. Expand along row 1: 1(1(1)30)1(0(1)31)+1(0011)=1(1)1(3)+1(1)=1+31=1.1(1\cdot(-1)-3\cdot0) -1(0\cdot(-1)-3\cdot1)+1(0\cdot0-1\cdot1)=1(-1)-1(-3)+1(-1)=-1+3-1=1. Why? det=10\det=1\neq0 ⇒ unique solution, and dividing by 1 keeps numbers clean.

Step B: cofactors → adj. Computing (transpose of cofactor matrix): adjA=[112323111].\operatorname{adj}A=\begin{bmatrix}-1&1&2\\3&-2&-3\\-1&1&1\end{bmatrix}. Why transpose? adj(A)ij=Cji\operatorname{adj}(A)_{ij}=C_{ji}; forgetting the transpose is the #1 slip.

Step C: A1=11adjAA^{-1}=\frac{1}{1}\operatorname{adj}A, so X=A1B=[112323111][6110]=[6+11+0182206+11+0]=[545].X=A^{-1}B=\begin{bmatrix}-1&1&2\\3&-2&-3\\-1&1&1\end{bmatrix}\begin{bmatrix}6\\11\\0\end{bmatrix}=\begin{bmatrix}-6+11+0\\18-22-0\\-6+11+0\end{bmatrix}=\begin{bmatrix}5\\-4\\5\end{bmatrix}.

Wait — check row 2: y+3z=4+15=11y+3z=-4+15=11 ✓, x+y+z=54+5=6x+y+z=5-4+5=6 ✓, xz=55=0x-z=5-5=0 ✓. Solution (5,4,5)(5,-4,5).


Common Mistakes (Steel-manned)


Recall Feynman: explain to a 12-year-old

Imagine a vending machine. You press a code XX and it drops snack BB. The machine's rule is AA. If someone tells you the snack BB and you want to know which code XX they pressed, you need the reverse machine A1A^{-1} — put in the snack, out pops the code. That reverse only exists if the machine never gives the same snack for two different codes. In maths, that "confusing machine" is when detA=0\det A=0 — then you can't figure out the unique code.


Active-Recall Flashcards

What is the matrix form of a linear system?
AX=BAX=B, where AA=coefficient matrix, XX=variables, BB=constants.
Derive the inversion solution from AX=BAX=B.
Left-multiply by A1A^{-1}: A1AX=A1BIX=A1BX=A1BA^{-1}AX=A^{-1}B\Rightarrow IX=A^{-1}B\Rightarrow X=A^{-1}B.
Why left-multiply, not right?
Matrices don't commute; AA is on the left of XX, so only left-multiplying by A1A^{-1} cancels it.
Condition for a unique solution by inversion?
detA0\det A\neq0 (so A1A^{-1} exists).
Formula for A1A^{-1}?
A1=1detAadj(A)A^{-1}=\frac{1}{\det A}\operatorname{adj}(A).
2×22\times2 inverse of [abcd]\begin{bmatrix}a&b\\c&d\end{bmatrix}?
1adbc[dbca]\frac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix}.
If detA=0\det A=0 and (adjA)BO(\operatorname{adj}A)B\neq O?
No solution — system is inconsistent.
If detA=0\det A=0 and (adjA)B=O(\operatorname{adj}A)B=O?
Infinitely many solutions (or none) — check by substitution.
What is adj(A)\operatorname{adj}(A)?
Transpose of the cofactor matrix.
Key identity linking adj and det?
Aadj(A)=adj(A)A=(detA)IA\,\operatorname{adj}(A)=\operatorname{adj}(A)\,A=(\det A)I.

Connections

Concept Map

repackaged as

A

X

B

left-multiply by A inverse

requires

inverse formula

unique

adj A B not O

adj A B = O

negation

Linear system n eqns

Matrix eqn AX=B

Coefficient matrix

Variable matrix

Constant matrix

X = A inverse B

det A not zero

A inv = adj A / det A

Consistent solution

det A = 0

No solution

Infinitely many

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Dekho, jab tumhare paas do-teen linear equations hote hain, unhe alag-alag solve karne ke bajaye hum unhe ek hi matrix equation mein pack kar dete hain: AX=BAX=B. Yahan AA coefficient matrix hai, XX variables ka column, aur BB constants ka column. Yeh AX=BAX=B actually wahi equations hain, bas ek neat form mein.

Ab solve kaise? Normal algebra mein ax=bax=b ho to x=b/ax=b/a. Matrices mein "divide" nahi hota, lekin inverse hota hai. Dono taraf ko LEFT se A1A^{-1} se multiply karo: A1AX=A1BA^{-1}AX=A^{-1}B, aur kyunki A1A=IA^{-1}A=I, mil jaata hai X=A1BX=A^{-1}B. Yaad rakho — inverse ko LEFT mein rakhna hai, kyunki matrices ka multiplication order matter karta hai. BA1BA^{-1} likhna galat hai.

Sabse important cheez: yeh trick tabhi chalega jab detA0\det A\neq0, kyunki A1=1detAadj(A)A^{-1}=\frac{1}{\det A}\operatorname{adj}(A) — aur zero se divide nahi kar sakte. Agar detA=0\det A=0 ho, to ya system ka koi solution nahi (inconsistent), ya infinite solutions. Toh hamesha pehle detA\det A nikalo, warna time waste.

Intuition: socho AA ek machine hai jo code XX ko snack BB mein badalti hai. A1A^{-1} ulti machine hai — snack daalo, code wapas. Yeh ulti machine tabhi banti hai jab machine confuse na karti ho, yaani detA0\det A\neq0. Bas itna samajh lo, exam mein har system solve kar loge.

Go deeper — visual, from zero

Test yourself — Matrices & Determinants — Introduction

Connections