Matrix equations look different from regular algebra, but the goal is the same: isolate the unknown. The key difference is that matrix multiplication has rules about dimensions and order. Once you respect those rules, problems like AX = B become systematic.
Want to solve AX = B without getting stuck?
Try our ai math solver to compute inverses, do row reduction, and verify matrix equation solutions step by step.
Before you solve anything, confirm the multiplication makes sense.
Many mistakes come from multiplying on the wrong side. If the equation is AX = B, you isolate X by multiplying on the left by A^-1. If the equation is XA = B, you multiply on the right by A^-1.
If A is square (n×n) and invertible, then A^-1 exists and you can isolate X:
This is the matrix version of “divide both sides by A,” but because matrices don’t commute, it matters that you multiply by A^-1 on the left.
Problem: Solve AX = B where
Step 1: Compute A^-1. For a 2×2 matrix [[a, b], [c, d]], the inverse (if it exists) is (1/(ad−bc))·[[d, −b], [−c, a]].
Step 2: Multiply X = A^-1B.
Check: A·X = [[2, 1], [3, 2]]·[[-2], [9]] = [[5], [12]] = B.
If the unknown is on the left, you multiply on the right:
The side you multiply on is determined by where the A is sitting. This is one of the main conceptual hurdles in matrix algebra.
Sometimes A is not square, or it’s square but singular (determinant 0). In those cases, you can’t use A^-1. The reliable alternative is row reduction.
If AX = B and X is a vector, you can build the augmented matrix [A | B] and row-reduce to solve the equivalent system. If you get a contradiction like 0 = 5, there is no solution. If you get a free variable, there are infinitely many solutions.
If X has multiple columns, you can treat each column as a separate right-hand side. That means you can solve AX = B by solving AX_1 = B_1, AX_2 = B_2, etc.
In many classes, you learn the inverse method first because it looks like “division,” but row reduction is often the most practical method for real computations.
Problem: Solve AX = B where
Here det(A) = 1·4 − 2·2 = 0, so A^-1 does not exist. Use the augmented matrix and row-reduce.
The last row says 0 = 1, which is impossible. So this matrix equation has no solution. This is a good reminder: some matrix equations are inconsistent.
Matrix solutions are easy to mis-copy, so build a quick check into your workflow. You don’t need a full re-derivation—just a short consistency pass.
For AX = B you need A^-1 on the left. For XA = B you need A^-1 on the right.
If the sizes don’t match, the multiplication is undefined. Always identify the shape of X first.
If det(A) = 0 (or A isn’t square), you must use row reduction or another method.
Substitute back: compute AX (or XA) and confirm it matches B.
If you want a strong conceptual reference on matrix equations and row reduction, the early linear algebra units in Khan Academy Linear Algebra are a dependable refresher.
Paste your matrix equation and get X plus a substitution check.
Try AI Math Solver →