Null Space of a Matrix

April 13, 2026

Problem

Find the null space of A = [[1,2,1],[2,4,2]]. Describe all solutions to A·x = 0.

Explanation

Definition

The null space (or kernel) of an m×nm \times n matrix AA is Null(A)={xRn:Ax=0}\operatorname{Null}(A) = \{ \mathbf{x} \in \mathbb{R}^n : A \mathbf{x} = \mathbf{0}\}

It's a subspace of Rn\mathbb{R}^n: closed under addition and scalar multiplication, contains 0\mathbf{0}.

The dimension of the null space is called the nullity; by rank–nullity, nullity(A)=nrank(A)\operatorname{nullity}(A) = n - \operatorname{rank}(A).

Step-by-step

A=(121242)A = \begin{pmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \end{pmatrix}

Step 1 — Row reduce.

R2R22R1R_2 \to R_2 - 2R_1: (2,4,2)2(1,2,1)=(0,0,0)(2, 4, 2) - 2(1, 2, 1) = (0, 0, 0).

RREF(A)=(121000)\text{RREF}(A) = \begin{pmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \end{pmatrix}

Step 2 — Identify pivots and free variables.

Pivot column: column 1. Free columns: columns 2 and 3. Let x2=sx_2 = s, x3=tx_3 = t.

Step 3 — Solve for pivot variables.

From row 1: x1+2x2+x3=0    x1=2stx_1 + 2 x_2 + x_3 = 0 \implies x_1 = -2 s - t.

Step 4 — Write the general solution.

x=(2stst)=s(210)+t(101)\mathbf{x} = \begin{pmatrix} -2s - t \\ s \\ t \end{pmatrix} = s \begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix} + t \begin{pmatrix} -1 \\ 0 \\ 1 \end{pmatrix}

Step 5 — A basis for Null(A)\operatorname{Null}(A): {(210),(101)},nullity=2\left\{ \begin{pmatrix} -2 \\ 1 \\ 0 \end{pmatrix}, \begin{pmatrix} -1 \\ 0 \\ 1 \end{pmatrix} \right\}, \quad \operatorname{nullity} = 2

Verification:

  • A(2,1,0)T=(2+2+0,4+4+0)=(0,0)A \cdot (-2, 1, 0)^T = (-2 + 2 + 0, -4 + 4 + 0) = (0, 0)
  • A(1,0,1)T=(1+0+1,2+0+2)=(0,0)A \cdot (-1, 0, 1)^T = (-1 + 0 + 1, -2 + 0 + 2) = (0, 0)

Why there are two free variables

AA is 2×32 \times 3, rank 1 (one pivot). Rank-nullity: 1+nullity=31 + \operatorname{nullity} = 3, so nullity=2\operatorname{nullity} = 2. Our answer has a 2-parameter family of solutions, matching.

Structure of solutions to Ax=bA \mathbf{x} = \mathbf{b}

Solutions to Ax=bA \mathbf{x} = \mathbf{b} (if any exist) have the form x=xp+xh\mathbf{x} = \mathbf{x}_p + \mathbf{x}_h

where xp\mathbf{x}_p is a particular solution and xh\mathbf{x}_h ranges over the null space. So the null space describes the freedom in any linear solution.

  • If Null(A)={0}\operatorname{Null}(A) = \{\mathbf{0}\}, the solution (if it exists) is unique.
  • If Null(A)\operatorname{Null}(A) is larger, the solution is a translated copy of the null space.

Where null spaces show up

  • Homogeneous ODEs: the space of solutions is the null space of a differential operator.
  • Linear regression: redundant features span a non-trivial null space of the design matrix.
  • Computer graphics: rotations have trivial null space; projections onto lower-dimensional subspaces have non-trivial null spaces.

Common mistakes

  • Including the zero solution as a basis vector. The zero vector is always in the null space, but a basis consists of non-zero independent vectors.
  • Mixing up "null space" and "zero matrix." Null space is a subspace of Rn\mathbb{R}^n, not a matrix.
  • Solving Ax=bA \mathbf{x} = \mathbf{b} and forgetting to translate by xp\mathbf{x}_p. For non-homogeneous systems, you add a particular solution to a null-space element.

Try it in the visualization

In 3D, the null-space vectors span a plane through the origin. The plane tilts as you edit AA's entries; its dimension updates from 0 (only origin) up to 3.

Interactive Visualization

Parameters

A = [[1,2,1],[2,4,2]] (rank 1)
1.00
0.50
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Null Space of a Matrix | MathSpin