Skip to content
TheCalcUniverse

System of Equations Solver — 2-Variable Linear System

Solve systems of two linear equations using the Cramer Rule determinant method. Get step-by-step solutions for unique, infinite, or no solution cases.

✓ Tested formula & cited sources Formula verified 2026-05-15 Runs in your browser — inputs never sent anywhere

See it worked out

Example — a₁ (coefficient of x in eq 1) 2, b₁ (coefficient of y in eq 1) 3, c₁ (constant in eq 1) 7, a₂ (coefficient of x in eq 2) 5:

System

2x + 3y = 7 | 5x + -2y = 3

Determinant (D)

-19

x

1.210526

y

1.526316

Solution Type

Unique solution

Step-by-Step Work

System of equations: 2x + 3y = 7 5x + -2y = 3 Determinant D = a₁·b₂ − a₂·b₁ = 2·-2 − 5·3 = -19 Dx = c₁·b₂ − c₂·b₁ = 7·-2 − 3·3 = -23 Dy = a₁·c₂ − a₂·c₁ = 2·3 − 5·7 = -29 D = -19 ≠ 0 → unique solution x = Dx / D = -23 / -19 = 1.210526 y = Dy / D = -29 / -19 = 1.526316

The formula

x = Dx/D, y = Dy/D where D = a₁b₂ − a₂b₁, Dx = c₁b₂ − c₂b₁, Dy = a₁c₂ − a₂c₁

D
Main Determinant
Dx
X-Determinant
Dy
Y-Determinant
x, y
Solution Variables

Worked example — a₁ (coefficient of x in eq 1) 2, b₁ (coefficient of y in eq 1) 3, c₁ (constant in eq 1) 7, a₂ (coefficient of x in eq 2) 5

System = 2x + 3y = 7 | 5x + -2y = 3

Full explanation ↓

How System Solver Works

x = Dx/D, y = Dy/D where D = a₁b₂ − a₂b₁, Dx = c₁b₂ − c₂b₁, Dy = a₁c₂ − a₂c₁

Cramer's rule solves systems of two linear equations in two variables using determinants. Given the system a₁x + b₁y = c₁ and a₂x + b₂y = c₂, the main determinant D = a₁b₂ − a₂b₁ determines solvability. If D ≠ 0, the system has a unique solution: x = Dx/D and y = Dy/D, where Dx and Dy replace the x-column and y-column with constants. If D = 0 and Dx = Dy = 0, there are infinitely many solutions (the equations are dependent). If D = 0 and Dx ≠ 0 or Dy ≠ 0, there is no solution (the equations are inconsistent and represent parallel lines).

D
Main DeterminantD = a₁b₂ − a₂b₁. The determinant determines whether the system has a unique solution (D ≠ 0), infinite solutions (D = 0, Dx = Dy = 0), or no solution (D = 0, Dx or Dy ≠ 0). Geometrically, D ≠ 0 means the two lines intersect at a single point.
Dx
X-DeterminantDx = c₁b₂ − c₂b₁. Replaces the x-coefficient column with the constants. Used with D to compute x = Dx/D when a unique solution exists.
Dy
Y-DeterminantDy = a₁c₂ − a₂c₁. Replaces the y-coefficient column with the constants. Used with D to compute y = Dy/D when a unique solution exists.
x, y
Solution VariablesThe two unknowns being solved for. Each pair (x, y) represents the intersection point of two lines in 2D space.
Cramer's rule uses determinants D, Dx, and Dy to solve 2×2 linear systems. The sign of D determines if the solution is unique, infinite, or nonexistent, corresponding to intersecting, coincident, or parallel lines.

How to Use

  1. Enter the coefficients for equation 1 in the form a₁x + b₁y = c₁. The coefficients a₁, b₁, and the constant c₁ are all required.
  2. Enter the coefficients for equation 2 in the form a₂x + b₂y = c₂. All six values (a₁, b₁, c₁, a₂, b₂, c₂) must be provided.
  3. The calculator computes the determinant D and reports whether the system has a unique solution, infinite solutions, or no solution.
  4. If a unique solution exists, the calculator displays x and y with step-by-step work showing Cramer's rule calculations.
  5. For dependent or inconsistent systems, the calculator explains the geometric meaning — parallel lines or coincident lines.

Quick Reference

Unique solutionD = a₁b₂ − a₂b₁ ≠ 0 → one intersection point
Infinite solutionsD = 0, Dx = Dy = 0 → same line (coincident)
No solutionD = 0, Dx ≠ 0 or Dy ≠ 0 → parallel lines
Cramer's Rulex = Dx/D, y = Dy/D for D ≠ 0

Common Uses

  • Economics: Solve supply and demand equilibrium where two linear equations represent market conditions — find the price and quantity where supply equals demand.
  • Engineering: Analyze circuits with two unknowns using Kirchhoff's voltage and current laws, where each loop or node produces a linear equation.
  • Chemistry: Balance chemical reactions with two unknowns or solve mixture problems where two substances combine with different concentrations.
  • Computer Graphics: Find intersection points of lines for collision detection, ray tracing, and geometric computations in 2D space.
  • Education: Learn fundamental linear algebra concepts, practice Cramer's rule, and verify homework solutions for systems of equations.

Understanding the Result

Solving systems of linear equations is a cornerstone of algebra with applications spanning nearly every scientific and engineering discipline. Cramer's rule, named after the Swiss mathematician Gabriel Cramer (1704-1752), provides an elegant method for solving systems using determinants. The concept dates back to the mid-18th century when Cramer published his treatise "Introduction to the Analysis of Algebraic Curves" in 1750, where he presented the determinant-based method for solving linear systems. For a 2x2 system a1x + b1y = c1 and a2x + b2y = c2, the determinant D = a1b2 - a2b1 serves as a quick test for solvability. If D is not zero, the two lines intersect at exactly one point — the unique solution (x, y) = (Dx/D, Dy/D). The geometric interpretation is intuitive: two non-parallel lines in a plane always intersect exactly once. If D = 0, the lines have the same slope: they are either parallel (no intersection, no solution) or coincident (the same line, infinite solutions). The distinction between these two cases is made by checking Dx and Dy. If both are also zero, the equations are multiples of each other, representing the same line. If either Dx or Dy is non-zero, the equations represent distinct parallel lines that never meet. This method extends naturally to larger systems — the same determinant-based logic works for 3x3, 4x4, and nxn systems, though computational complexity grows factorially with matrix size. Cramer's rule is particularly valuable in theoretical contexts and for small systems because it provides explicit formulas without requiring Gaussian elimination or matrix inversion. In practice, the rule is most efficient for 2x2 and 3x3 systems, while larger systems are typically solved using numerical methods like LU decomposition or iterative techniques such as Gauss-Seidel. Beyond pure mathematics, solving systems of equations underpins finite element analysis in engineering, economic equilibrium models, chemical reaction balancing, and network flow optimization — any domain where multiple constraints must be satisfied simultaneously.

Worked Examples

Sarah and Tom bought snacks at a school fundraiser. Sarah bought 2 bags of chips (x) and 3 bottles of water (y) for $7. Tom bought 5 bags of chips and noticed the cashier gave him a $2 discount on his water, paying $3 total. Find the price of one bag of chips and one bottle of water.

a1 = 2 · b1 = 3 · c1 = 7 · a2 = 5 · b2 = -2 · c2 = 3

x = $1.21 (chips), y = $1.53 (water); D = -19, unique solution

The system 2x + 3y = 7, 5x - 2y = 3 gives D = 2(-2) - 5(3) = -4 - 15 = -19. Dx = 7(-2) - 3(3) = -14 - 9 = -23. Dy = 2(3) - 5(7) = 6 - 35 = -29. Thus x = -23/-19 = $1.21 per bag of chips, y = -29/-19 = $1.53 per water bottle. With a negative determinant and negative numerators, the signs cancel — both items have positive prices as expected.

An engineer is designing a truss structure with two tension members. The forces must satisfy x + y = 500 (total load) and 2x - y = 100 (moment equilibrium). Solve for the tension in each member.

a1 = 1 · b1 = 1 · c1 = 500 · a2 = 2 · b2 = -1 · c2 = 100

x = 200 N, y = 300 N; D = -3, unique solution

The system has D = 1(-1) - 2(1) = -3 (nonzero, so unique solution exists). Dx = 500(-1) - 100(1) = -600. Dy = 1(100) - 2(500) = -900. Therefore x = -600/-3 = 200 N (tension in member 1), y = -900/-3 = 300 N (tension in member 2). The negative signs in the intermediate steps cancel, yielding positive forces as physically expected.

Frequently Asked Questions

What is the geometric meaning of determinant D = 0?
When D = 0, the two lines have the same slope. They are either parallel (if the constants differ, giving no solution) or the same line (if the equations are multiples, giving infinite solutions). The two equations are not independent — one is a linear combination of the other. This is why checking D alone is not enough; you must also check Dx and Dy to distinguish parallel from coincident lines.
Can Cramer's rule solve systems with three or more variables?
Yes, Cramer's rule extends to any n×n system using higher-order determinants. For a 3×3 system, you compute four 3×3 determinants (D, Dx, Dy, Dz). However, the computational cost grows factorially — calculating a 10×10 determinant requires millions of operations. For large systems, Gaussian elimination, LU decomposition, or iterative methods are far more efficient.
What if my coefficients are fractions or decimals?
Cramer's rule works with any real numbers — integers, fractions, decimals, or irrational numbers. The calculator handles all real number coefficients. If you have fractions, you can enter them as decimals (e.g., 1/3 as 0.333). The formula x = Dx/D and y = Dy/D works the same way regardless of the coefficient type.
How do I check if my solution is correct?
Substitute the computed x and y values back into both original equations. For the solution to be correct, both equations must be satisfied (the left side must equal the right side within rounding tolerance). The calculator's step-by-step work shows the full computation path, making it easy to verify each step independently.
What happens if the coefficients are very large or very small numbers?
Cramer's rule works mathematically for any real numbers, but with extreme values, floating-point precision can affect accuracy. Very large coefficients (e.g., 10^12) or very small ones (e.g., 10^-12) may introduce rounding errors in the determinant calculation. For better precision with extreme values, consider scaling all coefficients by a common factor before entering them. Systems with ill-conditioned matrices (where the determinant is very close to zero) are particularly sensitive to rounding errors — a small change in coefficients can produce a very different solution. In such cases, numerical methods with pivoting (like Gaussian elimination with partial pivoting) may give more reliable results than Cramer's rule.

Pro Tips

  • Always check the determinant D first — if D = 0, stop and classify the system as dependent or inconsistent before attempting to solve for x and y.
  • When entering negative coefficients, double-check the signs. A sign error in even one coefficient completely changes the geometric interpretation and solution.
  • For decimal coefficients, enter them with at least 3 decimal places of precision. The calculator uses floating-point arithmetic, so rounding at entry can compound.
  • To verify a solution manually, plug x and y back into BOTH original equations independently — satisfying just one equation is not enough.
  • Use the step-by-step work output to understand Cramer's rule deeply. Each step shows how determinants are computed from the coefficients, which helps when solving by hand on exams.
  • For systems that appear to have D very close to zero (e.g., D = 0.0001), the system is ill-conditioned. The lines are nearly parallel, and small measurement errors in coefficients can dramatically shift the intersection point.

Limitations to Know

  • Cramer's rule is not recommended for systems larger than 3x3 due to the factorial growth in determinant computation cost. Use Gaussian elimination or LU decomposition for 4x4 and larger systems.
  • For nearly-singular systems where the determinant is very close to zero, floating-point errors can produce unreliable results — consider using iterative refinement or higher-precision arithmetic.
  • The calculator uses standard double-precision floating-point (about 15-16 significant digits), so results for extremely large or small coefficients may lose accuracy.
  • This tool solves linear systems only; it does not handle nonlinear systems, inequalities, or systems with more equations than unknowns (overdetermined systems). For overdetermined systems, use least-squares regression instead.
Was this calculator helpful?
Cite this calculator

TheCalcUniverse. "System of Equations Solver — 2-Variable Linear System." TheCalcUniverse, 2026, https://thecalcuniverse.com/math/system-of-equations/. Accessed July 24, 2026.

Embed this calculator on your site

Free to embed. Paste this into any HTML page — it stays up to date automatically.

Open embed ↗

You may also like

Guides that use this calculator