System of Linear Equations Solver

Solve systems of 2 or 3 linear equations with multiple unknowns.

2×2 System

3×3 System

Equation 1: a₁x + b₁y = c₁

Equation 2: a₂x + b₂y = c₂

Solution
—
Enter equations and calculate
x
—
y
—
z
—
Determinant
—
Status
—
Type
—

Quick Examples

Solving Systems of Equations

A system of linear equations has a unique solution if the coefficient matrix is non-singular (determinant ≠ 0).

Cramer's Rule (2×2)

x = Dₓ/D, y = Dᵧ/D

Where D is the determinant of the coefficient matrix, Dₓ replaces the first column with constants, and Dᵧ replaces the second column.

Solution Types

ConditionSolution
D ≠ 0Unique solution
D = 0, Dₓ = 0, Dᵧ = 0Infinite solutions
D = 0, Dₓ ≠ 0 or Dᵧ ≠ 0No solution

Geometric Interpretation

  • 2×2: Intersection point of two lines
  • 3×3: Intersection point of three planes

What Is a System of Linear Equations?

A system of linear equations is a set of two or more linear equations that share the same variables. A solution is a set of values that makes every equation true at the same time. Geometrically, each equation is a line (in 2D) or a plane (in 3D), and the solution is where they all intersect.

The standard forms the calculator accepts are:

2×2 system:  a1x + b1y = c1    a2x + b2y = c2
3×3 system:  a1x + b1y + c1z = d1    a2x + b2y + c2z = d2    a3x + b3y + c3z = d3

The Three Possible Outcomes

A linear system has exactly one of three outcomes — the calculator detects all three automatically:

Outcome2×2 GeometryAlgebraic SignExample
Unique solutionLines intersect at one pointDeterminant D ≠ 0x + y = 5, x − y = 1 → (3, 2)
No solutionParallel lines, never meetD = 0 but Dx or Dy ≠ 0x + y = 4, x + y = 9 → impossible
Infinitely manySame line (coincident)D = Dx = Dy = 02x + 2y = 8 is just x + y = 4 doubled

For 3×3 systems the picture extends to planes: three planes can meet at one point, form a line or a plane of solutions, or miss each other entirely.

Solution Methods

Substitution Method

Solve one equation for one variable, then substitute that expression into the other equation. Best when a variable already has coefficient 1 or −1.

Worked example: Solve 2x + y = 7 and x − y = 2. From the second equation, x = y + 2. Substitute into the first: 2(y + 2) + y = 7 → 3y + 4 = 7 → y = 1, then x = 3. Solution: x = 3, y = 1. Check: 2(3) + 1 = 7 ✓ and 3 − 1 = 2 ✓

Elimination Method

Add or subtract multiples of the equations to cancel one variable. Best when coefficients match or are easy multiples.

Worked example: Solve 3x + 2y = 16 and 3x − y = 7. Subtract the second from the first: 3y = 9 → y = 3. Back-substitute: 3x + 6 = 16 → 3x = 10 → x = 10/3, y = 3. Check: 3(10/3) + 2(3) = 10 + 6 = 16 ✓ and 10 − 3 = 7 ✓

Cramer's Rule

For a 2×2 system, form the coefficient determinant D = a1b2 − a2b1, then replace one column at a time with the constants: Dx = c1b2 − c2b1, Dy = a1c2 − a2c1. Then:

x = Dx / D    y = Dy / D    (valid only when D ≠ 0)

Worked example: Solve 2x + 3y = 7 and x − y = 1. D = 2(−1) − 1(3) = −5. Dx = 7(−1) − 1(3) = −10. Dy = 2(1) − 7(1) = −5. So x = (−10)/(−5) = 2, y = (−5)/(−5) = 1. Check: 2(2) + 3(1) = 7 ✓ and 2 − 1 = 1 ✓. For 3×3 systems the same idea applies with 3×3 determinants for D, Dx, Dy, and Dz.

Matrix Method (Inverse Matrix)

Write the system as AX = B, where A is the coefficient matrix, X the variable column, and B the constants. If A is invertible (determinant ≠ 0), the solution is X = A−1B. This is the most compact formulation and the one computers generalize to any size system.

Gaussian Elimination

Write the augmented matrix and use row operations (swap rows, multiply a row, add a multiple of one row to another) until it is in triangular form, then back-substitute. This is the workhorse method for 3×3 systems and the basis of most numerical solvers.

Worked 3×3 example: Solve x + y + z = 6, 2x + y + 3z = 13, x + 2y + z = 8.

  • Start: rows [1 1 1 | 6], [2 1 3 | 13], [1 2 1 | 8]
  • R2 ← R2 − 2R1 and R3 ← R3 − R1: [0 −1 1 | 1], [0 1 0 | 2]
  • R2 ← −R2, then R3 ← R3 − R2: [0 0 1 | 3] → z = 3
  • Back-substitute: y − 3 = −1 → y = 2; x + 2 + 3 = 6 → x = 1
  • Check all three: 1 + 2 + 3 = 6 ✓, 2 + 2 + 9 = 13 ✓, 1 + 4 + 3 = 8 ✓

Which Method Should You Use?

MethodBest ForStrengthWeakness
SubstitutionSmall systems with a coefficient of 1Intuitive, minimal arithmeticFractions appear quickly otherwise
Elimination2×2 with matchable coefficientsClean integer arithmeticNeeds planning for 3×3
Cramer's rule2×2 and 3×3 theory, determinantsDirect formula per variableSlow for larger systems; fails at D = 0
Matrix inverseRepeated systems with the same ASolve once, reuse for many BComputing the inverse is work
Gaussian elimination3×3 and larger, computersSystematic, scales to any sizeMany steps by hand

Real-World Applications

  • Business: Break-even analysis with two products sharing production constraints.
  • Chemistry: Balancing chemical equations is solving a system for integer coefficients.
  • Traffic engineering: Flow conservation at intersections gives one equation per junction.
  • Electrical circuits: Kirchhoff's laws produce systems for the unknown currents.
  • Mixtures: Blending two solutions of different concentrations to hit a target strength.
  • Economics: Supply and demand equilibrium across interconnected markets.

Common Mistakes to Avoid

  • Never verifying: Substitute the answer into every original equation — a solution must satisfy all of them.
  • Dividing by a zero determinant: Cramer's rule and the matrix inverse require D ≠ 0; a zero determinant means no unique solution, not x = 0.
  • Unbalanced row operations: In elimination, whatever you multiply one equation by must multiply the entire equation, constants included.
  • Mixing up Dx and Dy: Dx replaces the x-column (first) with constants; Dy replaces the y-column (second).
  • Sign errors in substitution: Solving x − y = 2 for x gives x = y + 2, not x = y − 2.

Homogeneous Systems

A homogeneous system has all zero constants (e.g., x + 2y = 0, 2x + 4y = 0). It always has the trivial solution x = 0, y = 0. It has additional (nontrivial) solutions exactly when the determinant is zero — then the equations are dependent and the solution set is a line. Here D = 1(4) − 2(2) = 0, so every point with x = −2y works: (−2, 1), (−4, 2), and so on.

Solving Larger Systems

The same ideas scale up. Gaussian elimination handles 4×4, 10×10, or 1000×1000 systems with the identical row-operation routine — which is why it (not Cramer's rule) is what computers use. The matrix method shines when many systems share one coefficient matrix: compute A−1 once, then multiply by each new constants vector. For genuinely nonlinear systems (with x2 or xy terms), none of these methods apply directly — those need substitution or numerical methods.

Frequently Asked Questions

What if the system has no solution?
If D = 0 but Dₓ or Dᵧ ≠ 0, the equations are inconsistent (parallel lines that never intersect).
What are infinite solutions?
When all determinants are zero, the equations are dependent (same line or plane), resulting in infinitely many solutions.