Matrices Cheat Sheet
Notation, row reduction, arithmetic, inverses, determinants, transformations, and where matrices actually get used
1. Identifying Matrices
Anatomy of a matrix
3 columns (n = 3) ↓
(m = 2)
→a11a12a13a21a22a23
This is a 2 × 3 matrix: it has 2 rows and 3 columns, so it holds 2 × 3 = 6 entries.
The highlighted entry is a23: row 2, column 3.
Types of matrices
| Name | Example | What makes it special |
|---|---|---|
| Row matrix (row vector) | 2-15 | Exactly one row: 1 x n |
| Column matrix (column vector) | 2-15 | Exactly one column: m x 1 |
| Square matrix | 1234 | Same number of rows and columns (n x n). Only square matrices have determinants and inverses. |
| Zero matrix, O | 0000 | Every entry is 0. Acts like 0 does in arithmetic: A + O = A |
| Identity matrix, I | 1001 | 1s down the main diagonal, 0s elsewhere. Acts like 1 does: AI = IA = A |
| Diagonal matrix | 300-7 | Every entry off the main diagonal is 0 |
| Upper triangular | 1406 | All zeros below the main diagonal (lower triangular is the mirror image) |
| Symmetric matrix | 1552 | A equals its own transpose: aij = aji |
Transpose, AT
Flip the matrix across its main diagonal: rows become columns.
A =123456 AT =142536
A 2 × 3 transposes into a 3 × 2. Also (AT)T = A and (AB)T = BTAT.
Equal matrices
A = B only when they have the same dimensions and every matching entry is equal.
x50y=350-2 ⇒ x = 3, y = -2
This is how "solve for x and y" matrix-equation problems work.
2. Representing Linear Systems with Augmented Matrices
A system of linear equations is just a table of coefficients. Strip away the variables and the equals signs and what is left is a matrix.
2x + 1y - 1z = 3
1x - 3y + 2z = -4
3x + 0y + 4z = 1
Each column holds one variable's coefficients; the column after the divider holds the constants. Each row is one equation.
Coefficient matrix, A
21-11-32304
Variable matrix, X
xyz
Constant matrix, B
3-41
The augmented matrix is written [ A | B ]: the coefficient matrix with the constant column tacked on.
3. Row-Echelon Form & Gaussian Elimination
The three elementary row operations
These are the only three moves allowed. Each one produces a new matrix representing the exact same solution set.
1. Swap
Ri ↔ Rj
Interchange any two rows.
2. Scale
kRi → Ri
Multiply a row by any nonzero constant k.
3. Add a multiple
Ri + kRj → Ri
Add k times one row to another row. Only the row on the left changes.
Row-Echelon Form (REF) — Gaussian elimination
- Any all-zero rows sit at the bottom.
- The first nonzero entry of each row (the leading 1, or pivot) is a 1.
- Each leading 1 is strictly to the right of the leading 1 in the row above, making a staircase.
1***01**001*
Finish with back-substitution: read the bottom row, then substitute upward.
Reduced Row-Echelon Form (RREF) — Gauss-Jordan
- Everything required for REF, plus:
- Each leading 1 is the only nonzero entry in its column — zeros above it as well as below.
100*010*001*
No back-substitution needed: the answers are sitting in the last column. This is the rref( button on a graphing calculator.
Worked example: Gaussian elimination
Solve: x + y + z = 6, 2x + 3y - z = 5, x - y + 2z = 5
- Build the augmented matrix:111623-151-125
- Clear column 1 below the pivot. R2 - 2R1 → R2 and R3 - R1 → R3:111601-3-70-21-1
- Clear column 2 below the pivot. R3 + 2R2 → R3:111601-3-700-5-15
- Make the last pivot a 1. -15R3 → R3, which gives REF:111601-3-70013
- Back-substitute. Row 3 says z = 3. Row 2 says y - 3z = -7, so y - 9 = -7 and y = 2. Row 1 says x + y + z = 6, so x + 2 + 3 = 6 and x = 1.
- Answer: (x, y, z) = (1, 2, 3). Check it in the original equation you used least: 1 - 2 + 2(3) = 5.
Reading the answer off the last row
One unique solution
1***01**001*
A pivot in every variable column. The lines/planes meet at exactly one point.
Infinitely many solutions
1***01**0000
A row of all zeros: 0 = 0 is always true. A variable with no pivot is free — set z = t and write x and y in terms of t.
No solution (inconsistent)
1***01**0005
The last row claims 0 = 5, which is impossible. Stop immediately and write "no solution".
Rank: the quick consistency test
Rank = the number of nonzero rows once the matrix is in REF. For a system with n variables: if rank(A) < rank([A|B]) there is no solution; if rank(A) = rank([A|B]) = n there is exactly one solution; if rank(A) = rank([A|B]) < n there are infinitely many, with n - rank free variables.
4. Adding & Subtracting Matrices
Entry-by-entry rule
(A ± B)ij = aij ± bij
A and B must have identical dimensions. Add the entries that sit in the same position; the answer has those same dimensions.
Example
A =2-105, B =34-21
- A + B: add matching spots — 2+3, -1+4, 0+(-2), 5+1 →53-26
- A - B: subtract matching spots — 2-3, -1-4, 0-(-2), 5-1 →-1-524
Properties of addition
- Commutative: A + B = B + A
- Associative: (A + B) + C = A + (B + C)
- Identity: A + O = A, where O is the zero matrix
- Inverse: A + (-A) = O
Matrix addition behaves exactly like ordinary addition. Matrix multiplication does not — see section 6.
5. Multiplying a Matrix by a Scalar
Distribute to every entry
(kA)ij = k ⋅ aij
A scalar is just a single number. There is no dimension requirement — any scalar multiplies any matrix, and the dimensions never change.
Example
- 32-105 → multiply all four entries by 3 →6-3015
- Combine with addition: 2A - 3B is "scale, then subtract". With A and B from section 4: 2A =4-2010, 3B =912-63
- 2A - 3B =-5-1467
Properties
- k(A + B) = kA + kB
- (k + h)A = kA + hA
- k(hA) = (kh)A
- 1A = A and 0A = O
- (-1)A = -A, so A - B = A + (-1)B
6. Multiplying Matrices
Step 1: check that the product even exists
AB is defined only when the number of columns of A equals the number of rows of B. If they do not match, the product is undefined.
Step 2: row of A, times column of B
cij = ai1b1j + ai2b2j + … + ainbnj
The entry in row i, column j of the answer comes from row i of A paired with column j of B: multiply matching terms and add. Point your left hand across the row and your right hand down the column.
Row 1 × column 2 = 1(8) + 2(10) + 3(12) = 8 + 20 + 36 = 64, which lands in row 1, column 2.
Worked example: all four entries of a (2 × 3)(3 × 2) product
- Dimensions: (2 × 3)(3 × 2), inner 3s match, so AB is 2 × 2.
- c11 = row 1 ⋅ col 1 = 1(7) + 2(9) + 3(11) = 7 + 18 + 33 = 58
- c12 = row 1 ⋅ col 2 = 1(8) + 2(10) + 3(12) = 8 + 20 + 36 = 64
- c21 = row 2 ⋅ col 1 = 4(7) + 5(9) + 6(11) = 28 + 45 + 66 = 139
- c22 = row 2 ⋅ col 2 = 4(8) + 5(10) + 6(12) = 32 + 50 + 72 = 154
- AB =5864139154. Note BA would be 3 × 3 — a completely different matrix.
Properties that DO hold
- Associative: (AB)C = A(BC)
- Distributive: A(B + C) = AB + AC
- Scalar slides: k(AB) = (kA)B = A(kB)
- Identity: AI = IA = A
- Powers: An = A⋅A…A (square matrices only), A0 = I
- Transpose flips: (AB)T = BTAT
Properties that DO NOT hold
- Not commutative: AB ≠ BA in general. Order matters, always.
- No zero-product rule: AB = O does not force A = O or B = O.
- No cancellation: AB = AC does not force B = C.
- (A + B)2 ≠ A2 + 2AB + B2; it equals A2 + AB + BA + B2.
Proof that order matters
With A =1234 and B =0110:
AB =2143 but BA =3412 — same two matrices, different answers.
7. Representing & Solving Linear Systems with Matrices
The matrix equation
AX = B ⇒ X = A-1B
Multiply both sides on the left by A-1. Because matrix multiplication is not commutative, A-1 must go on the same side of both sides: A-1AX = A-1B gives IX = A-1B.
Worked example: solve with the inverse
Solve 4x + 7y = 15 and 2x + 6y = 10.
- A =4726, B =1510
- det(A) = 4(6) - 7(2) = 24 - 14 = 10. It is not 0, so a unique solution exists.
- A-1 = 1106-7-24
- X = A-1B = 1106(15) - 7(10)-2(15) + 4(10) = 1102010 =21
- Answer: x = 2, y = 1. Check: 4(2) + 7(1) = 15.
Three ways to solve AX = B
| Method | How it works | Best when |
|---|---|---|
| Gauss-Jordan (rref) | Row reduce [A | B] until the left side is the identity; the answers appear in the last column. | Always works, including when the system has no solution or infinitely many. |
| Inverse matrix | X = A-1B | A is square with det ≠ 0, and you must solve the same system for several different B columns. |
| Cramer's rule | Ratios of determinants — see below. | Small systems, or when you only need one of the variables. |
Cramer's rule
D = det(A). Dx is det(A) with the x-column replaced by B, and likewise for Dy.
x = DxD y = DyD z = DzD
Example: 2x + 3y = 12 and x - y = 1.
D =231-1 = -2 - 3 = -5, Dx =1231-1 = -12 - 3 = -15, Dy =21211 = 2 - 12 = -10.
x = -15-5 = 3 and y = -10-5 = 2, so the solution is (3, 2).
If D = 0 Cramer's rule fails: the system has either no solution or infinitely many, and you must row reduce to tell which.
8. Matrix Inverses
The 2 × 2 shortcut — memorize this one
Swap the main diagonal (a and d), negate the other diagonal (b and c), then divide by the determinant ad - bc.
Example: invert a 2 × 2
- A =4726, so a = 4, b = 7, c = 2, d = 6.
- det = ad - bc = 4(6) - 7(2) = 24 - 14 = 10. Not 0, so the inverse exists.
- Swap and negate:6-7-24
- Divide by 10: A-1 = 1106-7-24 =0.6-0.7-0.20.4
- Check: AA-1 = 110100010 =1001 = I
Larger matrices: row reduce [ A | I ] into [ I | A-1 ]
Whatever sequence of row operations turns A into I will turn I into A-1. Invert123014560:
- Augment with the identity:123100014010560001
- R3 - 5R1 → R3:1231000140100-4-15-501
- R3 + 4R2 → R3:123100014010001-541
- Now clear upward. R2 - 4R3 → R2 and R1 - 3R3 → R1:12016-12-301020-15-4001-541
- R1 - 2R2 → R1 finishes the identity:100-2418501020-15-4001-541
- So A-1 =-2418520-15-4-541
Inverse properties
- (A-1)-1 = A
- (AB)-1 = B-1A-1 — the order reverses
- (AT)-1 = (A-1)T
- det(A-1) = 1det(A)
- (kA)-1 = 1kA-1
- I-1 = I
9. Matrix Determinants
The determinant is a single number attached to a square matrix, written det(A) or |A|. It answers one question: does this matrix have an inverse?
2 × 2 determinant
abcd = ad - bc
Main diagonal product minus anti-diagonal product.
Example:3524 = 3(4) - 5(2) = 12 - 10 = 2
Geometric meaning: an area scale factor
|det(A)| is the factor by which A scales area (volume for a 3 × 3). A negative determinant means the transformation also flips orientation, and det = 0 means it squashes the plane onto a line — which is exactly why a singular matrix cannot be undone.
3 × 3 method A: expansion by minors (cofactor expansion)
det = aefhi - bdfgi + cdegh
For each entry in the top row, cross out its row and column, take the 2 × 2 determinant that is left (its minor), and attach the sign from this checkerboard:
+-+-+-+-+
You may expand along any row or column. Pick the one with the most zeros — each zero kills a whole 2 × 2 computation.
3 × 3 method B: the diagonal (Sarrus) rule
Copy columns 1 and 2 to the right, add the three products running down-right, and subtract the three running up-right.
Worked example: the same 3 × 3 both ways
Find det1234567810
- Minors: 156810 - 246710 + 34578
- = 1(50 - 48) - 2(40 - 42) + 3(32 - 35)
- = 1(2) - 2(-2) + 3(-3) = 2 + 4 - 9 = -3
- Sarrus check: down-right gives 1(5)(10) + 2(6)(7) + 3(4)(8) = 50 + 84 + 96 = 230
- up-right gives 3(5)(7) + 1(6)(8) + 2(4)(10) = 105 + 48 + 80 = 233
- 230 - 233 = -3. Both methods agree, and since det ≠ 0 this matrix is invertible.
Determinant properties
- det(AB) = det(A)⋅det(B)
- det(AT) = det(A)
- det(kA) = kn⋅det(A) for an n × n matrix
- Swapping two rows flips the sign of the determinant
- Multiplying one row by k multiplies the determinant by k
- Adding a multiple of one row to another does not change the determinant
- A row (or column) of all zeros, or two identical rows ⇒ det = 0
- Triangular or diagonal matrix ⇒ det = the product of the main-diagonal entries
What det = 0 tells you (all the same statement)
- A has no inverse (A is singular)
- AX = B has no unique solution
- AX = O has a nonzero solution
- The rows (and columns) are linearly dependent
- The transformation collapses area to zero
- Rank < n
Bonus: the area of a triangle with vertices (x1, y1), (x2, y2), (x3, y3) is 12 times the absolute value ofx1y11x2y21x3y31. If it is 0, the three points are collinear.
10. Matrices as Transformations
A 2 × 2 matrix moves every point of the plane
The key insight: the first column is where the point (1, 0) lands and the second column is where (0, 1) lands. If you know where those two points go, you know the matrix — just write their images as the columns.
To transform a whole polygon, put its vertices in the columns of a matrix and multiply once. A triangle becomes a 2 × 3 matrix, so the product is again 2 × 3: the three new vertices.
The standard transformation matrices
In every diagram the dashed gray shape is the original and the solid blue shape is the image.
| Transformation | Matrix | Effect | What it does | det |
|---|---|---|---|---|
| Identity | 1001 | Leaves every point exactly where it was | 1 | |
| Dilation by k (k = 2) | k00k | Scales away from the origin in both directions | k² = 4 | |
| Horizontal stretch (k = 2) | k001 | Stretches only the x-direction; heights unchanged | k = 2 | |
| Reflect over the x-axis | 100-1 | Flips up and down: (x, y) becomes (x, -y) | -1 | |
| Reflect over the y-axis | -1001 | Flips left and right: (x, y) becomes (-x, y) | -1 | |
| Reflect over y = x | 0110 | Swaps the coordinates: (x, y) becomes (y, x) | -1 | |
| Rotate 90° counterclockwise | 0-110 | (x, y) becomes (-y, x) | 1 | |
| Rotate 180° | -100-1 | (x, y) becomes (-x, -y); same as reflecting through the origin | 1 | |
| Rotate 90° clockwise | 01-10 | (x, y) becomes (y, -x) | 1 | |
| Rotate θ (shown at 30°) | cos θ-sin θsin θcos θ | Turns every point counterclockwise about the origin by θ | 1 | |
| Horizontal shear (k = 1) | 1k01 | Slides points sideways in proportion to their height | 1 | |
| Vertical shear (k = 1) | 10k1 | Slides points up in proportion to their x-value | 1 | |
| Project onto the x-axis | 1000 | Flattens the whole plane onto a line: area is destroyed | 0 |
Composing transformations
To rotate and then reflect, the matrix is MR, not RM: the transformation applied first sits closest to the point vector on the right.
M(R(v)) = (MR)v
This is exactly why AB ≠ BA: rotating then reflecting genuinely lands somewhere different from reflecting then rotating. Undoing a composition reverses the order: (MR)-1 = R-1M-1.
Translations need a third dimension
A 2 × 2 matrix always fixes the origin, so it can never slide a shape. Graphics software gets around this with homogeneous coordinates: write the point as (x, y, 1) and use a 3 × 3 matrix.
10h01k001xy1 =x + hy + k1
Now translation is a matrix too, so rotate-scale-translate chains multiply into one matrix.
11. Applications of Matrices
Computer graphics and games
Every model in a 3D game is a list of points. Rotating a camera, animating a limb, or projecting the world onto your screen is a 4 × 4 matrix multiplication done millions of times per second. GPUs exist largely to do this.
Circuits and engineering
Kirchhoff's laws on a circuit with six loops give six linear equations. Structural engineers do the same for forces in a truss. Nobody solves these by substitution — they row reduce.
Cryptography: the Hill cipher
Encode letters as numbers (A = 0 … Z = 25), group them into vectors, and multiply by a key matrix mod 26. Decrypting uses the inverse matrix — which is why the key must have a determinant that is invertible mod 26.
With key 3325, the pair "HI" = 78 becomes4554 → mod 26 →192 = "TC".
Markov chains: predicting the next state
A transition matrix holds the probability of moving between states. If 90% of this year's subscribers stay and 20% of non-subscribers join, then0.90.20.10.8 times the current state vector predicts next year. Raise it to the nth power to project n years out.
Networks and adjacency matrices
Put a 1 in row i, column j when node i connects to node j:011101110
Entry (i, j) of An counts the paths of length n from i to j. This is how social networks suggest "people you may know" and how Google's original PageRank ranked web pages.
Economics: Leontief input-output models
Industries consume each other's output. Solving (I - A)X = D, where A is the consumption matrix and D is outside demand, tells an economy how much of each good to produce. This model won a Nobel Prize.
Images and data
A grayscale photo is a matrix of brightness values. Blurring, sharpening, and edge detection are small matrices (kernels) slid across it. Spreadsheets, gradebooks, and inventory tables are matrices too — which is why scaling a whole price list is one scalar multiplication.
Machine learning and neural networks
Each layer of a neural network computes Wx + b — a matrix times an input vector, plus a bias vector. Training a model is mostly matrix multiplication at enormous scale.
Quick Reference & Exam Survival
The seven most common mistakes
- Writing dimensions as columns × rows instead of rows × columns.
- Multiplying entry by entry instead of row times column.
- Assuming AB = BA, or cancelling A from both sides of AB = AC.
- Negating a and d instead of b and c in the 2 × 2 inverse.
- Forgetting the middle minus sign in the cofactor expansion (+, -, +).
- Omitting the 0 for a variable missing from an equation.
- Changing the wrong row in a row operation, or changing two rows at once.
On a TI-84 (and most graphing calculators)
- 2nd → x-1 opens the MATRIX menu.
- EDIT → pick [A] → type the dimensions, then the entries.
- QUIT, then NAMES to paste [A] into a calculation.
- [A] x-1 gives the inverse; MATH → det( gives the determinant.
- MATH → rref([A]) row reduces an augmented matrix in one keystroke.
- MATH → Frac converts ugly decimals back into fractions.
Most teachers still want the row operations written out, so use the calculator to check, not to replace the work.
Notation glossary
A matrix (capital letter)
aij entry in row i, col j
m × n rows by columns
AT transpose
A-1 inverse
|A| or det(A) determinant
I identity matrix
O zero matrix
[A|B] augmented matrix
Ri row i
rref(A) reduced row-echelon form
Mij minor of aij
Coming next: eigenvalues and eigenvectors
An eigenvector is a vector that a matrix only stretches, never turns: Av = λv, where the scale factor λ is the eigenvalue. You find the eigenvalues by solving det(A - λI) = 0. They are the backbone of vibration analysis, quantum mechanics, PageRank, and principal component analysis, and they are usually the first topic of a college linear algebra course.