Clear["Global`*"];
A2=ConstantArray[1,{4,4}]+DiagonalMatrix[{a,-a,b,-b}];Print["[4.1 (2)] := ",Det[A2]];
n=4;
A4=Table[(i+j-1)^(n-2),{i,n},{j,n}];
Print["[4.1 (4)] := ",Det[A4]];

Clear["Global`*"];
p[x]=Det[((({{2x, x, 1, 2}, {1, x, -2, -1}, {3, 2, x, -1}, {1, 1, 0, x}})))];
Print["[4.2] := ", p[x]];

Clear["Global`*"];
A=(({{1, 0, -1}, {0, 2, 3}}));
B=(({{2, -1, 4}, {1, 0, -2}, {0, 3, 1}}));
C1=(({{0, 2}, {-1, 0}, {3, 1}}));
Print["[4.3] := ", MatrixForm/@{A.B,A.C1,C1.A,B.B}];

Clear["Global`*"];
A=(({{1, 0, 2}, {-2, 3, -1}, {1, -1, 3}}));
Print["[4.4 (1)] := ", If[Det[A]==0,"Y","N"]];

Clear["Global`*"];
A=(({{1, -λ, (λ^2), -(λ^3)}, {0, 1, -2λ, 3(λ^2)}, {0, 0, 1, -3λ}, {0, 0, 0, 1}}));
Print["[4.6] := ", MatrixForm[Inverse[A]]];

Clear["Global`*"];
A=(({{2, 1, -1, 1, 1}, {3, -2, 1, -3, 4}, {1, 4, -3, 5, -2}}));
Print["[4.8 (1)] := ", MatrixRank[A]];

Clear["Global`*"];
n=4;
A=Sum[SparseArray[{Band[{1,i}]->i},{n,n}],{i,1,n}];
Print["[4.9(4)] := ", MatrixForm[Inverse[A]]];

Clear["Global`*"];
Solution1=Solve[(({{1, -2, 1, 1}, {1, -2, 1, -1}, {1, -2, 1, 5}})).(({{x1}, {x2}, {x3}, {x4}}))==(({{1}, {-1}, {5}}))];
Solution2=Solve[(({{1, -2, -1, -2}, {4, 1, 2, 1}, {2, 5, 4, -1}, {1, 1, 1, 1}})).(({{x1}, {x2}, {x3}, {x4}}))==(({{2}, {3}, {0}, {(1/3)}}))];
Print["[4.10(1)] := ", Solution1];
Print["[4.10(2)] := ", Solution2];

Clear["Global`*"];
A=(({{1, 1}, {-1, 1}}));
B=(({{2, -1}, {0, 1}}));
P=(({{2, 3}, {0, 1}}));
Print["[4.11] := ", MatrixForm[Inverse[B].A.P.Inverse[A].B]];

Clear["Global`*"];
Print["[4.12(2)] := ", Eigensystem[(({{0, 0, 1}, {0, 1, 0}, {1, 0, 0}}))]];

Clear["Global`*"];
Print["[4.13(1)] := ", Eigensystem[(({{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}))]];

Clear["Global`*"];
{P,J}=JordanDecomposition[(({{3, -4, 0, 2}, {4, -5, -2, 4}, {0, 0, 3, -2}, {0, 0, 2, -1}}))];
Print["[4.14(2)] := ", MatrixForm/@{P,J,P.J.Inverse[P]}];