How the SVD Calculator works
The singular value decomposition (SVD) factors any matrix A into three parts: A = UΣVᵀ, where U and V are orthogonal matrices — their columns are unit-length and mutually perpendicular — and Σ is a diagonal matrix of non-negative singular values, ordered from largest to smallest. For a 2×2 matrix A = [[a, b], [c, d]], this calculator computes the exact, closed-form SVD directly from a, b, c, and d — no iteration required.
Formula and method
The singular values come from the eigenvalues of AᵀA, a symmetric 2×2 matrix with entries m₁₁ = a² + c², m₂₂ = b² + d², and m₁₂ = ab + cd. Its eigenvalues are λ = (m₁₁ + m₂₂)/2 ± √[((m₁₁ − m₂₂)/2)² + m₁₂²], so the singular values are σ₁ = √λ₁ (the larger root) and σ₂ = √λ₂ (the smaller root). The right singular vectors — the columns of V — are the eigenvectors of AᵀA, found from the rotation angle θ = ½·atan2(2m₁₂, m₁₁ − m₂₂): v₁ = (cos θ, sin θ) and v₂ = (−sin θ, cos θ). The left singular vectors — the columns of U — then follow directly from uᵢ = A·vᵢ / σᵢ whenever σᵢ > 0; if a singular value is zero, its paired left vector is instead chosen perpendicular to the other one so that U stays orthogonal.
Reading the result
σ₁ is always the larger singular value and equals the matrix's operator (spectral) 2-norm — the largest factor by which A can stretch a unit vector. σ₂ is the smallest stretch factor. If σ₂ = 0, the matrix is singular (rank 1, assuming A is not the zero matrix) and collapses some direction to the zero vector. The ratio σ₁/σ₂ is the condition number: values near 1 mean the matrix scales all directions similarly, while very large values signal a matrix that is nearly singular and numerically sensitive to round-off in applications such as solving linear systems or matrix inversion.
Common sources of error
- Row/column mix-up: this calculator uses A = [[a, b], [c, d]] with a, b as row 1 and c, d as row 2 — double-check your entries match that layout before comparing against another source.
- Sign ambiguity: singular vectors are only unique up to a sign flip (u and −u paired with −v and v give the same product) — different tools may report a mathematically equivalent but sign-flipped U and V.
- Rounding early: the closed-form angle θ and σᵢ should be carried at full precision; rounding σᵢ before computing U can visibly break the orthogonality of U's columns.
Applications
- Image compression and noise reduction keep only the largest singular values/vectors to approximate a matrix with less data.
- Principal component analysis (PCA) uses the SVD of a centered data matrix to find directions of maximum variance.
- Numerical linear algebra uses the condition number σ₁/σ₂ to flag matrices that will amplify round-off error when solving Ax = b.
- Least-squares and pseudoinverse (Moore–Penrose) solutions are built directly from a matrix's SVD.