Matrix Calculator
A professional-grade, mobile-first matrix calculator for students, engineers, and researchers. Compute addition, subtraction, multiplication, determinant, inverse, transpose, rank, trace, RREF, and solve Ax = b with accessible, high-precision algorithms and instant results.
Calculator
Matrix A
Matrix B
Vector b (right-hand side)
Results
Data Source and Methodology
Authoritative references:
- Gilbert Strang, “Introduction to Linear Algebra,” 5th ed., Wellesley–Cambridge Press, 2016. MIT OpenCourseWare 18.06: https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/
- Gene H. Golub and Charles F. Van Loan, “Matrix Computations,” 4th ed., Johns Hopkins University Press, 2013.
Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.
Algorithms implemented: Gaussian elimination with partial pivoting for determinant, inverse, RREF, and solving linear systems; direct element-wise definitions for addition, subtraction, transpose, trace, and rank via RREF.
The Formula Explained
Matrix addition: \( C = A + B,\; c_{ij} = a_{ij} + b_{ij} \).
Matrix subtraction: \( C = A - B,\; c_{ij} = a_{ij} - b_{ij} \).
Matrix multiplication: \( C = A B,\; c_{ij} = \sum_{k=1}^{n} a_{ik} b_{kj} \).
Transpose: \( A^{\top},\; (A^{\top})_{ij} = a_{ji} \).
Trace (square A): \( \operatorname{tr}(A) = \sum_{i=1}^{n} a_{ii} \).
Determinant (via elimination): \( \det(A) = (-1)^s \prod_{i=1}^{n} u_{ii} \), where \( U \) is the upper-triangular matrix after elimination and \( s \) the number of row swaps.
Inverse (if nonsingular): Use Gauss–Jordan on \( [A \mid I] \to [I \mid A^{-1}] \).
RREF: Apply Gauss–Jordan to reduce A to row-reduced echelon form.
Rank: Number of nonzero rows in RREF within a tolerance \( \varepsilon \).
Solve \( A x = b \): Use RREF of \( [A \mid b] \); if \( A \) invertible, \( x = A^{-1} b \).
Glossary of Variables
- A, B: Input matrices with dimensions m×n and p×q.
- b: Right-hand-side column vector (m×1) for solving Ax = b.
- cij: Entry in row i, column j of result matrix C.
- det(A): Scalar determinant of square matrix A.
- A⁻¹: Inverse of A if det(A) ≠ 0.
- Aᵀ: Transpose of A.
- tr(A): Trace, sum of diagonal entries of A (square).
- rank(A): Number of linearly independent rows/columns of A.
- RREF(A): Row-reduced echelon form of A.
How It Works: A Step-by-Step Example
Task: Multiply two 2×2 matrices.
Let \( A = \begin{bmatrix}1 & 2 \\ 3 & 4\end{bmatrix} \), \( B = \begin{bmatrix}2 & 0 \\ 1 & 2\end{bmatrix} \).
Then \( C = A B \) with entries \( c_{ij} = \sum_{k=1}^{2} a_{ik} b_{kj} \).
Compute: \( c_{11} = 1\cdot2 + 2\cdot1 = 4 \), \( c_{12} = 1\cdot0 + 2\cdot2 = 4 \), \( c_{21} = 3\cdot2 + 4\cdot1 = 10 \), \( c_{22} = 3\cdot0 + 4\cdot2 = 8 \).
Result: \( C = \begin{bmatrix}4 & 4 \\ 10 & 8\end{bmatrix} \).
Frequently Asked Questions (FAQ)
What is the maximum matrix size?
Up to 6×6 in this tool to ensure responsiveness and great performance on mobile devices.
Do empty inputs count as zeros?
Yes. Blank cells are treated as 0 to streamline data entry.
How does the tool ensure numerical stability?
Partial pivoting is used during elimination. Small values under a tolerance (1e−10) are treated as zero in RREF/rank.
Can it detect when A is singular?
Yes. If the pivot falls under tolerance, the inverse is not computed and an explanatory error is shown.
How can I copy results?
Use “Copy as CSV” to paste into spreadsheets, or “Copy as LaTeX” to paste into scientific documents.
Is there a way to analyze solution sets?
Use RREF(A) or Solve Ax = b. For underdetermined systems, the tool shows one solution if available and you can inspect the RREF for free variables.