Skip to content
GATEiit

GATE DA · Linear Algebra

LU decomposition and singular value decomposition (SVD)

LU factorisation from Gaussian elimination (with LDU and Cholesky), and the singular value decomposition with its uses in rank, norms, low-rank approximation and PCA; GATE asks for LU entries and singular values.

Before you start

This topic comes before: Dimensionality reduction: principal component analysis (PCA)

Concept notes

1. LU decomposition

LU decomposition writes a square matrix as A=LU, with L lower triangular and U upper triangular. It is Gaussian elimination recorded as a product:

  • U is the echelon form produced by elimination; its diagonal holds the pivots.
  • L has 1s on the diagonal and the multipliers lij=entry to eliminatepivot below it, each in the position it eliminated. This unit-diagonal convention is Doolittle's form. Crout's form instead puts 1s on the diagonal of U.

Existence. An invertible A has an LU factorisation without row exchanges if and only if every leading principal minor is non-zero (no zero pivot appears). Otherwise reorder the rows first: PA=LU with a permutation matrix P. For example, needs a row swap.

Solving Ax=b with A=LU takes two triangular solves:

  1. Forward substitution: Ly=b.
  2. Back substitution: Ux=y.

Factoring costs about n33 multiplications, but each new right-hand side then costs only about n2. That is why LU is used when the same A meets many b.

Determinant for free: det⁡A=det⁡L⋅det⁡U= product of the pivots (since det⁡L=1). With pivoting, multiply by det⁡P=±1.

2. LDU, LDLᵀ and Cholesky

Pull the pivots out of U to get the symmetric-looking LDU form: A=LDU, with L unit lower triangular, D=diag⁡(pivots) and U unit upper triangular. When no row exchanges are needed and A is invertible, this factorisation is unique.

Symmetric matrices. If A=AT, then U=LT and A=LDLT.

Positive definite matrices. A symmetric A is positive definite exactly when all its pivots are positive. Then D has a real square root and A=(LD)(LD)T=RRT, the Cholesky factorisation, with R lower triangular and a positive diagonal. Cholesky needs about half the work of LU and is the standard way to solve systems with covariance matrices or normal equations ATAx^=ATb.

Link with determinants: the k-th pivot equals Dk/Dk−1, the ratio of consecutive leading principal minors (with D0=1). So all pivots positive   ⟺   all leading minors positive   ⟺   positive definite, for symmetric A.

Factorisation Needs Shape
A=LU non-zero leading minors L unit lower, U upper
PA=LU any invertible A row swaps in P
A=LDLT symmetric, non-zero pivots D diagonal
A=RRT (Cholesky) symmetric positive definite R lower, positive diagonal

3. Singular value decomposition

Every real m×n matrix A, of any shape and rank, has a singular value decomposition A=UΣVT, where U (m×m) and V (n×n) are orthogonal, and Σ (m×n) is zero except for the singular values σ1≥σ2≥⋯≥0 on its diagonal.

How to compute it:

  • ATA=V(ΣTΣ)VT, so the columns of V (right singular vectors) are eigenvectors of ATA and σi2 are its eigenvalues.
  • AAT=U(ΣΣT)UT, so the columns of U (left singular vectors) are eigenvectors of AAT.
  • σi=λi(ATA); the non-zero eigenvalues of ATA and AAT are the same.
  • Link the two: Avi=σiui, so ui=Avi/σi for σi>0.

Key facts:

  • rank⁡A = number of non-zero singular values.
  • Singular values are never negative.
  • For symmetric A, σi=∣λi∣; for symmetric positive semidefinite A, the SVD is the eigendecomposition.
  • Geometrically, A maps the unit sphere to an ellipsoid with semi-axes σiui.

The reduced (thin) SVD keeps only the r non-zero singular values: A=UrΣrVrT=∑i=1rσiuiviT, a sum of r rank-one pieces.

v1v2multiply by AAv_i = σ_i u_iσ1 u1σ2 u2unit circle, right singular vectorsellipse, semi-axes σ1 and σ2
SVD geometry: A maps the unit circle to an ellipse

4. What the SVD is used for

Norms. The spectral norm is ∥A∥2=max⁡∥x∥=1∥Ax∥=σ1. The Frobenius norm satisfies ∥A∥F2=∑i,jaij2=∑iσi2=tr⁡(ATA).

Best low-rank approximation (Eckart–Young). Keeping the k largest terms, Ak=∑i=1kσiuiviT, gives the closest rank-k matrix to A. The errors are ∥A−Ak∥2=σk+1,∥A−Ak∥F=σk+12+⋯+σr2. This is the idea behind image compression and latent semantic analysis.

Pseudo-inverse. A+=VΣ+UT, where Σ+ inverts each non-zero σi and transposes the shape. x+=A+b is the least squares solution of smallest length; with independent columns, A+=(ATA)−1AT.

Condition number. For invertible square A, κ(A)=σ1/σn. A large κ means the system is sensitive to rounding.

PCA. For a centred data matrix X (N samples as rows), the covariance is 1NXTX (or 1N−1XTX). Its eigenvectors are the right singular vectors of X, and the variance along component i is σi2/N (or σi2/(N−1)). So PCA can be done directly from the SVD of X.

Want Read from the SVD
rank number of σi>0
spectral norm σ1
Frobenius norm ∑σi2
column space basis u1,…,ur
null space basis vr+1,…,vn

Formulas to remember

LUL unit lower triangular holding the multipliers
A=LU,lij=aij(j)ujj
Solve with LU
Ly=b,Ux=y
Determinant from LU
det⁡A=∏iuii
CholeskySymmetric positive definite A; R lower triangular
A=RRT
SVD
A=UΣVT=∑i=1rσiuiviT
Singular values
σi=λi(ATA),Avi=σiui
Norms
∥A∥2=σ1,∥A∥F2=∑iσi2
Eckart–Young
∥A−Ak∥2=σk+1,∥A−Ak∥F=∑i>kσi2

Common mistakes

  • Putting the multipliers in L with the wrong sign: if you do Ri−lijRj, then +lij goes into L.
  • Assuming every invertible matrix has A=LU without row exchanges; a zero pivot (such as a11=0) needs PA=LU.
  • Taking singular values as eigenvalues of A; they are square roots of eigenvalues of ATA and are never negative.
  • Mixing up U and V: V comes from ATA (size n), U from AAT (size m).
  • Using σk+1 as the Frobenius error of a rank-k approximation; that is the spectral-norm error. The Frobenius error is ∑i>kσi2.

Worked examples

Try each step yourself, then reveal the working.

Example 1: LU factorisation of a 3 by 3 matrix

numerical

Find the Doolittle LU factorisation of and det⁡A.

  1. Step 1: Eliminate the first column and record the multipliers.

    Try it on paper first.

Example 2: Solve a system with the LU factors

numerical

Using the factors above, solve Ax=b with b=(4,12,7).

  1. Step 1: Forward substitution: solve $L\mathbf{y} = \mathbf{b}$.

    Try it on paper first.

Example 3: SVD of a symmetric matrix with a negative eigenvalue

numerical

Find the singular values and an SVD of .

  1. Step 1: Find the eigenvalues of $A$ (it is symmetric).

    Try it on paper first.

Example 4: Norms and low-rank error from singular values

numerical

A matrix has singular values 5,3,1. Find ∥A∥2, ∥A∥F, and the errors of the best rank-1 approximation in both norms.

  1. Step 1: Spectral and Frobenius norms.

    Try it on paper first.

Previous year questions

2 official GATE DA questions on this topic, newest first.

Practise these 2 PYQs →

Topic test

10 questions: up to 2 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.