Matrix & Linear Algebra Lab
Exact-fraction RREF with steps, determinant, inverse, null space, eigenvalues, LU/QR and Ax = b.
How it works
Enter matrices with whole numbers, fractions or decimals and get exact results: row reduction with every row operation, determinant, inverse, rank, null space, A + B, A·B and solutions of A x = b. Eigenvalues are exact for 2×2/3×3 cases with rational or quadratic roots and numeric (shifted QR algorithm) otherwise; LU, QR and the condition number are computed numerically.
- Entries are parsed as exact fractions (BigInt numerators and denominators), so row reduction, determinants, inverses, ranks, null spaces and solutions of A x = b are exact, with no rounding.
- Row reduction is Gauss–Jordan elimination: swap to a non-zero pivot, scale the pivot row to 1, clear the column above and below; every operation is listed with the matrix after it.
- Eigenvalues: the characteristic polynomial is computed exactly (Faddeev–LeVerrier). Rational roots and a remaining quadratic give exact eigenvalues (with surds or complex values); otherwise the matrix is reduced to Hessenberg form and the shifted QR algorithm finds the eigenvalues numerically. Eigenvectors are exact null spaces for rational eigenvalues and numeric (inverse iteration) otherwise.
- LU uses partial pivoting (P·A = L·U); QR uses Householder reflections; the condition number is σmax/σmin from the singular values (Jacobi eigenvalues of AᵀA). These are double-precision numeric results.
Use this tool in an app
These free programs for your browser have this tool built in, next to everything else the task needs.
-
Proofline Math notebook
Solve, graph, test and visualise in one notebook — with data, findings and a report.
Related tools
- Step-by-Step Equation Solver – Solve linear, quadratic, rational and radical equations or linear systems with every step shown.
- Math Workbench – Simplify, factor, differentiate, integrate, solve, take limits, series and plots in one box.
How to use the Matrix & Linear Algebra Lab
Row-reduce, invert, solve A x = b, find null spaces and eigenvalues with exact fractions and every row operation shown.
What it is for
Doing Gauss–Jordan elimination by hand is where most linear algebra mistakes happen: one wrong sign in row 2 and everything after it is garbage. This lab does the arithmetic with exact fractions (no 0.333333 rounding) and lists every row operation with the matrix after it, so you can compare it line by line with your own work.
Choose an operation: an overview (analyze), RREF, determinant, inverse, rank, null space, transpose, A + B, A − B, A·B, solving A x = b, LU, QR, eigenvalues or the condition number. Type one row per line, with entries separated by spaces or commas. Fractions like 1/3 and decimals work, up to 10×10.
Row reduction, inverses, determinants, ranks, null spaces and linear systems are exact. LU, QR and the condition number are double-precision numeric results. Eigenvalues are exact when the characteristic polynomial has rational or quadratic roots, and numeric otherwise.
Worked example
Solve the textbook system 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3. Enter Matrix A as
2 1 -1
-3 -1 2
-2 1 2
and the right-hand side 8 -11 -3. The lab answered unique solution, x = (2, 3, −1) and showed nine row operations on the augmented matrix. It starts with "R1 ← R1 ÷ 2 (make the pivot 1)" and ends with "R2 ← R2 − 1·R3 (clear column 3)". Halfway through, row 2 reads [0 1/2 1/2 | 1], which shows the fractions really are kept exact.
The overview of the symmetric matrix 2 0 0 / 0 3 4 / 0 4 9 gave determinant 22, trace 14, rank 3, eigenvalues 11, 2 and 1 with eigenvectors (0, 1, 2), (1, 0, 0) and (0, −2, 1), the characteristic polynomial λ³ − 14λ² + 35λ − 22, condition number 11 and the exact inverse with entries like 9/11 and −4/11.
How to read the result
- Main value: the solution vector, determinant, matrix or "dimension k" for a null space. In the overview, the summary line gives the determinant, for example "determinant 22".
- Steps: each row operation in order. Use them to find exactly where your hand calculation went wrong.
- Properties: rank, determinant, trace, symmetry, invertibility, condition number and characteristic polynomial.
- Eigen: each eigenvalue with its multiplicity and eigenvectors. "(numeric)" next to a vector means it came from inverse iteration, not exact algebra. For
2 1 / 1 3the eigenvalues 5/2 ± √5/2 are exact, but the eigenvectors are numeric. - Factors: L and U, Q and R, or the inverse, depending on the operation.
Tips and common mistakes
- In the overview, the matrix shown is the RREF of A, not A itself. For an invertible matrix that's just the identity.
- Null space vectors are scaled to whole numbers.
1 2 3 / 2 4 6 / 1 1 1gives (1, −2, 1), and any multiple of it is equally correct. - A·B needs the column count of A to match the row count of B. A·B and B·A usually differ:
1 2 / 3 4times0 1 / 1 0swaps the columns, giving2 1 / 4 3. - A large condition number means small input errors are amplified. Treat numeric results for such matrices with care.
- Enter values as fractions (
1/3), not rounded decimals, if you want exact answers. 0.333 is read as 333/1000.
FAQ
Why are my LU and QR results decimals?
They use double-precision arithmetic (partial pivoting for LU, Householder reflections for QR). Only the elimination-based operations are exact.
What does "dimension 1" for the null space mean?
The equation A x = 0 has a one-parameter family of solutions, spanned by the vector shown. The rank plus the null-space dimension equals the number of columns.
Can it handle complex eigenvalues?
Yes. The rotation matrix 0 -1 / 1 0 gives λ² + 1 and the eigenvalues i and −i. The complex eigenvectors are not listed, though.
Does it show the steps for the inverse?
Yes. It row-reduces [A | I] and lists each operation until the left side becomes the identity.
Guide last updated:
For scripts and AI agents
- JSON API:
POST https://matrixlinearalgebralab.usefulweb.site/api/v1/calculate(same calculation as this page) - Interface description: OpenAPI 3.1 · AI guide: llms.txt
- MCP server (Streamable HTTP):
https://matrixlinearalgebralab.usefulweb.site/mcp· tool namematrix_linear_algebra_lab
Example request
curl -s -X POST https://matrixlinearalgebralab.usefulweb.site/api/v1/calculate \
-H 'content-type: application/json' \
-d '{"operation":"analyze","matrixA":"2 0 0\n0 3 4\n0 4 9"}'