Skip to content
Omnikalc

System of linear equations calculator: 2 or 3 unknowns

Solve a system of two equations with two unknowns, or three with three, using Cramer's rule, and see whether it has a unique solution.

Updated on
Your inputs
Number of unknowns

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Value out of range

Results

x

2

y

3

z (3 unknowns only)

0

Determinant of the system
-5

Systems of linear equations

A system of linear equations is a set of equations that must all be true at the same time, such as 2x + 3y = 13 and x − y = −1. Each linear equation in two unknowns is a straight line, and the solution is the point where the lines cross. With three unknowns, each equation is a plane, and the solution is the point shared by all three planes.

Cramer’s rule

The calculator uses Cramer’s rule, which expresses each unknown as a ratio of determinants:

  • D is the determinant of the coefficients.
  • Dₓ, Dᵧ and D_z are the same determinant with the column of x, y or z replaced by the right-hand sides.
  • x = Dₓ ÷ D, y = Dᵧ ÷ D, z = D_z ÷ D.

The rule works as long as D is not zero. For larger systems, elimination is faster, but for two or three unknowns Cramer’s rule is quick and exact.

Worked example with two unknowns

Solve 2x + 3y = 13 and x − y = −1.

  1. D = 2 × (−1) − 3 × 1 = −5.
  2. Dₓ = 13 × (−1) − 3 × (−1) = −10, so x = −10 ÷ −5 = 2.
  3. Dᵧ = 2 × (−1) − 13 × 1 = −15, so y = −15 ÷ −5 = 3.
  4. Check: 2 × 2 + 3 × 3 = 13 and 2 − 3 = −1.

Worked example with three unknowns

Solve 2x + 3y − z = 13, x − y + 2z = −1 and x + y + z = 6. The determinant is −5, and the solution is x = 1, y = 4, z = 1. Substituting back: 2 + 12 − 1 = 13, 1 − 4 + 2 = −1 and 1 + 4 + 1 = 6.

When there is no unique solution

Case Determinant Picture with two unknowns
Unique solution not zero two lines crossing at one point
No solution zero two parallel lines
Infinitely many solutions zero the same line written twice

For example, x + y = 2 and 2x + 2y = 5 have no solution, because the second line is parallel to the first. The calculator flags a zero determinant instead of returning a misleading answer.

Entering your equations

Write each equation in the form ax + by + cz = d, moving every term with an unknown to the left and the constants to the right. A missing unknown has a coefficient of 0, and a term like −y has a coefficient of −1.

Where systems appear

Systems of equations solve mixture problems (how many liters of each solution to combine), pricing puzzles (two tickets and a drink cost this much), current in electric circuits with Kirchhoff’s laws, and balancing chemical equations.

Frequently asked questions

How do you solve a system of two equations?

By substitution, elimination or Cramer's rule. For 2x + 3y = 13 and x − y = −1, the solution is x = 2 and y = 3.

What is Cramer's rule?

Each unknown equals a determinant in which its column is replaced by the right-hand sides, divided by the determinant of the coefficients: x = Dₓ ÷ D, y = Dᵧ ÷ D.

What if the determinant is zero?

The system has no unique solution: either the equations contradict each other (no solution) or one is a combination of the others (infinitely many solutions).

How do I enter an equation with a missing variable?

Enter 0 as its coefficient. For x + 2z = 5 in a three-unknown system, the coefficients are 1, 0 and 2, and the right-hand side is 5.

Was this calculator helpful?

Thanks for your feedback!

Results are estimates provided for information purposes. They do not replace professional advice.