What this tool does
The matrix calculator works over the rational numbers: every entry is kept
as an exact fraction, so results are exact — 1/3 never drifts to 0.3333.
Enter a matrix, pick an operation, and (where it helps) read the worked steps.
Core operations
For matrices and of compatible sizes:
Matrix multiplication is not commutative — and usually differ — so both are offered.
Gaussian elimination
Row reduction underlies rank, the determinant, the inverse, and solving systems. Each step is one of three elementary row operations: swap two rows, scale a row, or add a multiple of one row to another. Reducing to reduced row-echelon form (a leading 1 in each pivot column, zeros elsewhere in that column) exposes the rank and the solution set.
Determinant
Reducing to upper-triangular form by row operations, the determinant is the product of the diagonal, with a sign flip for each row swap:
A zero on the diagonal after elimination means and is singular.
Inverse
Augment with the identity and run Gauss–Jordan elimination: . If the left block cannot reach , the matrix is singular and has no inverse.
Solving
Row-reduce the augmented matrix . A pivot in the column means no solution. Otherwise the pivots fix the basic variables; any free columns give a null-space basis, so the full solution is one particular vector plus any combination of those basis vectors.
Worked example
With and , elimination gives the unique solution , and .
Number domains
The number domain selector changes what an entry is. The same operations run over each, because the engine is written against an abstract field:
- Fractions — exact rationals (the default).
- Complex numbers — exact Gaussian rationals with rational
. Closed under (divide by the conjugate), so the
determinant, inverse, RREF and solver stay exact. Enter cells like
3+2i,-i, or1/2 - 3/4 i. - Symbolic — entries may contain variables (
a,2x,x^2,(x+1)/(x-1)). Values are multivariate rational functions over , which form a field, so and come out symbolically. Pivots are taken in generic position (a symbolically-nonzero entry is treated as nonzero), and results are simplified conservatively — never wrongly.
Decompositions
- LU — with a lower-triangular , an upper-triangular , and a permutation recording row swaps. Exact over any domain.
- QR — with orthonormal and upper-triangular (Gram–Schmidt). Needs square roots, so it is numeric (approximate).
- Cholesky — for a symmetric positive-definite , . Also numeric, and reported as not-SPD when no such factor exists.
Spectrum
The characteristic polynomial is computed exactly by the Faddeev–LeVerrier recurrence over any domain. Eigenvalues are its roots: exact when they are rational, otherwise found numerically (so a rotation matrix reports , flagged approximate). Each eigenvector spans the null space of , exact for rational and numeric otherwise.
Results that cannot be exact are marked approximate so the distinction is never hidden.