Matrix Multiplies

Matrices may be combined by the process of multiplication.

aa={{2,1},{1,2}};
bb={{2,0},{2,2}};
Print[MatrixForm[aa],".",MatrixForm[bb],"=",MatrixForm[aa.bb]]

Order matters when multiplying matrices.

Print[MatrixForm[aa],".",MatrixForm[bb],"=",MatrixForm[bb.aa]];

Rotations

Two rotation matrices (one by alpha, the other by beta), are multiplied to get the combined result.

matalpha={{Cos[alpha],Sin[alpha]},{-Sin[alpha],Cos[alpha]}};
matbeta={{Cos[-beta],Sin[beta]},{-Sin[beta],Cos[beta]}};
Print[MatrixForm[matalpha],"    ",MatrixForm[matbeta]]

Print[MatrixForm[matalpha],".",MatrixForm[matbeta],"=",MatrixForm[Simplify[matalpha.matbeta]]]
Print[MatrixForm[matalpha],".",MatrixForm[matbeta],"=",MatrixForm[Simplify[matbeta.matalpha]]]

Inverse matrices

The action of a matrix A can be"undone"by the inverse  matrix (A^(-1)) (called matinv below)

mat={{2,1},{1,2}};
MatrixForm[mat];
matinv=Inverse[mat];
Print[MatrixForm[mat],".",MatrixForm[matinv],"=",MatrixForm[mat.matinv]];

Not all matrices have inverses

mat={{2,1},{4,2}};
MatrixForm[mat];
matinv=Inverse[mat];
Print[MatrixForm[mat],".",MatrixForm[matinv],"=",MatrixForm[mat.matinv]]

Diagonal matrices have simple inverses

mat={{2,0},{0,-3}};
MatrixForm[mat];
matinv=Inverse[mat];
Print[MatrixForm[mat],".",MatrixForm[matinv],"=",MatrixForm[mat.matinv]]