Chapter 5 - Determinants, Inverses, and Cramer’s Rule

Section 5.6 -  Cramer's Rule

Commands before Example 5.6.1

(A={{a,b},{c,d}})//MatrixForm

(B={{α},{β}})//MatrixForm

(X=Inverse[A].B)//MatrixForm

Simplify[Det[A] X]//MatrixForm

Example 5.6.1

A={{5,13},{4,-7}};

B={{-8},{2}};

(Xnum=Join[B,Drop[A,{},{1}],2])//MatrixForm

(Ynum=Join[Drop[A,{},{2}],B,2])//MatrixForm

(X={{Det[Xnum]/Det[A]},{Det[Ynum]/Det[A]}})//MatrixForm

Inverse[A].B//MatrixForm

Commands after Example 5.6.1

(A={{a,b,c},{d,e,f},{g,h,i}})//MatrixForm

(B={{α},{β},{δ}})//MatrixForm

X=Inverse[A].B;Simplify[Det[A] X]//MatrixForm

Det[{{α,b,c},{β,e,f},{δ,h,i}}]

Det[{{a,α,c},{d,β,f},{g,δ,i}}]

Det[{{a,b,α},{d,e,β},{g,h,δ}}]

Example 5.6.2

A={{5,13,-9},{4,-7,6},{-1,11,-4}};

B={{-8},{2},{0}};

(XVar=ReplacePart[A,{i_,1}->B[[i,1]]])//MatrixForm

(YVar=ReplacePart[A,{i_,2}-> B[[i,1]]])//MatrixForm

(ZVar=ReplacePart[A,{i_,3}->B[[i,1]]])//MatrixForm

{Det[XVar]/Det[A],Det[YVar]/Det[A],Det[ZVar]/Det[A]}

Flatten[Inverse[A].B]

Example 5.6.3

A={{-7,-1,2,3},{-2,0,-5,4},{-2,3,0,1},{0,4,-3,1}};

B={{-2},{3},{1},{-2}};

(A1B=ReplacePart[A,{i_,1}->B[[i,1]]])//MatrixForm

(A2B=ReplacePart[A,{i_,2}->B[[i,1]]])//MatrixForm

(A3B=ReplacePart[A,{i_,3}->B[[i,1]]])//MatrixForm

(A4B=ReplacePart[A,{i_,4}->B[[i,1]]])//MatrixForm

{Det[A1B]/Det[A],Det[A2B]/Det[A],Det[A3B]/Det[A],Det[A4B]/Det[A]}

Flatten[Inverse[A].B]