SVD Calculator
What is Singular Value Decomposition (SVD)?
Singular Value Decomposition (SVD) is a way to factor a matrix into three simpler pieces that clearly show how it stretches and rotates space. For a real matrix , the SVD writes
Formula: A = U Σ V^T
where:
- is an orthogonal matrix (its columns are unit vectors that are mutually perpendicular; geometrically, it represents a rotation or reflection in the output space).
- is another orthogonal matrix (it represents a rotation or reflection in the input space).
- is a diagonal matrix whose diagonal entries are the singular values of . These are nonnegative numbers that describe how much the matrix stretches vectors along special directions.
For the 2×2 case used by this calculator, you enter a matrix
Formula: A = a_11 a_12 a_21 a_22.
The calculator then finds matrices , , and such that . This gives you both the singular values and the associated singular vectors.
Key formulas for the 2×2 SVD
In general, the singular values of are the square roots of the eigenvalues of . For a 2×2 real matrix, this can be written out explicitly. Let
Formula: A^T A = b_11 b_12 b_12 b_22.
Then the eigenvalues and are given by the quadratic formula applied to the characteristic polynomial. In MathML form, the basic relationship between singular values and eigenvalues is:
Here is an eigenvalue of , and the corresponding singular value is . For a 2×2 matrix, you always get up to two singular values .
Once the calculator has the singular values, it computes the right singular vectors (columns of ) from the eigenvectors of . Finally, it finds the left singular vectors (columns of ) from
Formula: U = A V Σ^−1,
with appropriate handling of any zero singular values.
Geometric interpretation for 2×2 matrices
Because this tool focuses on 2×2 matrices, you can imagine all of the action in the familiar 2D plane.
- Start with the unit circle in the input space (all points with distance 1 from the origin).
- Apply the matrix . The image of that circle is generally an ellipse in the output space.
- The lengths of the semi-axes of that ellipse are the singular values and .
- The directions of those axes are given by the columns of (for the output) and the columns of (for the input).
In this view, SVD tells you exactly how your matrix stretches and rotates the plane. Large singular values correspond to directions where vectors are strongly stretched. If the smallest singular value is close to zero, there is a direction that is almost collapsed, meaning the transformation nearly loses dimensionality.
How to use this 2×2 SVD calculator
- Enter the four entries of your 2×2 matrix into the fields labeled , , , and .
- Click the “Compute SVD” button.
- Review the results: the calculator shows you , , and . Depending on implementation, it may also show intermediate quantities such as , eigenvalues, and eigenvectors.
This makes it much easier to follow the standard SVD procedure without doing all the algebra by hand, especially when numbers are not “nice”.
Interpreting the results
After you compute the SVD, focus on three main pieces of information.
1. Singular values in
The diagonal entries and of tell you how much the matrix stretches vectors along certain orthogonal directions.
- If both singular values are far from zero, the matrix is well-conditioned and does not collapse any direction strongly.
- If is very small compared with , the transformation is close to rank 1: it maps most vectors into something close to a line.
- If one singular value is exactly zero, the matrix is rank-deficient and not invertible.
2. Left singular vectors in
The columns of are unit vectors in the output space. Each column corresponds to a principal direction of the ellipse that you get by transforming the unit circle. The first column aligns with the direction of maximum stretching; the second column is orthogonal to it.
3. Right singular vectors in
The columns of are unit vectors in the input space. They represent the directions that, when you apply , are scaled exactly by the corresponding singular values and rotated into the directions given by .
Together, these pieces let you describe the action of in a very compact way: rotate by , stretch by , then rotate by .
Worked example: SVD of a 2×2 matrix
Consider the simple matrix
Formula: A = [3 1 0 2].
Below is the outline of the steps the calculator conceptually follows.
Step 1: Form
Formula: A^T = [3 0 1 2], A^T A = [3 0 1 2] [3 1 0 2] = [9 3 3 5].
Step 2: Find eigenvalues of
The characteristic polynomial of is
Formula: det (A^T A - λ I) = | 9 - λ 3 3 5 - λ | = (9 - λ)(5 - λ) - 9.
Simplifying gives
Formula: λ λ^2 − 14 λ + 36 = 0.
Solving this quadratic equation yields two eigenvalues and . Numerically, these are approximately
Formula: λ_1 ≈ 11.944, λ_2 ≈ 2.056.
Step 3: Compute singular values
Using , the singular values are approximately
Formula: σ_1 = sqrt(11.944) ≈ 3.456, σ_2 = sqrt(2.056) ≈ 1.434.
Step 4: Find eigenvectors (right singular vectors)
For each eigenvalue, solve to find a nonzero eigenvector . Normalize each eigenvector to have length 1. These normalized eigenvectors form the columns of . The calculator performs this step symbolically or numerically so you do not have to.
Step 5: Compute left singular vectors
For each singular value and right singular vector , compute
Formula: u i = 1 / σ_i A v i.
These vectors are then normalized as needed and collected as the columns of . The final result displayed by the calculator is the factorization , with approximate decimal entries for ease of interpretation.
Comparison: SVD vs. other matrix decompositions
The SVD is related to other common decompositions but not identical. The table below summarizes some key differences for real 2×2 matrices.
| Decomposition | Factorization form | Matrix requirements | What it reveals |
|---|---|---|---|
| Singular Value Decomposition (SVD) | Any real matrix (square or rectangular) | Stretching in orthogonal directions, rank, and conditioning; works even when is not diagonalizable. | |
| Eigenvalue decomposition | Typically requires a square matrix with a full set of eigenvectors | Eigenvalues and eigenvectors; may fail or be complex-valued even when SVD still works cleanly. | |
| QR decomposition | Any real matrix with full column rank (variants handle broader cases) | Orthogonal basis () and upper triangular factor (); used heavily in numerical algorithms. | |
| LU decomposition | Typically requires a square matrix with suitable pivoting | Efficient solving of linear systems; less direct information about geometry than SVD. |
Assumptions and limitations of this calculator
- Matrix size: The tool is designed for 2×2 matrices only. It does not accept larger or rectangular matrices.
- Real entries only: Inputs are assumed to be real numbers. Complex matrices and complex-valued SVD are not supported.
- Numerical rounding: Results are shown with finite decimal precision. Very large or very small values may be subject to rounding errors.
- Near-singular matrices: When singular values are extremely small, distinguishing between zero and “almost zero” depends on numerical tolerance. Interpret such results with care.
- Educational focus: The calculator is intended for learning, checking homework, and building intuition. It is not a substitute for high-precision numerical libraries in critical engineering or scientific applications.
- No symbolic algebra: The tool does not produce symbolic expressions; it evaluates numeric SVDs based on the numbers you enter.
Tips for using the SVD in practice
- Use the ratio as a simple indicator of conditioning for 2×2 matrices. A very large ratio suggests numerical sensitivity.
- Experiment with different inputs to see how changing one entry of the matrix affects the singular values and singular vectors.
- Compare SVD-based insights with the determinant and trace of your matrix to see different perspectives on the same linear transformation.
Applications of SVD
Even though this calculator works with small 2×2 matrices, the same ideas extend to much larger systems. SVD is central in:
- Data analysis and PCA: SVD underlies principal component analysis, which finds directions of maximum variance in high-dimensional data.
- Least squares and regression: The pseudoinverse built from SVD is a robust way to solve overdetermined systems and linear regression problems.
- Image compression: Large image matrices can be approximated by keeping only the largest singular values, reducing storage while keeping key features.
- Signal processing: SVD helps separate signal from noise by focusing on dominant singular values.
Studying the 2×2 case with this tool is a good way to build geometric intuition before moving on to larger matrices.
