Matrix calculator
Type a matrix, one row per line, and choose what to find. Whole numbers and short decimals give exact fractions, so the inverse looks the way you would write it.
Show the working
det A = ad − bc = (4)(6) − (7)(2) = 10
For a 2 × 2 matrix: swap the entries on the leading diagonal, change the signs of the other two, and divide by det A.
A−1 = 3/5−7/10−1/52/5
Check: A × A−1 should give the identity matrix I.
Exact fractions: your entries are whole numbers or short decimals, so nothing is rounded.
Answers are rounded to 3 significant figures, which is what IB papers ask for unless a question says otherwise.
How to do it by hand
- 2 × 2 determinant: for A = (a b; c d), det A = ad − bc.
- 2 × 2 inverse: swap a and d, change the signs of b and c, and divide by det A. If det A = 0 there is no inverse.
- 3 × 3 determinant: expand along the first row, each entry times the determinant of its 2 × 2 minor, with signs + − +.
- Multiplying matrices: each entry of AB is a row of A times a column of B, added up. Order matters: AB is usually not BA.
Worked example
Find the inverse of the matrix A with rows (2, 1, 0), (1, 3, 1) and (0, 1, 2).
Solution
Expand along the first row: each entry times the determinant of the 2 × 2 matrix left when you cover its row and column, with signs + − +.
det A = 2 × (5) − 1 × (2) + 0 × (1) = 8
Find the matrix of cofactors, transpose it (the adjugate) and divide by det A.
A−1 = 5/8−1/41/8−1/41/2−1/41/8−1/45/8
Check: A × A−1 should give the identity matrix I.
Exact fractions: your entries are whole numbers or short decimals, so nothing is rounded.
Answer: A−1 = 5/8−1/41/8−1/41/2−1/41/8−1/45/8
Every number in this example is worked out by the same code as the tool above, and the code is tested against independent results from Python's SciPy library.
Where you need it
| AA SL | Not in the syllabus |
|---|---|
| AA HL | Not in the syllabus |
| AI SL | Not in the syllabus |
| AI HL | Matrix arithmetic, inverses, transition matrices (Markov chains) and eigenvalues. |
On your calculator
In the exam you use your own calculator, so practise it too. Our guides give the exact keystrokes for the Casio fx-CG50, TI-Nspire CX II and TI-84 Plus CE, with a worked example to check against:
Common mistakes
- Dividing by det A for a singular matrix. If det A = 0, A has no inverse and the system has no unique solution.
- Getting the sign pattern wrong in a 3 × 3 determinant: it is + − + along the first row.
- Multiplying in the wrong order. To solve AX = B, use X = A⁻¹B, not BA⁻¹.
- Typing a 2 × 3 matrix as if it were square: inverses and determinants exist only for square matrices.
Notes and practice
Questions students ask
When does a matrix have no inverse?
When its determinant is 0. The matrix is then called singular: its rows (or columns) are linearly dependent.
How do I check an inverse?
Multiply it by the original matrix. A × A⁻¹ should give the identity matrix I, with 1s on the leading diagonal and 0s everywhere else. Use “Product AB” to check.
Why are the answers fractions?
When every entry is a whole number or a short decimal, the tool works in exact fractions, as you would by hand. Type a longer decimal to get decimal answers rounded to the setting below.