WhatsApp us
University Maths25 Nov 2026

Singular Value Decomposition Explained, with Step-by-Step Examples

What the singular value decomposition A = UΣVᵀ means, how to compute it by hand for square and rectangular matrices, and how it gives low-rank approximations and the pseudo-inverse, with checked examples and practice.

Singular Value Decomposition Explained, with Step-by-Step Examples

The singular value decomposition writes any m×n matrix as A = UΣVᵀ, where U and V are orthogonal and Σ is diagonal with non-negative entries σ₁ ≥ σ₂ ≥ … called the singular values. To compute it by hand, find the eigenvalues and orthonormal eigenvectors of AᵀA (these give σᵢ² and the columns of V), then set uᵢ = Avᵢ/σᵢ. Unlike diagonalisation, it works for every matrix, square or not, and it is the tool behind least squares solvers, image compression and principal component analysis.

What the three factors mean

Read A = UΣVᵀ from right to left as three simple moves applied to a vector:

  1. Vᵀ rotates (or reflects) the input so the special input directions v₁, v₂, … line up with the axes.
  2. Σ stretches along each axis by σ₁, σ₂, … (and drops or pads dimensions if A is not square).
  3. U rotates the result into the output directions u₁, u₂, ….

So A sends the unit sphere to an ellipsoid whose semi-axes have lengths σ₁, σ₂, … in the directions u₁, u₂, …. The key identity behind every computation is

Avᵢ = σᵢuᵢ

Many first courses reach the SVD at the end; at the University of Illinois, for example, MATH 257 "Linear Algebra with Computational Applications" includes eigenvalues and the SVD. If you want this taught against your own syllabus, our online tutoring for linear algebra page explains how sessions with Ajay Vatsyayan work.

The hand method

  1. Compute AᵀA (n×n, symmetric).
  2. Find its eigenvalues λᵢ ≥ 0 in decreasing order. Then σᵢ = √λᵢ.
  3. Find orthonormal eigenvectors vᵢ of AᵀA. These are the columns of V.
  4. For each σᵢ > 0, set uᵢ = Avᵢ / σᵢ. These are automatically orthonormal.
  5. If U needs more columns (when m is larger than the number of nonzero σ's), complete it with an orthonormal basis of the null space of Aᵀ.

If A is wide (m < n), it is often quicker to start from the smaller matrix AAᵀ, get U first, and use vᵢ = Aᵀuᵢ / σᵢ.

Example 1: a full 2×2 SVD

Let A = [[2, 0], [3, 2]].

Step 1. AᵀA = [[13, 6], [6, 4]].

Step 2. Trace 17, det 52 − 36 = 16, so λ² − 17λ + 16 = (λ − 16)(λ − 1). The singular values are σ₁ = 4 and σ₂ = 1.

Step 3. For λ = 16: AᵀA − 16I = [[−3, 6], [6, −12]] gives (2, 1), so v₁ = (2, 1)/√5. For λ = 1: [[12, 6], [6, 3]] gives (1, −2), so v₂ = (1, −2)/√5.

Step 4. Av₁ = (4, 8)/√5, so u₁ = (1, 2)/√5. Av₂ = (2, −1)/√5, so u₂ = (2, −1)/√5.

So U = (1/√5)[[1, 2], [2, −1]], Σ = diag(4, 1), V = (1/√5)[[2, 1], [1, −2]]. Multiplying UΣVᵀ gives back [[2, 0], [3, 2]].

Two checks: σ₁σ₂ = 4 = |det A|, and σ₁² + σ₂² = 17 = 2² + 0² + 3² + 2², the sum of the squared entries.

Notice that A is triangular with eigenvalues 2 and 2, yet its singular values are 4 and 1. Eigenvalues and singular values are different things unless the matrix is symmetric with non-negative eigenvalues.

Example 2: a wide 2×3 matrix

Let B = [[1, 1, 0], [0, 1, 1]]. Work from the 2×2 matrix BBᵀ = [[2, 1], [1, 2]], which has eigenvalues 3 and 1 with eigenvectors (1, 1) and (1, −1).

σ₁ = √3, σ₂ = 1, u₁ = (1, 1)/√2, u₂ = (1, −1)/√2

Now vᵢ = Bᵀuᵢ / σᵢ:

v₁ = (1, 2, 1)/√6, v₂ = (1, 0, −1)/√2

V must be 3×3, so complete it with a unit vector in the null space of B. Solving Bx = 0 gives (1, −1, 1), so v₃ = (1, −1, 1)/√3. Σ is 2×3: [[√3, 0, 0], [0, 1, 0]].

The number of nonzero singular values is the rank (here 2), and the extra columns of V span the null space: the rank–nullity theorem read straight off the decomposition.

Example 3: a rank-one matrix in one line

Let C = [[2, 4], [1, 2], [2, 4]]. Every row is a multiple of (1, 2), so C = (2, 1, 2)ᵀ(1, 2), an outer product.

For any outer product xyᵀ, the only nonzero singular value is ‖x‖‖y‖, with u₁ = x/‖x‖ and v₁ = y/‖y‖. Here ‖(2, 1, 2)‖ = 3 and ‖(1, 2)‖ = √5, so

σ₁ = 3√5, u₁ = (2, 1, 2)/3, v₁ = (1, 2)/√5

Spotting rank one saves the whole eigenvalue calculation.

Example 4: the closest rank-one approximation

The SVD splits A into a sum of rank-one layers:

A = σ₁u₁v₁ᵀ + σ₂u₂v₂ᵀ + …

Keeping only the first k layers gives the closest rank-k matrix to A (the Eckart–Young theorem), and the error in the 2-norm is σₖ₊₁.

For A = [[2, 0], [3, 2]] from Example 1:

A₁ = 4u₁v₁ᵀ = (4/5)[[2, 1], [4, 2]] = [[1.6, 0.8], [3.2, 1.6]]

A − A₁ = [[0.4, −0.8], [−0.2, 0.4]], whose largest singular value is exactly 1 = σ₂.

This is image compression in miniature: store a few σ's and vectors instead of every entry.

Example 5: the pseudo-inverse and the shortest solution

For B in Example 2, the system Bx = (3, 3) has infinitely many solutions. The pseudo-inverse B⁺ = VΣ⁺Uᵀ, where Σ⁺ inverts each nonzero σ, picks the one of smallest length. Here

B⁺ = (1/3)[[2, −1], [1, 1], [−1, 2]]

and B⁺(3, 3) = (1, 2, 1). Check: B(1, 2, 1) = (3, 3). Every other solution is (1, 2, 1) + t(1, −1, 1), and since (1, 2, 1)·(1, −1, 1) = 0, adding any multiple of the null vector only makes it longer.

For a tall matrix with independent columns, the same formula gives the ordinary least squares solution, which is why numerical libraries solve least squares with the SVD when A is close to rank-deficient. Our walkthrough of Gram–Schmidt and least squares covers the normal-equation and QR routes.

Example 6: norm and condition number

From Example 1, the unit circle maps to an ellipse with semi-axes 4 and 1. Two facts follow at once:

  • ‖A‖₂ = σ₁ = 4: no unit vector is stretched by more than 4, and v₁ achieves it.
  • Condition number = σ₁/σₙ = 4: relative errors in b can be amplified up to four times in the solution of Ax = b.

A matrix with σ's 1000 and 0.001 is technically invertible but numerically fragile, and only the SVD shows that clearly.

SVD or eigendecomposition?

Eigendecomposition A = PDP⁻¹SVD A = UΣVᵀ
Which matricesSquare, and only if diagonalisableEvery matrix, any shape
Diagonal entriesEigenvalues, may be negative or complexSingular values, real and ≥ 0
Outer factorsP, usually not orthogonalU and V, always orthogonal
Input and output basesSame basis on both sidesDifferent bases, v's in and u's out
Typical usesPowers, dynamics, differential equationsRank, least squares, compression, PCA

For a real symmetric matrix the two nearly coincide: the singular values are the absolute values of the eigenvalues. See orthogonal diagonalisation for that case.

Where students lose marks

  • Forgetting the square root. The eigenvalues of AᵀA are σ², not σ.
  • Finding U and V separately. Eigenvectors of AAᵀ and AᵀA are each fixed only up to sign, so independent choices can break A = UΣVᵀ. Get V first, then uᵢ = Avᵢ/σᵢ.
  • Wrong order. List σ's in decreasing order and keep the columns of U and V in the same order.
  • Wrong shape of Σ. Σ is m×n, the same shape as A, with zeros padding the extra rows or columns.
  • Skipping the completion step. If A is tall or rank-deficient, U or V needs extra orthonormal columns from a null space.
  • Treating singular values as eigenvalues. Example 1 shows they differ; only for symmetric positive semidefinite matrices are they the same.
  • Unnormalised vectors. U and V must have unit columns, or the product will be off by constant factors.

Practice questions

  1. Find an SVD of [[3, 0], [0, −2]].
  2. Find the singular values of [[4, 1], [−1, 4]] and explain the answer geometrically.
  3. Find the nonzero singular value and the vectors u₁, v₁ of [[1, 1], [2, 2], [2, 2]].
  4. Compare the eigenvalues and singular values of [[1, 2], [0, 1]].
  5. Find the closest rank-one matrix to S = [[3, 1], [1, 3]] and the 2-norm error.
  6. A 5×3 matrix has singular values 6, 2 and 0. Give its rank, the dimension of its null space and its 2-norm.

Answers.

  1. U = I, Σ = diag(3, 2), V = diag(1, −1). (The minus sign goes into V or U, never into Σ.)
  2. AᵀA = 17I, so both singular values are √17: the matrix is √17 times a rotation.
  3. σ₁ = 3√2, u₁ = (1, 2, 2)/3, v₁ = (1, 1)/√2.
  4. Eigenvalues 1 and 1; singular values √2 + 1 and √2 − 1 (about 2.414 and 0.414). Their product is 1 = det.
  5. σ's are 4 and 2 with v₁ = u₁ = (1, 1)/√2, so the approximation is [[2, 2], [2, 2]] with error 2.
  6. Rank 2, null space dimension 1, 2-norm 6.

Where the SVD leads next

The SVD is where linear algebra meets computation. Principal component analysis is the SVD of a centred data matrix; recommender systems and latent semantic analysis use truncated SVDs; numerical analysis uses it for rank, conditioning and stable least squares. Our guide to the linear algebra machine learning actually uses shows these links with small examples. If the eigenvalue steps above felt slow, revisit our step-by-step eigenvalues and eigenvectors, and for the idea of one map written in two different bases, see the matrix of a linear transformation.

How Maths Bodhi helps

SVD questions combine three earlier skills, eigenvectors, orthonormal bases and matrix shapes, so one weak link spoils the answer. In online sessions we take your own course problems, rebuild the method with you, and review your attempts so each check becomes automatic. We explain and practise; we don't complete graded work. Students on a US degree can see our college maths tutoring.

Home tuition is available in Gurgaon (Gurugram). Students elsewhere in India and abroad learn with us online. You can book a free demo class.

Written and checked by the Maths Bodhi team (November 2026).

Frequently asked questions

What is singular value decomposition in simple terms?
It writes any matrix as a rotation, then a stretch along perpendicular axes, then another rotation: A = UΣVᵀ.
How do you calculate SVD by hand?
Find eigenvalues and orthonormal eigenvectors of AᵀA to get σᵢ = √λᵢ and V, then set uᵢ = Avᵢ/σᵢ.
What is the difference between SVD and eigenvalue decomposition?
SVD exists for every matrix and uses two orthogonal bases; eigendecomposition needs a square diagonalisable matrix and one basis.
Are singular values always positive?
They are always real and non-negative; zero singular values correspond to the null space, and the count of nonzero ones is the rank.
Why is SVD used in machine learning?
It gives principal components, low-rank approximations and stable least squares solutions, all central to data analysis.
Is SVD unique?
The singular values are unique; the vectors are unique up to sign when the σ's are distinct, and less so when some repeat.
singular value decompositionSVDlinear algebrapseudo-inverseuniversity maths

Related guides

Keep exploring this maths topic

University Maths25 Nov 2026

Linear Algebra for Machine Learning: What You Actually Need, with Small Worked Examples

The linear algebra that computer science and data science students really use in machine learning, mapped to the topics of a standard course, with a small worked example for each idea.

linear algebramachine learningdata sciencePCA

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

The Gram–Schmidt Process and Least Squares, Step by Step

How the Gram–Schmidt process builds an orthogonal basis, how it gives the QR factorisation, and how both solve least squares problems such as fitting a line, with six checked examples and practice.

Gram-Schmidtleast squaresQR factorisationlinear algebra

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

Diagonalization of a Matrix: The Test, the Method and 6 Worked Examples

How to diagonalise a matrix as A = PDP⁻¹, how to tell quickly whether it can be done, and how to use it for matrix powers, symmetric matrices and differential equations, with checked examples and practice.

diagonalizationlinear algebraeigenvaluesmatrix powers

By Maths Bodhi Team

Read guide

University Maths18 Nov 2026

Eigenvalues and Eigenvectors Step by Step, with 6 Worked Examples

How to find eigenvalues and eigenvectors of 2×2 and 3×3 matrices, step by step: repeated and complex eigenvalues, trace and determinant checks, common mistakes and practice with answers.

eigenvalueseigenvectorslinear algebracharacteristic polynomial

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

How to Find the Matrix of a Linear Transformation: Examples and Solutions

How to build the matrix of a linear transformation from a formula, from images of other vectors, from a geometric description, on polynomial and function spaces, and in a new basis, with six checked examples and practice.

linear transformationslinear algebrachange of basisstandard matrix

By Maths Bodhi Team

Read guide

University Maths25 Nov 2026

The Rank–Nullity Theorem Explained, with Examples for Matrices and Linear Transformations

What the rank–nullity theorem says, why it is true, and how to use it on matrices, polynomial maps and matrix spaces, with six checked examples, common mistakes and practice.

rank nullity theoremlinear algebranull spacelinear transformations

By Maths Bodhi Team

Read guide