# Identity Matrix - Definition, Properties, Examples

[Algebra](/content/tag/algebra/index.html)

## What Is an Identity Matrix?

An **identity matrix** is a square matrix whose main-diagonal entries are all 1 and whose every other entry is 0. It is also called the **unit matrix**. In symbols, a_{ij} = 1 when i = j and a_{ij} = 0 when i ≠ j.

The 3x3 identity:
I_3 = \begin{bmatrix} 1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1 \end{bmatrix}

**Variable glossary.** a_{ij} is the entry in row i, column j. I (or I_n for a specific size) denotes the identity matrix. The subscript n in I_n is the order, so I_2 is 2×2 and I_3 is 3×3. Because it has nonzeros only on the diagonal, the identity is a special [diagonal matrix](/content/math/algebra/diagonal-matrix/index.html).

## How Is the Identity Matrix Written?

There is one identity matrix for each size n, all denoted I or, when the size matters, I_n:

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}

The size is fixed by context: when you multiply a 3×3 matrix by the identity, you use I_3, because the orders have to be compatible for [multiplication of matrices](/content/math/algebra/multiplication-of-matrices/index.html) to work.

## Why Does the Identity Matrix Act Like the Number 1?

The defining property is that multiplying by I changes nothing:

AI = IA = A

For ordinary numbers, 1 is the _multiplicative identity_: 5×1 = 5. The matrix I plays the same role for matrices, and it is one of the few matrices that commutes with everything: AIAI and IAIA both give A, even though matrix multiplication usually depends on order.

Two more properties follow directly:

- **Its determinant is 1.** The [determinant](/content/math/algebra/determinant-of-matrix/index.html) of a diagonal matrix is the product of the diagonal entries, and 1×1×⋯×1 = 1. So ∣I∣ = 1, which confirms the identity is always non-singular.
- **It is its own inverse.** Since II = I, the [inverse](/content/math/algebra/inverse-of-a-matrix/index.html) of the identity is the identity: I^{-1} = I. Any power works the same way, so I^n = I.

The identity is also the _destination_ of inversion: a matrix A times its inverse returns the identity, AA^{-1} = I. That equation is the definition of "inverse."

## Examples of the Identity Matrix

### Example 1

**Which of these is an identity matrix? \begin{bmatrix} 1 & 0 \\
0 & 1 \end{bmatrix} or \begin{bmatrix} 1 & 1 \\
0 & 1 \end{bmatrix}?**

Check the off-diagonal entries. The first has 0s off the diagonal and 1s on it. The second has a stray 1 at position (1,2).

**Final answer:** Only the first is an identity matrix. The second is upper-triangular, not the identity.

### Example 2

**Show that AI = AA = A for A = \begin{bmatrix} 2 & 5 \\
3 & 4 \end{bmatrix} and I = \begin{bmatrix} 1 & 0 \\
0 & 1 \end{bmatrix}.**

This is the wrong-path-first example.

_Wrong attempt._ A student "multiplies" by multiplying entry against entry, getting \begin{bmatrix} 2 & 0 \\
0 & 4 \end{bmatrix}, and concludes I does change A.

_Why it is wrong._ Matrix multiplication is row-by-column, not entry-by-entry.

_Correct._ Multiply each row of A against each column of I:

Top-left: (2)(1)+(5)(0)=2, Top-right: (2)(0)+(5)(1)=5, Bottom-left: (3)(1)+(4)(0)=3, Bottom-right: (3)(0)+(4)(1)=4.

AI = \begin{bmatrix} 2 & 5 \\
3 & 4 \end{bmatrix}.

**Final answer:** AI = AA = A, exactly as the identity property promises.

### Example 3

**Write the 4×4 identity matrix.**

Place 1s on the main diagonal, 0s everywhere else:

I_4 = \begin{bmatrix} 1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \end{bmatrix}.

**Final answer:** The matrix above, I_4.

### Example 4

**Find the determinant of I_5.**

The identity is diagonal, so its determinant is the product of the diagonal entries:

∣I_5∣=1×1×1×1×1=1.

**Final answer:** ∣I_5∣=1, and indeed ∣I_n∣=1 for every n.

### Example 5

**The matrix \begin{bmatrix} x & 0 \\
0 & y \end{bmatrix} is the 2×2 identity. Find x and y.**

For the identity, the diagonal entries must both equal 1:
x = 1,  y = 1.

**Final answer:** x = 1 and y = 1.

### Example 6

**Confirm I^{-1} = I for I = \begin{bmatrix} 1 & 0 \\
0 & 1 \end{bmatrix}.**

A matrix times its inverse gives the identity. Test I×I:

\begin{bmatrix} 1 & 0 \\
0 & 1 \end{bmatrix}\begin{bmatrix} 1 & 0 \\
0 & 1 \end{bmatrix} = I.

**Final answer:** I^{-1} = I.

## Why the Identity Matrix Matters

The identity matrix exists because matrix multiplication needed a  "do nothing" element to make the algebra complete. Without it, you cannot define inverses, and without inverses you cannot solve AX = B by writing X = A^{-1}B. The identity is the anchor the whole solving machinery hangs on.

Where it shows up beyond the textbook:

- **Solving equations.** Gaussian elimination drives a matrix toward the identity; the moment the left side becomes I, the right side holds the solution.
- **Computer graphics.** A transformation that leaves an object exactly where it is, with no rotation and no scaling, is the identity matrix.
- **The basis of inverses.** Every [invertible matrix](/content/math/algebra/invertible-matrix/index.html) is defined by the fact that AA^{-1} = I. The identity is the target that defines what an inverse even means.

### Why Students Get the Identity Matrix Wrong

### Mistake 1: Putting 1s everywhere instead of only the diagonal

**Where it slips in:** Writing the identity from memory.

**Don't do this:** Fill the whole matrix, or the first row, with 1s.

**The correct way:** Exactly one 1 per row, sitting on the main diagonal, and 0s everywhere else.

### Mistake 2: Assuming any diagonal matrix is the identity

**Where it slips in:** Seeing a clean diagonal matrix and naming it I.

**Don't do this:** Call \begin{bmatrix} 3 & 0 \\
0 & 3 \end{bmatrix} the identity.

**The correct way:** The diagonal entries must all be exactly 1.

### Mistake 3: Forgetting the identity must match the order for multiplication

**Where it slips in:** Multiplying a 3×3 matrix by I_2.

**Don't do this:** Use a 2×2 identity on a 3×3 matrix.

**The correct way:** Match the order: a 3×3 matrix needs I_3.

## Key Takeaways

- An identity matrix is a square matrix with 1s on the main diagonal and 0s elsewhere, written I or I_n.
- Multiplying any matrix by the identity leaves it unchanged: AI = IA = A
- Its determinant is always 1, and it is its own inverse: I^{-1} = I.
- The identity is a special diagonal and scalar matrix, with one identity matrix for each order.
- Reaching the identity is the goal of inversion and elimination.
