Multiply LU and match entries with A. The trick: go row by row of U, then column by column of L, because each new equation introduces exactly one new unknown.
Row 1 of U (first row of L is (1,0,0)):
u11=a11,u12=a12,u13=a13.
Column 1 of L (the second/third entries come from row·col):
a21=ℓ21u11⇒ℓ21=a21/u11, and ℓ31=a31/u11.
Row 2 of U:a22=ℓ21u12+u22⇒u22=a22−ℓ21u12,
a23=ℓ21u13+u23⇒u23=a23−ℓ21u13.
Column 2 of L:a32=ℓ31u12+ℓ32u22⇒ℓ32=u22a32−ℓ31u12.
Row 3 of U:a33=ℓ31u13+ℓ32u23+u33⇒u33=a33−ℓ31u13−ℓ32u23.
Generalizing the pattern gives the Doolittle formulas:
Each elimination step "rowi← rowi−mik⋅rowk" is multiplication by an elementary matrix Eik. After full elimination U=En⋯E1A, so A=(En⋯E1)−1U=LU. The multipliers mik that we discarded in plain elimination are precisely the entries ℓik that LU keeps.
Try to factor
A=(0111).u11=a11=0, then ℓ21=a21/u11=1/0 — blows up!Why? The pivot is zero even though A is invertible.
Fix: partial pivoting. Swap rows so the largest-magnitude entry sits on the pivot. We record swaps in a permutation matrix P and factor PA=LU. Here swap the two rows:
PA=(1011)=(1001)(1011).
To solve Ax=b you solve LUx=Pb (permute b the same way).
Since detL=1 (unit diagonal) and detU=∏uii,
detA=det(LU)=∏i=1nuii×(−1)#row swaps.Why? Determinant of a triangular matrix is the product of its diagonal; permutations flip sign once per swap.
Recall Feynman: explain to a 12-year-old
Imagine solving a maze takes lots of careful steps. Instead of solving the same maze again every time someone gives you a new "exit", you write down a cheat sheet of moves the first time. L and U are that cheat sheet. Once you have them, getting from start to any exit is super fast: walk down (L, forward), then walk back up (U, back). If a turn is "blocked" (a zero pivot), you just swap the order of paths (pivoting) and keep going.
Dekho, LU decomposition ka basic funda yeh hai: Ax=b solve karna Gaussian elimination se hota hai, lekin agar aapko same A ke saath alag-alag b ke liye baar-baar solve karna ho, toh har baar poori elimination dohrana bekaar mehnat hai. Isliye hum A ko ek baar do triangular matrices mein tod dete hain: A=LU, jahan L lower triangular hai (1's diagonal pe, Doolittle convention) aur U upper triangular. Phir koi bhi naya solve sirf do aasaan steps: pehle Ly=b forward substitution se, phir Ux=y back substitution se. "Factor once, solve many times" — yahi pura game hai.
Yeh L aur U aate kahan se hain? Bilkul Gaussian elimination ke multipliers se! Jo number aap row ko zero karne ke liye use karte ho (jaise ℓ21=a21/u11), wahi L mein store ho jaata hai. Plain elimination mein hum yeh multipliers phenk dete the; LU mein hum sambhaal lete hain. Diagonal pe jo pivots bachte hain woh U ke uii ban jaate hain.
Ek important practical baat: agar pivot ujj=0 ho gaya toh divide-by-zero ho jayega, formula phat jaayega — jaise example mein (0111). Iska solution hai partial pivoting: rows ko swap karke sabse bada element pivot position pe le aao, aur swap ko ek permutation matrix P mein note karlo, toh PA=LU. Yeh sirf zero-pivot bachata nahi, accuracy bhi improve karta hai kyunki chhote pivot se divide karne par rounding errors badh jaate hain.
Bonus tip exam ke liye: determinant nikalna ho toh detA=∏uii (agar swaps hue ho toh (−1) har swap pe). Aur yaad rakhna — A−1 nikal kar solve karna slow aur unstable hai, LU-solve hi smart aur professional tarika hai.