The Identity Matrix
Multiply any number by 1 and nothing happens:
1 \times 7 = 7, 1 \times (-3) = -3. The
number 1 is multiplication's "do nothing" button. Matrices multiply
vectors and other matrices — so is there a matrix that does nothing, the way
1 does nothing to a number?
Yes. It's called the identity matrix, written I. It has
1s down the main diagonal and 0s everywhere
else:
I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \qquad I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}.
Multiply any vector by I and it comes back unchanged,
I\vec{x} = \vec{x}; multiply any matrix by I
and you get that matrix back, IA = AI = A. The identity plays the role
for matrices that 1 plays for numbers: the neutral element of
multiplication — and, as you'll see later, it's the target every "undo" operation aims for.
Building it: the diagonal-of-1s pattern
The pattern scales to any size. The identity matrix I_n is the
n\times n matrix whose entry in row i,
column j follows one simple rule:
(I_n)_{ij} = \begin{cases} 1 & \text{if } i = j \\ 0 & \text{if } i \ne j. \end{cases}
In words: put a 1 wherever the row number matches the column number,
and a 0 everywhere else. I_2 is
2\times 2, I_3 is
3\times 3, I_4 is
4\times 4 — one identity matrix for every size, always square, always
built from the same rule.
Try applying the rule by hand to build I_4. Row 2, column 2: row
number equals column number, so that entry is 1. Row 2, column 3: row
number does not equal column number, so that entry is 0. Fill
in all sixteen entries this way and you get:
I_4 = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}.
Twelve of those sixteen entries are 0; only the four where the row
matches the column are 1. That ratio gets more lopsided the bigger the
matrix gets — a 10\times 10 identity has a hundred entries, but only
ten of them are 1.
Nothing moves
The columns of I are exactly the standard
unit vectors
\hat{\imath} and \hat{\jmath} — so, read as
a weighted sum of
columns, I\vec{x} just rebuilds
\vec{x}. Move the input below; the output arrow sits exactly on top of
it, every time.
Worked example: why each entry survives
Let's see exactly why, using the row-dot-product recipe from
matrix-times-vector:
each output entry is the dot product of one row of the matrix with the whole input vector. Take
I_3\vec{x} = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} 4 \\ -2 \\ 7 \end{bmatrix}.
The first output entry is row 1 of I_3 dotted with
\vec{x}:
1(4) + 0(-2) + 0(7) = 4.
The 1 lands exactly on the entry it's "pointing at" — the first entry
of \vec{x} — and every other term is multiplied by
0, so it vanishes. The second and third rows do the same trick, picking
out -2 and 7 respectively:
I_3\vec{x} = \begin{bmatrix} 1(4) + 0(-2) + 0(7) \\ 0(4) + 1(-2) + 0(7) \\ 0(4) + 0(-2) + 1(7) \end{bmatrix} = \begin{bmatrix} 4 \\ -2 \\ 7 \end{bmatrix} = \vec{x}.
Nothing was computed, really — every row's single 1 just copies one
coordinate straight through. That's the whole mechanism behind "I does
nothing."
Worked example: I is a universal "do nothing"
The same trick works when I multiplies an entire matrix, not just a
single vector — because multiplying two matrices just means doing the row-times-column recipe once
per column of the second matrix. Take
A = \begin{bmatrix} 3 & -5 \\ 8 & 2 \end{bmatrix}, \qquad I_2 A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} 3 & -5 \\ 8 & 2 \end{bmatrix}.
Column 1 of A is (3, 8) — treat it as a
vector and multiply by I_2 exactly as before, and it comes back
untouched: (3, 8). Column 2, (-5, 2), comes
back the same way. Stack the two surviving columns back together:
I_2 A = \begin{bmatrix} 3 & -5 \\ 8 & 2 \end{bmatrix} = A.
I doesn't just leave one special vector alone — it leaves
every vector alone, so it leaves every column of every matrix alone, so it leaves every
matrix alone. That's what "universal do-nothing" means.
Here's a detail worth pausing on: matrix multiplication usually cares deeply about
order — for most matrices, AB and
BA are completely different matrices, or one of them might not even be
defined. Try multiplying the same A by I_2
the other way round, AI_2, and run the identical row-times-column
argument on the rows of A instead of its columns:
A I_2 = \begin{bmatrix} 3 & -5 \\ 8 & 2 \end{bmatrix}\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 3 & -5 \\ 8 & 2 \end{bmatrix} = A.
Same answer either way: I_2 A = A I_2 = A. The identity matrix is one
of the very few matrices for which order never matters — another way of saying it truly does
nothing, no matter which side it sits on.
Why a "do nothing" is so useful
Because it's the goal of undoing. The
inverse
of a matrix A is the matrix A^{-1} that
cancels it: A^{-1}A = I and AA^{-1} = I.
"Get back to where you started" is the identity — every time you'll solve for an inverse
matrix later, I is the target you're aiming the answer at.
For every whole number n \ge 1, there is exactly one
n\times n identity matrix I_n, and it
satisfies:
- I_n\vec{x} = \vec{x} for every vector \vec{x}
with n entries.
- I_n A = A and A I_n = A for every
n\times n matrix A.
- (I_n)_{ij} = 1 if i = j, and
0 otherwise.
Two mix-ups trip people up almost every time:
-
The identity matrix must be square, and it must match the size you're working with.
If your vectors live in 2D, you need I_2 — a
3\times 3 identity I_3 can't multiply a
2-entry vector at all, the shapes simply don't fit. Always pick the identity that matches the
vector or matrix size you're multiplying.
-
Don't confuse the identity matrix with the zero matrix. They look similar (both
are "special" matrices full of simple numbers) but play opposite roles: the identity
matrix I (all 1s on the diagonal) is the
"do nothing" for multiplication, IA = A. The zero matrix
O (every entry 0) is the "do nothing" for
addition, O + A = A. Multiplying by the zero matrix does the
opposite of nothing — it crushes every vector down to \vec{0}.
Every "solve for the inverse" problem you'll meet is secretly a hunt for
I: given A, you're looking for the mystery
matrix that multiplies with it to produce exactly I — nothing more,
nothing less. Keep an eye on I now, because the entire idea of a matrix
inverse is built on chasing it down.
The identity also has a very concrete life inside computer graphics and game engines. Every
object on screen — a character, a spaceship, a camera — carries a transformation matrix that
encodes its rotation, scaling and position. Before anything has moved or turned at all, that
matrix is set to the identity matrix: "no rotation, no resizing, no shift" is precisely what
multiplying by I means. Hit "reset transform" in any 3D editor and
you're really just asking it to swap the object's matrix back to I.
See it explained