SolveMathAI

System of equations solver

Two equations, three, or more. Substitution or elimination, whichever is cleaner.

Enter to solve · Shift+Enter for a new line

  • Free
  • No account
  • Every step shown
  • Arithmetic to calculus

A system asks for the values that make every equation true at once. Two straight lines meet at one point, unless they are parallel (no solution) or the same line (infinitely many). The work is always the same: get rid of one unknown, solve for the other, then go back for the first.

Substitution or elimination

Both always work. Pick by looking at the equations rather than by habit.

  1. Use substitution when one equation is already solved

    If you can see y = something, put that something into the other equation. One line of work and the second unknown is gone.

  2. Use elimination when the coefficients line up

    If one unknown has coefficients that are equal or opposite, add or subtract the equations to cancel it. With +2y and −2y, adding clears y immediately.

  3. Make them line up if they do not

    Multiply one or both equations by whatever makes a pair of coefficients match. Multiplying an equation by a number keeps it true.

  4. Solve the single equation left

    One unknown, one equation, ordinary algebra.

  5. Back-substitute

    Put the value you found into the simplest original equation to get the other unknown.

  6. Check in both original equations

    Not one of them, both. A slip in the elimination step usually still satisfies the equation you worked with.

Worked examples

Each one is solved the way the solver solves it: the rule first, then the line.

Solve the system 2x + y = 7 and x - y = 2

{2x+y=7xy=2\begin{cases} 2x + y = 7 \\ x - y = 2 \end{cases}
  1. y and −y are opposite, so add the equations
    (2x+y)+(xy)=7+2(2x + y) + (x - y) = 7 + 2
  2. y is eliminated
    3x=9    x=33x = 9 \;\Rightarrow\; x = 3
  3. Back-substitute into the second equation
    3y=2    y=13 - y = 2 \;\Rightarrow\; y = 1
  4. Check both
    2(3)+1=7  31=2  2(3) + 1 = 7 \;\checkmark \qquad 3 - 1 = 2 \;\checkmark
Answer
x=3,  y=1x = 3,\; y = 1

Solve the system y = 2x - 1 and 3x + 2y = 12

{y=2x13x+2y=12\begin{cases} y = 2x - 1 \\ 3x + 2y = 12 \end{cases}
  1. The first is already solved for y, so substitute
    3x+2(2x1)=123x + 2(2x - 1) = 12
  2. Expand
    3x+4x2=123x + 4x - 2 = 12
  3. Collect and solve
    7x=14    x=27x = 14 \;\Rightarrow\; x = 2
  4. Back-substitute
    y=2(2)1=3y = 2(2) - 1 = 3
  5. Check the second equation
    3(2)+2(3)=12  3(2) + 2(3) = 12 \;\checkmark
Answer
x=2,  y=3x = 2,\; y = 3

Solve the system 3x + 2y = 16 and 5x - 2y = 0

{3x+2y=165x2y=0\begin{cases} 3x + 2y = 16 \\ 5x - 2y = 0 \end{cases}
  1. Add to cancel y
    8x=16    x=28x = 16 \;\Rightarrow\; x = 2
  2. Back-substitute
    3(2)+2y=16    2y=103(2) + 2y = 16 \;\Rightarrow\; 2y = 10
  3. Solve for y
    y=5y = 5
  4. Check
    5(2)2(5)=0  5(2) - 2(5) = 0 \;\checkmark
Answer
x=2,  y=5x = 2,\; y = 5

Solve the system x + y + z = 6, 2x - y + z = 3, x + 2y - z = 2

{x+y+z=62xy+z=3x+2yz=2\begin{cases} x + y + z = 6 \\ 2x - y + z = 3 \\ x + 2y - z = 2 \end{cases}
  1. Add equations 1 and 2 to remove y
    3x+2z=93x + 2z = 9
  2. Double equation 1, then subtract equation 3
    (2x+2y+2z)(x+2yz)=122    x+3z=10(2x + 2y + 2z) - (x + 2y - z) = 12 - 2 \;\Rightarrow\; x + 3z = 10
  3. Two equations, two unknowns
    3x+2z=9,x+3z=103x + 2z = 9, \qquad x + 3z = 10
  4. Substitute x = 10 − 3z
    3(103z)+2z=9    7z=213(10 - 3z) + 2z = 9 \;\Rightarrow\; -7z = -21
  5. Solve down the chain
    z=3,x=1,y=613=2z = 3, \quad x = 1, \quad y = 6 - 1 - 3 = 2
  6. Check all three
    1+2+3=6  22+3=3  1+43=2  1 + 2 + 3 = 6\;\checkmark \quad 2 - 2 + 3 = 3\;\checkmark \quad 1 + 4 - 3 = 2\;\checkmark
Answer
x=1,  y=2,  z=3x = 1,\; y = 2,\; z = 3

Where marks get lost

Subtracting when you should add

Opposite coefficients are cleared by adding; equal coefficients by subtracting. Getting it backwards doubles the term instead of removing it.

Multiplying only part of an equation

When you scale an equation, every term is scaled, right-hand side included.

Answering with one number

A system of two unknowns has a pair for an answer. Stopping at x leaves the question half done.

Questions

What if the unknowns all cancel?

If you are left with something false like 0 = 5, the lines are parallel and there is no solution. If you are left with something always true like 0 = 0, the two equations describe the same line and there are infinitely many solutions.

Substitution or elimination, which is better?

Whichever gives less work. Substitution when one equation already has an unknown by itself; elimination when coefficients are equal or opposite. The answer is identical either way.

Can it do three or more equations?

Yes. It eliminates down to two unknowns, then to one, and back-substitutes up the chain, as in example four.

Does it use matrices?

It can. Ask for Gaussian elimination, Cramer’s rule or the matrix inverse by name and it will use that method instead.