Matrix inversion method applies when the coefficient matrix A of AX=B is square and non-singular.
Since A−1 exists, pre-multiply both sides of AX=B by A−1:
A−1(AX)=A−1B ⟹ (A−1A)X=A−1B ⟹ X=A−1B.
Worked illustration. Solve 5x+2y=3, 3x+2y=5. Here A=(5322), B=(35); ∣A∣=10−6=4=0, so A−1 exists: A−1=41(2−3−25). Then X=A−1B=41(2−3−25)(35)=41(6−10−9+25)=41(−416)=(−14), i.e. x=−1,y=4 -- check: 5(−1)+2(4)=3 and 3(−1)+2(4)=5, both correct.
Practical recipe (order 3). Read A and B off the equations; compute ∣A∣; compute adjA from the nine cofactors; form A−1=∣A∣1adjA; multiply A−1B and read x,y,z off the resulting column. …