Matrices Cheat Sheet

Notation, row reduction, arithmetic, inverses, determinants, transformations, and where matrices actually get used

1. Identifying Matrices

Matrix:a rectangular array of numbers arranged in rows and columns, written inside square brackets. The plural of matrix is matrices.
Element (entry):a single number in the matrix, named aij where i is its row number and j is its column number.
Dimensions (order):written as m × n, read "m by n", where m = number of rows and n = number of columns.

Anatomy of a matrix

3 columns (n = 3) ↓

2 rows
(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.

⚠ Watch out:Rows always come before columns, in the dimensions and in the subscripts. Remember RC, like "RC Cola": Row then Column. A 3 × 2 matrix is not the same as a 2 × 3 matrix.

Types of matrices

NameExampleWhat makes it special
Row matrix (row vector)2-15Exactly one row: 1 x n
Column matrix (column vector)2-15Exactly one column: m x 1
Square matrix1234Same number of rows and columns (n x n). Only square matrices have determinants and inverses.
Zero matrix, O0000Every entry is 0. Acts like 0 does in arithmetic: A + O = A
Identity matrix, I10011s down the main diagonal, 0s elsewhere. Acts like 1 does: AI = IA = A
Diagonal matrix300-7Every entry off the main diagonal is 0
Upper triangular1406All zeros below the main diagonal (lower triangular is the mirror image)
Symmetric matrix1552A 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

21-131-32-43041

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.

⚠ Watch out:Before you build the matrix, put every equation in standard form with the variables in the same order and the constants on the right. A missing variable is a 0, not a blank, and a lone y means a coefficient of 1 (and -y means -1).

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

  1. Any all-zero rows sit at the bottom.
  2. The first nonzero entry of each row (the leading 1, or pivot) is a 1.
  3. 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

  1. Everything required for REF, plus:
  2. 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

  1. Build the augmented matrix:111623-151-125
  2. Clear column 1 below the pivot. R2 - 2R1 → R2 and R3 - R1 → R3:111601-3-70-21-1
  3. Clear column 2 below the pivot. R3 + 2R2 → R3:111601-3-700-5-15
  4. Make the last pivot a 1. -15R3 → R3, which gives REF:111601-3-70013
  5. 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.
  6. 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.

⚠ Watch out:Work one column at a time, left to right, and never undo a column you already cleared. When you write R2 - 2R1 → R2, only row 2 changes — row 1 stays exactly as it was. Also note the staircase does not have to sit on the diagonal: a column with no pivot just means a free variable.

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

  1. A + B: add matching spots — 2+3, -1+4, 0+(-2), 5+1 →53-26
  2. 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.

⚠ Watch out:A 2 × 3 and a 3 × 2 cannot be added — the correct answer is "undefined", not zero. Check dimensions first, every time. And when subtracting, distribute the minus sign to every entry of B, including the negative ones: -(-2) = +2.

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

  1. 32-105 → multiply all four entries by 3 →6-3015
  2. Combine with addition: 2A - 3B is "scale, then subtract". With A and B from section 4: 2A =4-2010, 3B =912-63
  3. 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
⚠ Watch out:Scalar multiplication hits every single entry. This is different from determinants, where factoring k out of an n × n matrix gives det(kA) = kn⋅det(A) — not k⋅det(A).

6. Multiplying Matrices

Step 1: check that the product even exists

inner numbers must match(2×3)(3×2)=2×2matrixouter numbers give the size of AB

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.

123456789101112=5864139154

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

  1. Dimensions: (2 × 3)(3 × 2), inner 3s match, so AB is 2 × 2.
  2. c11 = row 1 ⋅ col 1 = 1(7) + 2(9) + 3(11) = 7 + 18 + 33 = 58
  3. c12 = row 1 ⋅ col 2 = 1(8) + 2(10) + 3(12) = 8 + 20 + 36 = 64
  4. c21 = row 2 ⋅ col 1 = 4(7) + 5(9) + 6(11) = 28 + 45 + 66 = 139
  5. c22 = row 2 ⋅ col 2 = 4(8) + 5(10) + 6(12) = 32 + 50 + 72 = 154
  6. 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.

⚠ Watch out:Do not multiply entry by entry the way you add. Every answer entry is a sum of products. Also write the dimensions of the answer before you start computing — it tells you how many entries to find and catches undefined products early.

7. Representing & Solving Linear Systems with Matrices

The matrix equation

4726xy=1510isAX = B

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.

  1. A =4726, B =1510
  2. det(A) = 4(6) - 7(2) = 24 - 14 = 10. It is not 0, so a unique solution exists.
  3. A-1 = 1106-7-24
  4. X = A-1B = 1106(15) - 7(10)-2(15) + 4(10) = 1102010 =21
  5. Answer: x = 2, y = 1. Check: 4(2) + 7(1) = 15.

Three ways to solve AX = B

MethodHow it worksBest 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 matrixX = A-1BA is square with det ≠ 0, and you must solve the same system for several different B columns.
Cramer's ruleRatios 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.

⚠ Watch out:X = A-1B, never BA-1 — that product is usually not even defined. And there is no such thing as dividing by a matrix; the inverse is what replaces division.

8. Matrix Inverses

Definition:A-1 is the matrix that undoes A: AA-1 = A-1A = I. Only square matrices can have inverses, and only when det(A) ≠ 0.
Singular vs. invertible:det(A) = 0 means A is singular (no inverse). det(A) ≠ 0 means A is invertible or nonsingular.

The 2 × 2 shortcut — memorize this one

If A =abcdthen A-1 =1ad - bcd-b-ca

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

  1. A =4726, so a = 4, b = 7, c = 2, d = 6.
  2. det = ad - bc = 4(6) - 7(2) = 24 - 14 = 10. Not 0, so the inverse exists.
  3. Swap and negate:6-7-24
  4. Divide by 10: A-1 = 1106-7-24 =0.6-0.7-0.20.4
  5. 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:

  1. Augment with the identity:123100014010560001
  2. R3 - 5R1 → R3:1231000140100-4-15-501
  3. R3 + 4R2 → R3:123100014010001-541
  4. Now clear upward. R2 - 4R3 → R2 and R1 - 3R3 → R1:12016-12-301020-15-4001-541
  5. R1 - 2R2 → R1 finishes the identity:100-2418501020-15-4001-541
  6. 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
⚠ Watch out:In the 2 × 2 shortcut you swap a and d but negate b and c — do not negate a and d, and do not swap b and c. Also A-1 does not mean "one over each entry". If det = 0, stop and write "no inverse exists".

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

area 1area 5

|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

1231245645781078copied columnssolid = adddashed = subtract

Copy columns 1 and 2 to the right, add the three products running down-right, and subtract the three running up-right.

The Sarrus rule works for 3 × 3 only. There is no 4 × 4 version — use cofactor expansion or row reduction instead.

Worked example: the same 3 × 3 both ways

Find det1234567810

  1. Minors: 156810 - 246710 + 34578
  2. = 1(50 - 48) - 2(40 - 42) + 3(32 - 35)
  3. = 1(2) - 2(-2) + 3(-3) = 2 + 4 - 9 = -3
  4. Sarrus check: down-right gives 1(5)(10) + 2(6)(7) + 3(4)(8) = 50 + 84 + 96 = 230
  5. up-right gives 3(5)(7) + 1(6)(8) + 2(4)(10) = 105 + 48 + 80 = 233
  6. 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

abcdxy=ax + bycx + dy

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.

TransformationMatrixEffectWhat it doesdet
Identity1001Leaves every point exactly where it was1
Dilation by k (k = 2)k00kScales away from the origin in both directionsk² = 4
Horizontal stretch (k = 2)k001Stretches only the x-direction; heights unchangedk = 2
Reflect over the x-axis100-1Flips up and down: (x, y) becomes (x, -y)-1
Reflect over the y-axis-1001Flips left and right: (x, y) becomes (-x, y)-1
Reflect over y = x0110Swaps the coordinates: (x, y) becomes (y, x)-1
Rotate 90° counterclockwise0-110(x, y) becomes (-y, x)1
Rotate 180°-100-1(x, y) becomes (-x, -y); same as reflecting through the origin1
Rotate 90° clockwise01-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)1k01Slides points sideways in proportion to their height1
Vertical shear (k = 1)10k1Slides points up in proportion to their x-value1
Project onto the x-axis1000Flattens the whole plane onto a line: area is destroyed0

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.

⚠ Watch out:Points go in columns, not rows, so the multiplication is Av with the matrix on the left. Every one of these transformations is measured from the origin — rotating about some other center means translating to the origin, rotating, then translating back.

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

ABC

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

  1. Writing dimensions as columns × rows instead of rows × columns.
  2. Multiplying entry by entry instead of row times column.
  3. Assuming AB = BA, or cancelling A from both sides of AB = AC.
  4. Negating a and d instead of b and c in the 2 × 2 inverse.
  5. Forgetting the middle minus sign in the cofactor expansion (+, -, +).
  6. Omitting the 0 for a variable missing from an equation.
  7. Changing the wrong row in a row operation, or changing two rows at once.

On a TI-84 (and most graphing calculators)

  1. 2nd x-1 opens the MATRIX menu.
  2. EDIT → pick [A] → type the dimensions, then the entries.
  3. QUIT, then NAMES to paste [A] into a calculation.
  4. [A] x-1 gives the inverse; MATH → det( gives the determinant.
  5. MATH → rref([A]) row reduces an augmented matrix in one keystroke.
  6. 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.