# Matrix Formulas

• $2\times 2$ Matrix Determinant $$det(A)=|A|=\left| \begin{array}{cc} a &b\\ c& d \\ \end{array} \right|=ad-cb$$
• $3\times 3$ Matrix Determinant \begin{align} det(A)=|A|&=\left| \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right| \\&=a\left| \begin{array}{cc} e &f \\ h & i \\ \end{array} \right|-b\left| \begin{array}{cc} d &f \\ g & i \\ \end{array} \right|+c\left| \begin{array}{cc} d &e \\ g & h \\ \end{array} \right|\\& =a(ei-fh)-b(di-fg)+c(dh-eg) \\& =aei+bfg+cdh-ceg-afh-bdi\end{align}
• $4\times 4$ Matrix Determinant \begin{align} det(A)=|A|&=\left| \begin{array}{cccc} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \\ \end{array} \right| \\&=a\left| \begin{array}{ccc} f & g & h \\ j & k & l \\ n & o & p \\ \end{array} \right|-b\left| \begin{array}{ccc} e & g & h \\ i & k & l \\ m & o & p \\ \end{array} \right|+c\left| \begin{array}{ccc} e & f & h \\ i & j & l \\ m & n & p \\ \end{array} \right|-d\left| \begin{array}{ccc} e & f & g \\ i & j & k \\ m & n & o \\ \end{array} \right| \end{align}
• $2\times 2$ Inverse Matrix $$A^{-1}=\left( \begin{array}{cc} a & b \\ c &d \\ \end{array} \right)^{-1}=\frac{1}{ad-bc}\left( \begin{array}{cc} d & -b \\ -c &a \\ \end{array} \right)$$
• $3\times 3$ Inverse Matrix \begin{align} A^{-1}=\left( \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right)^{-1}&=\frac{1}{det(A)}\left( \begin{array}{ccc} +\left| \begin{array}{cc} e & f \\ h &i \\ \end{array} \right| & -\left| \begin{array}{cc} b & c \\ h &i \\ \end{array} \right| & +\left| \begin{array}{cc} b & c \\ e &f \\ \end{array} \right| \ \\ -\left| \begin{array}{cc} d & f \\ g &i \\ \end{array} \right|& +\left| \begin{array}{cc} a & c \\ g &i \\ \end{array} \right| & -\left| \begin{array}{cc} a & c \\ d &f \\ \end{array} \right| \ \\ +\left| \begin{array}{cc} d & e \\ g &h \\ \end{array} \right| & -\left| \begin{array}{cc} a & b \\ g &h \\ \end{array} \right| & +\left| \begin{array}{cc} a & b \\ d &e \\ \end{array} \right| \\ \end{array} \right)\\ &=\frac{\left( \begin{array}{ccc} ei-fh & hc-ib & bf-ce \\ gf-di& ai-gc & dc-af \\ dh-ge & gb-ah & ae-db\\ \end{array} \right)}{aei+bfg+cdh-ceg-afh-bdi}\end{align}
• $4\times 4$ Inverse Matrix \begin{align} A^{-1}&=\left( \begin{array}{cccc} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \\ \end{array} \right)^{-1}=\frac{1}{det(A)}\widetilde{A}\end{align} where $\widetilde{A}$ is the adjugate matrix of $A$. Adjugate matrix of $A$ is \begin{align} \widetilde{A}&=\left( \begin{array}{cccc} a_{11} & a_{12} & a_{13} & a_{14} \\ a_{21} & a_{22} & a_{23} & a_{24} \\ a_{31} & a_{32} & a_{33} & a_{34} \\ a_{41} & a_{42} & a_{43} & a_{44} \\ \end{array} \right)\end{align} \begin{align} &a_{11}= -h k n+g l n+h j o-f l o-g j p+f k p \\ &a_{12}=d k n-c l n-d j o+b l o+c j p-b k p\\ &a_{13}=-d g n+c h n+d f o-b h o-c f p+b g p\\ &a_{14}=d g j-c h j-d f k+b h k+c f l-b g l\\ &a_{21}= h k m-g l m-h i o+e l o+g i p-e k p\\ &a_{22}= -d k m+c l m+d i o-a l o-c i p+a k p\\ &a_{23}= d g m-c h m-d e o+a h o+c e p-a g p\\ &a_{24}=-d g i+c h i+d e k-a h k-c e l+a g l\\ &a_{31}= -h j m+f l m+h i n-e l n-f i p+e j p\\ &a_{32}= d j m-b l m-d i n+a l n+b i p-a j p\\ &a_{33}= -d f m+b h m+d e n-a h n-b e p+a f p\\ &a_{34}=d f i-b h i-d e j+a h j+b e l-a f l \\ &a_{41}= g j m-f k m-g i n+e k n+f i o-e j o\\ &a_{42}= -c j m+b k m+c i n-a k n-b i o+a j o\\ &a_{43}=c f m-b g m-c e n+a g n+b e o-a f o\\ &a_{44}=-c f i+b g i+c e j-a g j-b e k+a f k \end{align}
• Transpose of Matrix $$\mbox{Transpose of}\left( \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right) = \left( \begin{array}{ccc} a & b & c \\ d& e & f \\ g & h & i \\ \end{array} \right)^T=\left( \begin{array}{ccc} a & d & g \\ b& e & h \\ c & f & i \\ \end{array} \right)$$
• $2\times 2$ Matrix Addition $$\left( \begin{array}{cc} a & b \\ c &d \\ \end{array} \right)+ \left( \begin{array}{cc} e & f\\ g & h \\ \end{array} \right)=\left( \begin{array}{cc} a+e & b+f \\ c+g& d+h\\ \end{array} \right)$$
• $3\times 3$ Matrix Addition \begin{align}&\left( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \\ \end{array} \right)+ \left( \begin{array}{ccc} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} &b_{32} & b_{33} \\ \end{array} \right)= \left(\begin{array}{ccc} a_{11}+b_{11}& a_{12}+b_{12}& a_{13}+b_{13} \\ a_{21}+b_{21} &a_{22}+b_{22}& a_{23}+b_{23}\\ a_{31}+b_{31} &a_{32}+b_{32} & a_{33}+b_{33}\\ \end{array}\right)\end{align}
• $2\times 2$ Matrix Subtraction $$\left( \begin{array}{cc} a & b \\ c &d \\ \end{array} \right)- \left( \begin{array}{cc} e & f\\ g & h \\ \end{array} \right)=\left( \begin{array}{cc} a-e & b-f \\ c-g& d-h\\ \end{array} \right)$$
• $3\times 3$ Matrix Subtraction \begin{align}&\left( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \\ \end{array} \right)- \left( \begin{array}{ccc} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} &b_{32} & b_{33} \\ \end{array} \right)= \left(\begin{array}{ccc} a_{11}-b_{11}& a_{12}-b_{12}& a_{13}-b_{13} \\ a_{21}-b_{21} &a_{22}-b_{22}& a_{23}-b_{23}\\ a_{31}-b_{31} &a_{32}-b_{32} & a_{33}-b_{33}\\ \end{array}\right)\end{align}
• $2\times 2$ Matrix by a Scalar Multiplication $$k\left( \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \\ \end{array} \right)=\left( \begin{array}{cc} ka_{11} & ka_{12} \\ ka_{21} & ka_{22} \\ \end{array} \right),\quad \mbox{for}\;k\in \mathbb{R}$$
• $2\times 2$ Matrix Multiplication $$\left( \begin{array}{cc} a_{11} & a_{12} \\ a_{21} & a_{22} \\ \end{array} \right)\cdot \left( \begin{array}{cc} b_{11} & b_{12} \\ b_{21} & b_{22} \\ \end{array} \right)=\left( \begin{array}{cc} a_{11}b_{11}+a_{12}b_{21} & a_{11}b_{12}+a_{12}b_{22} \\ a_{21}b_{11}+a_{22}b_{22} & a_{21}b_{12}+a_{22}b_{22} \\ \end{array} \right)$$
• $3\times 3$ Matrix by a Scalar Multiplication $$k\left( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \\ \end{array} \right)=\left( \begin{array}{ccc} ka_{11} & ka_{12} & ka_{13} \\ ka_{21} & ka_{22} & ka_{23} \\ ka_{31} & ka_{32} & ka_{33} \\ \end{array} \right),\quad \mbox{for}\;k\in \mathbb{R}$$
• $3\times 3$ Matrix Multiplication \begin{align}&\left( \begin{array}{ccc} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \\ \end{array} \right)\cdot \left( \begin{array}{ccc} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} &b_{32} & b_{33} \\ \end{array} \right)\\&= \left(\begin{array}{ccc} a_{11}b_{11}+a_{12}b_{21}+a_{13}b_{31}& a_{11}b_{12}+a_{12}b_{22}+a_{13}b_{32}& a_{11}b_{13}+a_{12}b_{23}+a_{13}b_{33} \\ a_{21}b_{11}+a_{22}b_{21}+a_{23}b_{31} &a_{21}b_{12}+a_{22}b_{22}+a_{23}b_{32}& a_{21}b_{13}+a_{22}b_{23}+a_{23}b_{33}\\ a_{31}b_{11}+a_{32}b_{21}+a_{33}b_{31} &a_{31}b_{12}+a_{32}b_{22}+a_{33}b_{32} & a_{31}b_{13}+a_{32}b_{23}+a_{33}b_{33}\\ \end{array}\right)\end{align}

## Matrix Formulas Reference

Matrix formulas reference is the collection basic equations for the study of 2x2, 3x3, 4x4 or nxn matrix or matrices addition, subtraction, multiplication, determinant, inverse or transpose matrix. This formulas cheatsheet is useful to know what are all the basic components used in the each functions of matrix computations.