Matrix and Determinants Formulas - Cheatsheet | Last Minute Notes

Hey there! Welcome to KnowledgeKnot! Don't forget to share this with your friends and revisit often. Your support motivates us to create more content in the future. Thanks for being awesome!

Basic Matrix Operations

Matrix Addition: (A+B)ij=Aij+Bij(A + B)_{ij} = A_{ij} + B_{ij}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(5678)B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}, then A+B=(1+52+63+74+8)=(681012)A + B = \begin{pmatrix} 1+5 & 2+6 \\ 3+7 & 4+8 \end{pmatrix} = \begin{pmatrix} 6 & 8 \\ 10 & 12 \end{pmatrix}.

Matrix Subtraction: (AB)ij=AijBij(A - B)_{ij} = A_{ij} - B_{ij}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(5678)B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}, then AB=(15263748)=(4444)A - B = \begin{pmatrix} 1-5 & 2-6 \\ 3-7 & 4-8 \end{pmatrix} = \begin{pmatrix} -4 & -4 \\ -4 & -4 \end{pmatrix}.

Scalar Multiplication: (cA)ij=cAij(cA)_{ij} = c \cdot A_{ij}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and c=3c = 3, then cA=3(1234)=(31323334)=(36912)cA = 3 \cdot \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = \begin{pmatrix} 3 \cdot 1 & 3 \cdot 2 \\ 3 \cdot 3 & 3 \cdot 4 \end{pmatrix} = \begin{pmatrix} 3 & 6 \\ 9 & 12 \end{pmatrix}.

Matrix Multiplication: (AB)ij=kAikBkj(AB)_{ij} = \sum_{k} A_{ik} B_{kj}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(5678)B = \begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}, then AB=(15+2716+2835+4736+48)=(19224350)AB = \begin{pmatrix} 1 \cdot 5 + 2 \cdot 7 & 1 \cdot 6 + 2 \cdot 8 \\ 3 \cdot 5 + 4 \cdot 7 & 3 \cdot 6 + 4 \cdot 8 \end{pmatrix} = \begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}.

Transpose of a Matrix: (AT)ij=Aji(A^T)_{ij} = A_{ji}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, then AT=(1324)A^T = \begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}.

Special Matrices

Identity Matrix: Iij={1if i=j0if ijI_{ij} = \begin{cases} 1 & \text{if } i = j \\ 0 & \text{if } i \neq j \end{cases}

Example: The 3x3 identity matrix is I=(100010001)I = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}.

Zero Matrix: All elements are zero, 0ij=00_{ij} = 0

Example: A 2x2 zero matrix is 0=(0000)0 = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.

Diagonal Matrix: Dij={diif i=j0if ijD_{ij} = \begin{cases} d_i & \text{if } i = j \\ 0 & \text{if } i \neq j \end{cases}

Example: A 3x3 diagonal matrix is D=(100020003)D = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{pmatrix}.

Symmetric Matrix: A=ATA = A^T

Example: If A=(1223)A = \begin{pmatrix} 1 & 2 \\ 2 & 3 \end{pmatrix}, then AT=(1223)A^T = \begin{pmatrix} 1 & 2 \\ 2 & 3 \end{pmatrix}, so AA is symmetric.

Skew-Symmetric Matrix: A=ATA = -A^T

Example: If A=(0220)A = \begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix}, then AT=(0220)A^T = \begin{pmatrix} 0 & -2 \\ 2 & 0 \end{pmatrix} and AT=(0220)-A^T = \begin{pmatrix} 0 & 2 \\ -2 & 0 \end{pmatrix}, so AA is skew-symmetric.

Determinants

Determinant of a 2x2 Matrix: det(A)=abcd=adbc\det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, then det(A)=1423=46=2\det(A) = 1 \cdot 4 - 2 \cdot 3 = 4 - 6 = -2.


Determinant of a 3x3 Matrix: det(A)=a(eifh)b(difg)+c(dheg)\det(A) = a(ei - fh) - b(di - fg) + c(dh - eg)

Example: If A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}, then det(A)=1(5968)2(4967)+3(4857)=1(4548)2(3642)+3(3235)=1(3)2(6)+3(3)=3+129=0\det(A) = 1(5 \cdot 9 - 6 \cdot 8) - 2(4 \cdot 9 - 6 \cdot 7) + 3(4 \cdot 8 - 5 \cdot 7) = 1(45 - 48) - 2(36 - 42) + 3(32 - 35) = 1(-3) - 2(-6) + 3(-3) = -3 + 12 - 9 = 0.


Properties of Determinants:
det(AB)=det(A)det(B)\det(AB) = \det(A) \cdot \det(B)
Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(2012)B = \begin{pmatrix} 2 & 0 \\ 1 & 2 \end{pmatrix}, then det(A)=2\det(A) = -2, det(B)=4\det(B) = 4, and det(AB)=det((44108))=48410=3240=8\det(AB) = \det(\begin{pmatrix} 4 & 4 \\ 10 & 8 \end{pmatrix}) = 4 \cdot 8 - 4 \cdot 10 = 32 - 40 = -8 which is equal to 24=8-2 \cdot 4 = -8.

det(AT)=det(A)\det(A^T) = \det(A)
Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, then det(A)=2\det(A) = -2 and det(AT)=det((1324))=1432=46=2\det(A^T) = \det(\begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}) = 1 \cdot 4 - 3 \cdot 2 = 4 - 6 = -2.

If AA is triangular, det(A)\det(A) is the product of its diagonal elements.
Example: If A=(100450789)A = \begin{pmatrix} 1 & 0 & 0 \\ 4 & 5 & 0 \\ 7 & 8 & 9 \end{pmatrix}, then det(A)=159=45\det(A) = 1 \cdot 5 \cdot 9 = 45.


Inverse of a Matrix

Inverse of a 2x2 Matrix: A1=1det(A)(dbca)A^{-1} = \frac{1}{\det(A)} \begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, then det(A)=1423=46=2\det(A) = 1 \cdot 4 - 2 \cdot 3 = 4 - 6 = -2. Thus, A1=12(4231)=(211.50.5)A^{-1} = \frac{1}{-2} \begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix}.


General Formula: If det(A)0\det(A) \neq 0, then A1A^{-1} exists, and AA1=A1A=IAA^{-1} = A^{-1}A = I

Example: Using the above matrix A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and its inverse A1=(211.50.5)A^{-1} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix}:
AA1=(1234)(211.50.5)=((12+21.5)(11+20.5)(32+41.5)(31+40.5))=(1001)=IA \cdot A^{-1} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix} = \begin{pmatrix} (1 \cdot -2 + 2 \cdot 1.5) \\ (1 \cdot 1 + 2 \cdot -0.5) \\ (3 \cdot -2 + 4 \cdot 1.5) \\ (3 \cdot 1 + 4 \cdot -0.5) \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} = I.


Properties:
(A1)1=A(A^{-1})^{-1} = A
Example: If A1=(211.50.5)A^{-1} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix}, then (A1)1=(1234)=A(A^{-1})^{-1} = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} = A.

(AB)1=B1A1(AB)^{-1} = B^{-1} A^{-1}
Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B=(2012)B = \begin{pmatrix} 2 & 0 \\ 1 & 2 \end{pmatrix}, then A1=(211.50.5)A^{-1} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix} and B1=(0.500.250.5)B^{-1} = \begin{pmatrix} 0.5 & 0 \\ -0.25 & 0.5 \end{pmatrix}. Thus, (AB)1=B1A1=(0.500.250.5)(211.50.5)(AB)^{-1} = B^{-1} A^{-1} = \begin{pmatrix} 0.5 & 0 \\ -0.25 & 0.5 \end{pmatrix} \cdot \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix}.

(AT)1=(A1)T(A^T)^{-1} = (A^{-1})^T
Example: If A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}, then A1=(211.50.5)A^{-1} = \begin{pmatrix} -2 & 1 \\ 1.5 & -0.5 \end{pmatrix} and (A1)T=(21.510.5)(A^{-1})^T = \begin{pmatrix} -2 & 1.5 \\ 1 & -0.5 \end{pmatrix} which is the inverse of AT=(1324)A^T = \begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix}.

Trace of a Matrix

Definition: The trace of a square matrix is defined as the sum of its diagonal elements.
trace(A)=iAii\text{trace}(A) = \sum_{i} A_{ii}


Example: Consider the matrix A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}. To find the trace of AA, we sum its diagonal elements:
trace(A)=1+5+9=15\text{trace}(A) = 1 + 5 + 9 = 15.

Eigenvalues and Eigenvectors

Eigenvalue Equation: Av=λvA \mathbf{v} = \lambda \mathbf{v}

Example: If A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} and v=(11)\mathbf{v} = \begin{pmatrix} 1 \\ 1 \end{pmatrix}, then Av=(2112)(11)=(33)A \mathbf{v} = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix} \begin{pmatrix} 1 \\ 1 \end{pmatrix} = \begin{pmatrix} 3 \\ 3 \end{pmatrix}. Thus, λ=3\lambda = 3.


Characteristic Polynomial: det(AλI)=0\det(A - \lambda I) = 0

Example: If A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, then AλI=(2λ112λ)A - \lambda I = \begin{pmatrix} 2 - \lambda & 1 \\ 1 & 2 - \lambda \end{pmatrix}. The characteristic polynomial is det((2λ112λ))=(2λ)21=λ24λ+3=0\det(\begin{pmatrix} 2 - \lambda & 1 \\ 1 & 2 - \lambda \end{pmatrix}) = (2 - \lambda)^2 - 1 = \lambda^2 - 4\lambda + 3 = 0. Solving for λ\lambda, we get λ=1,3\lambda = 1, 3.


Properties:
Sum of eigenvalues = Trace of AA
Example: If A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, the eigenvalues are 11 and 33. The sum is 1+3=41 + 3 = 4, which is equal to the trace of AA (2+2=42 + 2 = 4).

Product of eigenvalues = det(A)\det(A)
Example: If A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, the eigenvalues are 11 and 33. The product is 13=31 \cdot 3 = 3, which is equal to the determinant of AA (2211=41=32 \cdot 2 - 1 \cdot 1 = 4 - 1 = 3).

Rank of a Matrix

Definition: The rank of a matrix is the maximum number of linearly independent row vectors or column vectors in the matrix.


Example: Consider the matrix A=(123456789)A = \begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{pmatrix}. Its row vectors are (123)\begin{pmatrix} 1 & 2 & 3 \end{pmatrix}, (456)\begin{pmatrix} 4 & 5 & 6 \end{pmatrix}, and (789)\begin{pmatrix} 7 & 8 & 9 \end{pmatrix}. Since the third row vector can be expressed as a linear combination of the first two, the rank of AA is 22.

Details: The third row vector (789)\begin{pmatrix} 7 & 8 & 9 \end{pmatrix} can be written as 0(123)+1(456)0 \cdot \begin{pmatrix} 1 & 2 & 3 \end{pmatrix} + 1 \cdot \begin{pmatrix} 4 & 5 & 6 \end{pmatrix}, demonstrating that it is indeed a linear combination of the first two row vectors.


Properties:

  • rank(A)min(m,n)\text{rank}(A) \leq \min(m, n) for an m×nm \times n matrix AA.
  • Example: If AA is a 3×43 \times 4 matrix, then rank(A)min(3,4)=3\text{rank}(A) \leq \min(3, 4) = 3.

  • rank(AB)min(rank(A),rank(B))\text{rank}(AB) \leq \min(\text{rank}(A), \text{rank}(B)).
  • Example: If AA is a 3×23 \times 2 matrix with rank 22, and BB is a 2×42 \times 4 matrix with rank 22, then rank(AB)min(2,2)=2\text{rank}(AB) \leq \min(2, 2) = 2.

Cofactor Matrix: The cofactor matrix of a matrix AA is defined as Cij=(1)i+jdet(Mij)C_{ij} = (-1)^{i+j} \det(M_{ij}), where MijM_{ij} is the minor of AA obtained by removing the ii-th row and jj-th column.

Example: Calculate the cofactor matrix of matrix A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}.

Solution:M11=(4)M_{11} = \begin{pmatrix} 4 \end{pmatrix},M12=(3)M_{12} = \begin{pmatrix} 3 \end{pmatrix},M21=(2)M_{21} = \begin{pmatrix} 2 \end{pmatrix},M22=(1)M_{22} = \begin{pmatrix} 1 \end{pmatrix}. Therefore,C11=(1)1+1det(M11)=14=4C_{11} = (-1)^{1+1} \det(M_{11}) = 1 \cdot 4 = 4,C12=(1)1+2det(M12)=13=3C_{12} = (-1)^{1+2} \det(M_{12}) = -1 \cdot 3 = -3,C21=(1)2+1det(M21)=12=2C_{21} = (-1)^{2+1} \det(M_{21}) = -1 \cdot 2 = -2,C22=(1)2+2det(M22)=11=1C_{22} = (-1)^{2+2} \det(M_{22}) = 1 \cdot 1 = 1. Thus, the cofactor matrix CC is (4321)\begin{pmatrix} 4 & -3 \\ -2 & 1 \end{pmatrix}.

Adjugate Matrix: The adjugate matrix of AA is denoted as adj(A)=CT\text{adj}(A) = C^T, where CC is the cofactor matrix of AA.

Example: Find the adjugate matrix of B=(1234)B = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}.

Solution: The cofactor matrix CC calculated previously is (4321)\begin{pmatrix} 4 & -3 \\ -2 & 1 \end{pmatrix}. Therefore, the adjugate matrix adj(B)\text{adj}(B) is (4231)\begin{pmatrix} 4 & -2 \\ -3 & 1 \end{pmatrix}.

Cramer's Rule: Cramer's Rule provides a method to solve systems of linear equations of the form AX=BAX = B. Specifically, it states that xi=det(Ai)det(A)x_i = \frac{\det(A_i)}{\det(A)}, where AiA_i is the matrix AA with its ii-th column replaced by BB.

Example: Solve the system of equations 2x+3y=82x + 3y = 8 and 4xy=64x - y = 6 using Cramer's Rule.

Solution:

  • Calculate det(A)\det(A) where A=(2341)A = \begin{pmatrix} 2 & 3 \\ 4 & -1 \end{pmatrix}: det(A)=2(1)34=212=14\det(A) = 2 \cdot (-1) - 3 \cdot 4 = -2 - 12 = -14.
  • Calculate det(A1)\det(A_1) where A1=(8361)A_1 = \begin{pmatrix} 8 & 3 \\ 6 & -1 \end{pmatrix}: det(A1)=8(1)36=818=26\det(A_1) = 8 \cdot (-1) - 3 \cdot 6 = -8 - 18 = -26.
  • Calculate det(A2)\det(A_2) where A2=(2846)A_2 = \begin{pmatrix} 2 & 8 \\ 4 & 6 \end{pmatrix}: det(A2)=2684=1232=20\det(A_2) = 2 \cdot 6 - 8 \cdot 4 = 12 - 32 = -20.
  • Find xx and yy:x=det(A1)det(A)=2614=137x = \frac{\det(A_1)}{\det(A)} = \frac{-26}{-14} = \frac{13}{7},y=det(A2)det(A)=2014=107y = \frac{\det(A_2)}{\det(A)} = \frac{-20}{-14} = \frac{10}{7}.
Therefore, the solution is x=137x = \frac{13}{7} and y=107y = \frac{10}{7}.

Useful Properties

Distributive Property: A(B+C)=AB+ACA(B + C) = AB + AC

Example: Verify the distributive property for matrices with the following matrices:
A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix},B=(2113)B = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix},C=(0142)C = \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix}.

Solution: Compute A(B+C)A(B + C) and AB+ACAB + AC to show they are equal:
A(B+C)=A((2113)+(0142))=A((2255))=(12122626)A(B + C) = A\left(\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} + \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix}\right) = A\left(\begin{pmatrix} 2 & 2 \\ 5 & 5 \end{pmatrix}\right) = \begin{pmatrix} 12 & 12 \\ 26 & 26 \end{pmatrix},
AB+AC=(1234)(2113)+(1234)(0142)=(471015)+(852011)=(12123026)AB + AC = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} + \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix} = \begin{pmatrix} 4 & 7 \\ 10 & 15 \end{pmatrix} + \begin{pmatrix} 8 & 5 \\ 20 & 11 \end{pmatrix} = \begin{pmatrix} 12 & 12 \\ 30 & 26 \end{pmatrix}.
Therefore, A(B+C)=AB+ACA(B + C) = AB + AC.

Associative Property: A(BC)=(AB)CA(BC) = (AB)C

Example: Demonstrate the associative property using the matrices:
A=(1234)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix},B=(2113)B = \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix},C=(0142)C = \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix}.

Solution: Compute A(BC)A(BC) and (AB)C(AB)C to show they are equal:
A(BC)=(1234)((2113)(0142))=(1234)(451211)=(28276057)A(BC) = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \left(\begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix}\right) = \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 4 & 5 \\ 12 & 11 \end{pmatrix} = \begin{pmatrix} 28 & 27 \\ 60 & 57 \end{pmatrix},
(AB)C=((1234)(2113))(0142)=(471015)(0142)=(28276057)(AB)C = \left(\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} \begin{pmatrix} 2 & 1 \\ 1 & 3 \end{pmatrix}\right) \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix} = \begin{pmatrix} 4 & 7 \\ 10 & 15 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 4 & 2 \end{pmatrix} = \begin{pmatrix} 28 & 27 \\ 60 & 57 \end{pmatrix}.
Therefore, A(BC)=(AB)CA(BC) = (AB)C.

Commutative Property (not general, special cases only): AB=BAAB = BA for certain matrices.

Example: Find matrices AA and BB such that AB=BAAB = BA.

Solution: Let A=(1000)A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} and B=(0100)B = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}.
Compute ABAB and BABA:
AB=(1000)(0100)=(0100)AB = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix},
BA=(0100)(1000)=(0000)BA = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 0 \\ 0 & 0 \end{pmatrix}.
Therefore, AB=BAAB = BA in this case.

Suggetested Articles