Back to Course
Basic Matrices
Understanding Matrices
A matrix is a rectangular arrangement of numbers organized into rows and columns. Each number in the grid is called an element, and its position is identified by its row index and column index.
$$A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \end{bmatrix}$$
A matrix A of size m × n has m rows and n columns. Each element a_{ij} sits at row i, column j.
$A$=Name of the matrix(—)
$a_{ij}$=Element in row i, column j(depends on context)
$m \times n$=Dimensions — rows first, then columns(count)
$m = n$
→The matrix is square — equal rows and columns.
Row-Column Convention: Always state dimensions as rows first, then columns. A 3×2 matrix has 3 rows and 2 columns.
Element Addressing: $a_{23}$ means the element in row 2, column 3 — row comes first, column second.
Notation Alternatives: Matrices can also be written with parentheses ( ) instead of square brackets .
Matrices come in several important types, each with special properties that make them useful in different situations.
Row Matrix: A single row of numbers, e.g., $\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$ — size 1×n.
Column Matrix: A single column of numbers, e.g., $\begin{bmatrix} 4 \\ 5 \end{bmatrix}$ — size m×1.
Square Matrix: Equal rows and columns (n×n). Only square matrixes have determinants and inverse matrixes.
Zero Matrix: Every element is 0, denoted $O$. Adding $O$ to any matrix leaves it unchanged.
Identity Matrix: Square matrix with 1s on the main diagonal and 0s everywhere else, denoted $I$. Multiplying any compatible matrix by $I$ leaves it unchanged — the matrix equivalent of the number 1.
Quick Reference: Identity Matrices
•
$I_1 = \begin{bmatrix} 1 \end{bmatrix}$
•
$I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$
•
$I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$
Matrix Addition and Subtraction
Two matrices can be added or subtracted element by element, but only when they have the exact same dimensions.
$$C = A \pm B \implies c_{ij} = a_{ij} \pm b_{ij}$$
Each element in the result is simply the sum or difference of the corresponding elements from the two matrices.
$c_{ij}$=Element at row i, column j of the result matrix C(depends on context)
$a_{ij}, b_{ij}$=Corresponding elements from matrices A and B(depends on context)
Same Size Required: A 2×3 matrix can only be added to another 2×3 matrix. Adding a 2×2 to a 2×3 is undefined.
Element-by-Element: There is no cross-multiplication or interaction between elements — just direct addition or subtraction at matching positions.
Properties: Matrix addition is commutative ($A + B = B + A$) and associative ($(A + B) + C = A + (B + C)$).
Scalar Multiplication
Multiplying a matrix by a scalar means multiplying every single element by that number. The resulting matrix has the same dimensions.
$$kA = \begin{bmatrix} k \cdot a_{11} & k \cdot a_{12} \\ k \cdot a_{21} & k \cdot a_{22} \end{bmatrix}$$
The scalar distributes to every element of the matrix, producing a new matrix of the same size.
$k$=A scalar (real number)(real number)
$A$=Any matrix(—)
Distributes to Every Element: Each $a_{ij}$ becomes $k \cdot a_{ij}$. The matrix size stays the same.
Negative Scalars: Multiplying by $-1$ flips the sign of every element, giving the additive inverse $-A$.
Scalar Factor-Out: $k(A + B) = kA + kB$ — a scalar distributes across matrix addition.
Matrix Multiplication
Matrix multiplication uses the dot product of rows and columns: multiply corresponding elements in a row of the first matrix with a column of the second, then sum them all up.
$$c_{ij} = \sum_{k=1}^{p} a_{ik} \cdot b_{kj} = a_{i1}b_{1j} + a_{i2}b_{2j} + \cdots + a_{ip}b_{pj}$$
To find the element at row i, column j of the product, take row i from the first matrix and column j from the second, multiply matching pairs, and add all products.
$c_{ij}$=Element at row i, column j of the result(depends on context)
$a_{ik}$=Element in row i, column k of matrix A(depends on context)
$b_{kj}$=Element in row k, column j of matrix B(depends on context)
$AB$ vs. $BA$
→In general $AB \neq BA$ — matrix multiplication is NOT commutative.
Dimension Rule: If A is m×p and B is p×n, then AB is m×n. The inner dimensions must match (columns of A = rows of B).
Step-by-Step Method: For each element of the result, run your finger across a row of A and down a column of B, multiplying pairs and accumulating the total.
Zero Product Trap: $AB = O$ does NOT mean $A = O$ or $B = O$. Two non-zero matrices can multiply to give a zero matrix.
Matrix multiplication has properties that differ from regular number multiplication in important ways.
Not Commutative: $AB \neq BA$ in general. Always multiply in the given order.
Associative: $A(BC) = (AB)C$ — you can regroup multiplications.
Distributive: $A(B + C) = AB + AC$ — multiplication distributes over addition.
Identity Property: $AI = IA = A$ — multiplying by the identity matrix leaves a matrix unchanged.
The Determinant
The determinant is a single number computed from a square matrix. For a 2×2 matrix, it measures the area scaling factor of the transformation the matrix represents.
$$\det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc$$
Multiply the main diagonal elements and subtract the product of the off-diagonal elements.
$a, d$=Main diagonal elements (top-left to bottom-right)(depends on context)
$b, c$=Off-diagonal elements(depends on context)
$\det(A)$ or $|A|$=Determinant of matrix A(scalar)
$\det(A) = 0$
→The matrix is singular matrix — it has no inverse and the system may have no unique solution.
$\det(A) \neq 0$
→The matrix is non-singular — it has a unique inverse.
Visual Pattern: Cross-multiply: $ad$ (down-right) minus $bc$ (up-right) — draw an X through the matrix.
Determinant of Identity: $\det(I_n) = 1$ for any size identity matrix.
Determinant of Zero Matrix: $\det(O) = 0$.
For a 3×3 matrix, the determinant is found by cofactor expansion along any row or column. Expanding along the first row is the most straightforward approach.
$$\det(A) = a_{11}\begin{vmatrix} a_{22} & a_{23} \\ a_{32} & a_{33} \end{vmatrix} - a_{12}\begin{vmatrix} a_{21} & a_{23} \\ a_{31} & a_{33} \end{vmatrix} + a_{13}\begin{vmatrix} a_{21} & a_{22} \\ a_{31} & a_{32} \end{vmatrix}$$
Expand along the first row: multiply each element by its cofactor (a signed 2×2 minor), then sum the results.
$a_{11}, a_{12}, a_{13}$=Elements of the first row(depends on context)
$\begin{vmatrix} \cdots \end{vmatrix}$=Minor — the 2×2 determinant remaining after removing the element's row and column(scalar)
A row or column is all zeros
→$\det = 0$ automatically.
Two rows are identical
→$\det = 0$.
Sign Pattern: The signs alternate starting with $+$ for position (1,1): $\begin{bmatrix} + & - & + \\ - & + & - \\ + & - & + \end{bmatrix}$.
Minor Method: For each element, cross out its row and column, compute the 2×2 determinant of what remains, then apply the sign from the pattern.
Shortcut (Sarrus' Rule): Rewrite the first two columns to the right of the matrix, then sum the products of three downward diagonals minus three upward diagonals. Works only for 3×3.
Inverse of a 2×2 Matrix
The inverse matrix of A, written $A^{-1}$, is the matrix that satisfies $AA^{-1} = I$. A matrix has an inverse only if its determinant is non-zero.
$$A^{-1} = \frac{1}{\det(A)} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}$$
Swap the main diagonal elements, negate the off-diagonal elements, then divide every element by the determinant.
$A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$=The original 2×2 matrix(—)
$\det(A) = ad - bc$=Determinant — must be non-zero(scalar)
$A^{-1}$=Inverse of A(—)
Swap and Negate: Swap $a$ and $d$ on the diagonal, then change the signs of $b$ and $c$. This creates the adjugate matrix.
Division by Determinant: Every element of the adjugate gets divided by $\det(A)$.
Verification Check: Multiply $AA^{-1}$ — you should get $I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$.
Non-Invertible Case: If $\det(A) = 0$, the inverse does not exist because of division by zero.
Solving Systems with Matrices
A system of linear equations can be written compactly in matrix form. For a 2×2 system, the solution uses the inverse matrix of the coefficient matrix.
$$A\vec{x} = \vec{b} \implies \vec{x} = A^{-1}\vec{b}$$
Write the coefficients as matrix A, the variables as a column vector, and the constants as another column vector. The solution is found by multiplying the inverse of A with the constant vector.
$A$=Coefficient matrix (from the variables' coefficients)(—)
$\vec{x}$=Column vector of unknowns(—)
$\vec{b}$=Column vector of constants (right-hand side)(—)
Setting Up the Matrix: For the system $ax + by = e$ and $cx + dy = f$, the coefficient matrix is $A = \begin{bmatrix} a & b \\ c & d \end{bmatrix}$, with $\vec{x} = \begin{bmatrix} x \\ y \end{bmatrix}$ and $\vec{b} = \begin{bmatrix} e \\ f \end{bmatrix}$.
Unique Solution Condition: A unique solution exists if and only if $\det(A) \neq 0$.
No Solution or Infinite Solutions: If $\det(A) = 0$, the system either has no solution or infinitely many — there is no unique answer.