Last updated
Matrix Addition
Add two 2×2 matrices:
Matrix A: Matrix B:
| 1 2 | | 5 6 |
| 3 4 | | 7 8 |
A + B = Add corresponding elements:
| 1+5 2+6 | | 6 8 |
| 3+7 4+8 | = | 10 12 |
Result:
| 6 8 |
| 10 12 |
Matrix Multiplication
Multiply two matrices. The number of columns in A must equal the number of rows in B:
Matrix A (2×3): Matrix B (3×2):
| 1 2 3 | | 7 8 |
| 4 5 6 | | 9 10 |
| 11 12 |
C = A × B (result is 2×2):
C[1,1] = (1×7) + (2×9) + (3×11) = 7 + 18 + 33 = 58
C[1,2] = (1×8) + (2×10) + (3×12) = 8 + 20 + 36 = 64
C[2,1] = (4×7) + (5×9) + (6×11) = 28 + 45 + 66 = 139
C[2,2] = (4×8) + (5×10) + (6×12) = 32 + 50 + 72 = 154
Result:
| 58 64 |
| 139 154 |
Matrix Transposition
Transpose a matrix by swapping rows and columns:
Matrix A (3×2): Transpose A^T (2×3):
| 1 2 | | 1 3 5 |
| 3 4 | → | 2 4 6 |
| 5 6 |
Rule: A^T[i,j] = A[j,i]
The element at row i, column j moves to row j, column i.
Determinant of a 2×2 Matrix
Matrix A:
| a b | | 3 4 |
| c d | = | 2 1 |
det(A) = ad - bc
= (3 × 1) - (4 × 2)
= 3 - 8
= -5
det(A) = -5
Since det(A) ≠ 0, the matrix is invertible.
Determinant of a 3×3 Matrix
Matrix A:
| 1 2 3 |
| 4 5 6 |
| 7 8 9 |
Cofactor expansion along first row:
det(A) = 1 × |5 6| - 2 × |4 6| + 3 × |4 5|
|8 9| |7 9| |7 8|
= 1 × (45-48) - 2 × (36-42) + 3 × (32-35)
= 1 × (-3) - 2 × (-6) + 3 × (-3)
= -3 + 12 - 9
= 0
det(A) = 0 — This matrix is singular (not invertible).
The rows are linearly dependent.
Matrix Inverse
Find the inverse of a 2×2 matrix:
Matrix A:
| 3 4 |
| 2 1 |
Step 1: Calculate determinant
det(A) = (3×1) - (4×2) = 3 - 8 = -5
Step 2: Apply inverse formula for 2×2
A^(-1) = (1/det) × | d -b |
| -c a |
= (1/-5) × | 1 -4 |
| -2 3 |
= | -0.2 0.8 |
| 0.4 -0.6 |
Verification: A × A^(-1) = I (identity matrix)
| 3 4 | × | -0.2 0.8 | = | 1 0 |
| 2 1 | | 0.4 -0.6 | | 0 1 | ✓
Solving a System of Linear Equations
Use matrix inverse to solve: 3x + 4y = 10, 2x + y = 5
Matrix form: Ax = b
| 3 4 | × | x | = | 10 |
| 2 1 | | y | | 5 |
Solution: x = A^(-1) × b
A^(-1) = | -0.2 0.8 |
| 0.4 -0.6 |
x = | -0.2 0.8 | × | 10 | = | (-0.2×10) + (0.8×5) | = | 2 |
| 0.4 -0.6 | | 5 | | (0.4×10) + (-0.6×5) | | 1 |
Solution: x = 2, y = 1
Verification:
3(2) + 4(1) = 6 + 4 = 10 ✓
2(2) + 1(1) = 4 + 1 = 5 ✓
2D Rotation Matrix (Computer Graphics)
Rotate a point 90° counterclockwise using a rotation matrix:
Rotation matrix for θ = 90°:
R = | cos(90°) -sin(90°) | = | 0 -1 |
| sin(90°) cos(90°) | | 1 0 |
Point P = (3, 1) as column vector:
| 3 |
| 1 |
Rotated point = R × P:
| 0 -1 | × | 3 | = | (0×3) + (-1×1) | = | -1 |
| 1 0 | | 1 | | (1×3) + (0×1) | | 3 |
Result: Point (3, 1) rotated 90° → (-1, 3)
Matrix Rank
Matrix A:
| 1 2 3 |
| 2 4 6 |
| 1 1 1 |
Row reduction (Gaussian elimination):
R2 = R2 - 2×R1:
| 1 2 3 |
| 0 0 0 |
| 1 1 1 |
R3 = R3 - R1:
| 1 2 3 |
| 0 0 0 |
| 0 -1 -2 |
Swap R2 and R3:
| 1 2 3 |
| 0 -1 -2 |
| 0 0 0 |
Number of non-zero rows = 2
Rank(A) = 2
The matrix has rank 2 (not full rank of 3).
Row 2 was a multiple of Row 1 (linearly dependent).