4.5.24Linear Algebra (Full)

Cramer's rule

1,696 words8 min readdifficulty · medium6 backlinks

WHAT is Cramer's Rule?

The crucial condition: it only works when ==detA0====\det A \neq 0== (the matrix is invertible, so a unique solution exists).


WHY does it work? (Derivation from scratch)

We derive it using one fact: the determinant is multilinear and alternating in its columns, i.e. det\det behaves like a "signed volume" that:

  • scales when you scale a column,
  • adds when you split a column into a sum,
  • vanishes if two columns are equal.

Step 1 — Build a clever matrix. Take the identity matrix II and replace its ii-th column with the unknown vector x\mathbf{x}. Call it XiX_i. For example with n=3n=3, i=2i=2: X2=(1x100x200x31).X_2=\begin{pmatrix}1 & x_1 & 0\\ 0 & x_2 & 0\\ 0 & x_3 & 1\end{pmatrix}. Why this step? This matrix is upper/lower-mixed but expanding along the ii-th row/column gives detXi=xi\det X_i = x_i cheaply.

Step 2 — Compute detXi\det X_i. Expanding the determinant along the special structure, every column except the ii-th is a standard basis vector, so detXi=xi.\det X_i = x_i. Why this step? The identity columns contribute factor 11; only the entry xix_i on the diagonal survives.

Step 3 — Multiply by AA. Consider the product AXiA\,X_i. Multiplying AA by a matrix multiplies AA by each column:

  • A standard-basis column ek\mathbf{e}_k picks out column kk of AA, i.e. ak\mathbf{a}_k.
  • The ii-th column x\mathbf{x} gives Ax=bA\mathbf{x}=\mathbf{b}.

So AXiA X_i is exactly AA with its ii-th column replaced by b\mathbf{b} — that is ==Ai====A_i==: AXi=Ai.A X_i = A_i. Why this step? This is the heart: matrix multiplication swaps the column for us automatically.

Step 4 — Take determinants and use multiplicativity (det(MN)=detMdetN\det(MN)=\det M\det N): detAdetXi=detAi    detAxi=detAi.\det A \cdot \det X_i = \det A_i \;\Longrightarrow\; \det A \cdot x_i = \det A_i.

Step 5 — Solve. If detA0\det A\neq 0: xi=detAidetA\boxed{\,x_i = \dfrac{\det A_i}{\det A}\,}

Figure — Cramer's rule

HOW to use it — worked examples


Forecast-then-Verify


Common mistakes


Recall Feynman: explain to a 12-year-old

Imagine a recipe: to make a smoothie (b\mathbf{b}) you mix some banana, apple and milk (the columns of AA). Cramer's rule tells you exactly how many bananas you need. The trick: measure the "size" of the original ingredient-box (that's detA\det A), then make a new box where you swap the banana ingredient for the whole smoothie and measure that box (detA1\det A_1). Divide the two sizes — that ratio is exactly the amount of banana! Do the same for each ingredient. If the original box is flat (size 00), the ingredients are "stuck together" and there's no single recipe.


Flashcards

What does Cramer's rule compute, and when is it valid?
xi=detAi/detAx_i=\det A_i/\det A, valid only when detA0\det A\neq 0 (unique solution).
What is AiA_i in Cramer's rule?
AA with its ii-th column replaced by the vector b\mathbf{b}.
Key identity that proves Cramer's rule
AXi=AiA X_i = A_i and detXi=xi\det X_i = x_i, so detAxi=detAi\det A\cdot x_i=\det A_i.
Why must detA0\det A\neq 0?
Otherwise you divide by zero; the system has no unique solution.
What property of det\det gives detXi=xi\det X_i = x_i?
Multilinearity + the identity columns being basis vectors.
Doubling b\mathbf{b} does what to the solution?
Doubles every xix_i (columns of AiA_i are linear in b\mathbf{b}).
Why is Cramer's rule bad for large numerical systems?
Cost grows like (n+1)(n+1) determinants and dividing by tiny detA\det A is unstable; Gaussian elimination is faster/stabler.
Common error to avoid
Replacing a row instead of a column with b\mathbf{b}.

Connections

  • Determinants — the engine; Cramer is "determinant as volume."
  • Matrix Inverse — Cramer ⇔ A1=1detAadj(A)A^{-1}=\frac{1}{\det A}\operatorname{adj}(A) applied to b\mathbf{b}.
  • Cofactor Expansion — how the detAi\det A_i are computed.
  • Gaussian Elimination — the practical alternative for big systems.
  • Multilinear and Alternating Maps — properties that make the proof work.
  • Invertible Matrix TheoremdetA0    \det A\neq 0 \iff unique solution.

Concept Map

basis of

gives

has property

multiply by A

equals

combine via

combine via

yields

required for

solved by

applied in

Determinant as signed volume

Multilinear alternating in columns

System Ax = b

det A not equal 0

Build X_i: identity with i-th column = x

det X_i = x_i

A X_i = A_i

A_i: i-th column replaced by b

det MN = det M det N

Cramer's rule x_i = det A_i / det A

Worked 2x2 example

Hinglish (regional understanding)

Intuition Hinglish mein samjho

Cramer's rule ka core idea bahut simple hai: jab tumhe Ax=bA\mathbf{x}=\mathbf{b} solve karna ho aur detA0\det A \neq 0 ho, to har ek unknown xix_i nikaalne ke liye sirf do determinant chahiye. Pehle original matrix AA ka determinant nikaalo (yeh denominator hai). Phir AA ki ii-th column ko b\mathbf{b} se replace kar do, us naye matrix AiA_i ka determinant nikaalo (yeh numerator hai). Bas, xi=detAi/detAx_i = \det A_i / \det A.

Iske peeche ka magic yeh hai ki determinant ek tarah ka "volume" (ya 2D me area) measure karta hai. Jab tum ek column ko b\mathbf{b} se badalte ho, to volume exactly utne factor se change hota hai jitna woh unknown ki value hai. Proof me hum ek special matrix XiX_i banate hain (identity ki ii-th column ki jagah x\mathbf{x}), aur AXi=AiA X_i = A_i ban jaata hai — bas determinant le lo dono taraf, ho gaya derive.

Dhyaan rakhna: yeh sirf tab kaam karta hai jab detA0\det A \neq 0. Agar zero hai to ya to koi solution nahi ya infinitely many — tab Gaussian elimination use karo. Aur exam me sabse common galti: row replace mat karna, hamesha column replace karni hai b\mathbf{b} se. Bade systems ke liye Cramer slow hota hai, lekin chote 2×22\times2, 3×33\times3 aur theory/proofs ke liye yeh bahut elegant aur clean tareeka hai.

Go deeper — visual, from zero

Test yourself — Linear Algebra (Full)

Connections