Solve 2×2 and 3×3 linear systems with Cramer’s rule. See determinants, each step, and verification of the answer.
Enter coefficients, then solve. Use 0 for any missing term.
Equation 1: a1·x + b1·y + c1·z = d1
Equation 2: a2·x + b2·y + c2·z = d2
Equation 3: a3·x + b3·y + c3·z = d3

How to Use the System of Equations Solver
- Choose 2×2 for two equations in x and y, or 3×3 for three equations in x, y, and z.
- Enter each coefficient. For 2×2, the c-columns are hidden but you can still type z-coefficients as 0.
- Use 0 for any missing term. For example, x + y = 5 becomes a1=1, b1=1, d1=5.
- Click Solve. The calculator shows every determinant, applies Cramer’s rule, and verifies the answer.
- If the main determinant is zero, read the message: it explains whether there is no solution or infinitely many.
Cramer’s Rule Explained
Cramer’s rule solves linear systems with determinants. For a 2×2 system a1·x + b1·y = c1 and a2·x + b2·y = c2, compute D = a1·b2 − a2·b1, Dx = c1·b2 − c2·b1, and Dy = a1·c2 − a2·c1. If D is nonzero, x = Dx/D and y = Dy/D, a unique solution. Each numerator determinant is formed by replacing one coefficient column with the constants column, which is why the method is so memorable. For 3×3 systems the same idea scales up: D is the 3×3 determinant of coefficients, and Dx, Dy, Dz replace each column in turn with the constants. A 3×3 determinant expands as a(ei − fh) − b(di − fg) + c(dh − eg) for rows (a,b,c), (d,e,f), (g,h,i). When D equals zero, the equations are dependent or inconsistent: geometrically the lines (or planes) are parallel or coincident, so there is no unique crossing point. Cramer’s rule is elegant and perfect for 2×2 and 3×3, though for larger systems computers switch to elimination methods for speed. This solver always plugs the answer back into the first equation so you can see the verification.
Worked Example
Solve x + y = 5 and 2x − y = 1. Coefficients: a1=1, b1=1, c1=5, a2=2, b2=−1, c2=1. D = (1)(−1) − (2)(1) = −3. Dx = (5)(−1) − (1)(1) = −6. Dy = (1)(1) − (2)(5) = −9. Then x = −6/−3 = 2 and y = −9/−3 = 3. Check: 2 + 3 = 5 and 4 − 3 = 1. Correct. For a 3×3 example, the defaults give x + y = 5, 2x − y = 1, x + 2y + z = 8. From the 2×2 part we know x=2, y=3; substituting into the third: 2 + 6 + z = 8, so z = 0. The determinant method confirms: D for the coefficient matrix works out so that Dx/D = 2, Dy/D = 3, Dz/D = 0. For a no-solution case, try x + y = 2 and 2x + 2y = 5: D = (1)(2) − (2)(1) = 0 and Dx = (2)(2) − (5)(1) = −1 ≠ 0, so the lines are parallel and distinct, no solution. Change the second to 2x + 2y = 4 and Dx becomes 0 too, meaning the equations describe the same line with infinitely many solutions.
Other Solution Methods: Substitution and Elimination
Cramer’s rule is not the only route to the answer, and knowing the alternatives helps you check your work. In the substitution method, you solve one equation for one variable and substitute it into the other. For 2x + y = 7 and x − y = −1, solve the second for x (x = y − 1) and substitute: 2(y − 1) + y = 7 gives 3y = 9, so y = 3 and x = 2. In the elimination method, you add or subtract the equations to cancel one variable — adding the two equations above gives 3x = 6 directly. Both methods produce the same answer as the calculator; they are just different paths, and elimination is often fastest by hand while Cramer scales more neatly to 3×3 systems.
What the Graph Tells You
Each equation in a 2×2 system is a straight line, and the solution is where the lines cross — which gives a quick visual meaning to the determinant. If the lines intersect at one point, D ≠ 0 and there is a unique solution. If they are parallel (same slope, different intercept), they never meet, D = 0, and there is no solution. If they are the same line (one is a multiple of the other), D = 0 and every point on the line is a solution — infinitely many. This is why the calculator reports the D = 0 cases the way it does: the algebra is telling you what the geometry already shows.
Systems in Real Life: Word Problems
Linear systems are everywhere once you look. A theater sells 100 tickets for a total of $950, with adult tickets at $12 and child tickets at $7. Let a be adult tickets and c be child tickets: a + c = 100 and 12a + 7c = 950. Substituting c = 100 − a gives 12a + 700 − 7a = 950, so 5a = 250 and a = 50 — meaning 50 adult and 50 child tickets. Mixture problems work the same way: a pharmacist mixing a 10% and a 25% solution to make 30 liters of 15% solution gets 20 liters of the 10% and 10 liters of the 25% (check: 2 + 2.5 = 4.5 = 15% of 30). Budgeting, nutrition planning, and engineering balance equations all reduce to systems like these.
Frequently Asked Questions
What is Cramer’s rule?
A formula that solves linear systems using determinants: each variable equals a modified determinant divided by the main determinant. It is clean and exact for 2×2 and 3×3 systems.
What does it mean when D = 0?
The equations do not pin down a unique point. If the numerator determinants are also zero, there are infinitely many solutions; otherwise there is no solution.
Can this solve 4×4 systems?
This tool handles 2×2 and 3×3. Larger systems are better solved with Gaussian elimination, which our matrix calculator demonstrates.
Why verify the answer?
Plugging x and y back into the original equations catches typos in coefficients. The solver shows this check automatically for the first equation.
Where are linear systems used?
Circuit analysis, economics input-output models, chemical equation balancing, computer graphics transforms, and fitting trend lines to data.
What is the difference between substitution and elimination?
Substitution solves one equation for a variable and plugs it into the other; elimination adds or subtracts the equations to cancel one variable. Both give the same answer — elimination is usually fastest by hand for 2×2 systems, while Cramer’s rule scales more neatly to 3×3.
Can a system have exactly two solutions?
A linear system cannot — it has either exactly one solution, none, or infinitely many. Two distinct solutions would force the lines to cross twice, which straight lines never do.
What is an inconsistent system?
A system with no solution, like x + y = 2 and x + y = 5. The equations contradict each other (the lines are parallel), so Cramer’s rule returns a zero determinant.
Related Calculators
Go deeper with our Matrix Calculator and solve single-variable quadratics with our Quadratic Equation Solver.
