Linear Algebra Lab
Solve linear systems and work with matrices and vectors in exact fractions. Type equations such as 2x + y = 5 directly, or a matrix one row per line, and get the determinant, inverse, RREF, rank, null and column space, eigenvalues and eigenvectors, products, and dot, cross and projection.
How to Use
- Pick an operation from the five groups: Systems, Matrix, Eigen, Combine and Vectors.
- For Solve system, type one equation per line, such as
2x + y = 5andx - y = 1. A matrix of numbers with no=is read as an augmented matrix [A | b]. - For every other operation, type the matrix one row per line with entries separated by spaces or commas. Fractions (
1/2) and decimals (0.25) are kept exact. - A + B, A − B and A × B open a second box for matrix B; k · A uses it for the scalar, Power Aⁿ for the exponent, and the vector operations for v.
- The result updates as you type. The example chips below the output load a worked case, such as a 3×3 determinant or the eigenvectors of a 3×3 matrix.
Worked Example
2x + y = 5 and x − y = 1. The augmented matrix is [[2, 1, 5], [1, −1, 1]]. Row-reducing it gives [[1, 0, 2], [0, 1, 1]]: both variables have a pivot, so the solution is unique, x = 2, y = 1. Check: 2·2 + 1 = 5 and 2 − 1 = 1.
Eigenvalues of [[2, 1], [1, 2]]. The characteristic polynomial is λ² − 4λ + 3 = (λ − 1)(λ − 3), so λ = 1 and λ = 3. The null space of A − 1·I = [[1, 1], [1, 1]] is spanned by (−1, 1), and that of A − 3·I = [[−1, 1], [1, −1]] by (1, 1). The eigenvalues add to the trace, 4, and multiply to the determinant, 3.
The common mistake: det(2A) = 2 det(A). For A = [[1, 2, 3], [4, 5, 6], [7, 8, 10]], det(A) = −3. Doubling the matrix doubles every one of its 3 rows, and each row multiplies the determinant by 2, so det(2A) = 2³ × (−3) = −24, not −6.
Show Work
Formulas
From Counting Boards to Matrices
Elimination is old. Chapter eight of the Chinese Nine Chapters on the Mathematical Art, compiled by about the 1st century AD, solves systems of linear equations by arranging the coefficients in columns on a counting board and subtracting columns from each other, the same steps as row reduction. Determinants appeared independently in the work of Seki Takakazu in Japan (1683) and Gottfried Leibniz in Europe (1693). Carl Friedrich Gauss used elimination systematically for least-squares problems in astronomy and geodesy in the early 19th century, and Wilhelm Jordan’s 1888 geodesy handbook popularised the variant that clears above the pivot too, now called Gauss–Jordan elimination.
James Joseph Sylvester introduced the word “matrix” in 1850, and Arthur Cayley’s A Memoir on the Theory of Matrices (1858) treated matrices as objects that can be added, multiplied and inverted. Urbain Le Verrier, better known for predicting Neptune, gave a trace-based method for the characteristic polynomial in 1840; refined in the 20th century by Dmitry Faddeev, it is the Faddeev–LeVerrier algorithm this tool uses.
About This Tool
This lab does the standard first-course linear algebra operations: solving systems, determinant, inverse, RREF, rank, transpose, powers, null and column space, eigenvalues and eigenvectors, matrix sums and products, and dot, cross and projection for vectors. Unlike most matrix calculators it works in exact fractions throughout, and it reads systems as equations typed the way you would write them, with any variable names.
Everything runs in your browser; nothing is uploaded.
Related tools: Matrix Calculator, System of Equations Calculator, and 3D Geometry / Vector Lab.
Frequently Asked Questions
Is the arithmetic exact?
Yes. Every entry is held as a fraction of two arbitrary-size integers, so nothing is rounded. Solving x + y = 1 and x − 2y = 0 gives x = 2/3 and y = 1/3, not 0.666667 and 0.333333, and the inverse of [[4, 7], [2, 6]] is exactly [[3/5, −7/10], [−1/5, 2/5]]. The only decimals are eigenvalues that are not rational or a simple square-root surd, such as the roots of an irreducible cubic, which are shown to 6 significant figures.
How does it tell a unique solution from none or infinitely many?
It row-reduces the augmented matrix [A | b]. A row that reads 0 = 1 means no solution: x + y = 2 with 2x + 2y = 5 is inconsistent. Fewer pivots than variables means infinitely many: x + y = 2 with 2x + 2y = 4 gives the particular solution (2, 0) plus any multiple of (−1, 1). Otherwise every variable has a pivot and the answer is unique.
How are eigenvalues and eigenvectors found?
The characteristic polynomial det(λI − A) is built exactly with the Faddeev–LeVerrier method. Rational roots are found with the rational-root theorem, a leftover quadratic is solved exactly, and anything of degree 3 or more that remains is solved numerically. For [[2, −1, 0], [−1, 2, −1], [0, −1, 2]] the polynomial is λ³ − 6λ² + 10λ − 4, so λ = 2, 2 − √2 and 2 + √2 (about 0.585786 and 3.41421). Eigenvectors are the null space of A − λI: exact for rational λ, otherwise numeric, scaled so the largest entry is ±1.
What is the difference between the null space and the column space?
The null space is every x with Ax = 0; the column space is every output Ax can reach. For [[1, 2, 3], [4, 5, 6], [7, 8, 9]] the rank is 2, so the column space is spanned by the first two columns, (1, 4, 7) and (2, 5, 8), and the null space is the line through (1, −2, 1). Rank 2 plus nullity 1 equals the 3 columns, as the rank–nullity theorem requires.
Why does A × B give a different answer from B × A?
Matrix multiplication is not commutative. [[1, 2], [3, 4]] × [[5, 6], [7, 8]] = [[19, 22], [43, 50]], but in the other order the product is [[23, 34], [31, 46]]. The sizes must also fit: the number of columns of A has to equal the number of rows of B, and the tool says so when they do not.
How do I use the Linear Algebra Lab?
Just type your numbers. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Does it cost anything or need an account?
No. The tool is completely free, there is no account to create, and it keeps working offline after the page first loads.
Is anything I type uploaded?
No. The tool works entirely on your device, so the values you enter never leave your browser.
Common Use Cases
Coursework
Check a 3×3 determinant by hand: [[1, 2, 3], [4, 5, 6], [7, 8, 10]] gives −3.
Circuits
Solve 3 mesh-current equations in 3 unknowns and keep the currents as exact fractions.
Stability and vibration
Eigenvalues of a 2×2 or 3×3 system matrix; [[2, 1], [1, 2]] has λ = 1 and 3.
Graphics
Cross product of (1, 0, 0) and (0, 1, 0) is the normal (0, 0, 1).
Teaching
Show RREF with fractions intact: [[1, 2, 3], [4, 5, 6], [7, 8, 9]] reduces to rank 2.
Last updated: