Graphing, substitution and elimination, each with a worked example. Plus how to handle three variables and systems with no solution or infinitely many.

What is a system of equations?

A system of equations is two or more equations with the same variables, and its solution is the set of values that makes every equation true at the same time. For x + y = 10 and x − y = 2, the solution is x = 6, y = 4.

Each linear equation in two variables is a line. Solving the system means finding where those lines meet. There are three standard methods, and they always agree.

How do you solve a system of equations?

To solve a system of equations, you combine the equations so that one variable disappears, solve for the other, and then substitute back. Graphing, substitution and elimination are three ways of doing that.

Here’s a quick guide to which one to reach for:

How does the graphing method work?

Graph both equations on the same axes. The point where the lines cross is the solution.

For x + y = 10 and x − y = 2, rewrite them as y = −x + 10 and y = x − 2. The first line falls from (0, 10); the second rises from (0, −2). They cross at (6, 4), so x = 6 and y = 4.

Graphing is a good picture of what is going on, but it is only as accurate as your drawing. The system 4x + 3y = 25 and 3x − 2y = 0 has the solution x = 50/17, y = 75/17. No one reads that off graph paper, which is why the next two methods exist.

How does the substitution method work?

In the substitution method, you solve one equation for a variable and plug that expression into the other equation. That leaves one equation with one unknown.

Take y = 2x + 1 and 3x + y = 11. The first equation already gives y, so substitute it into the second:

3x + (2x + 1) = 11
5x + 1 = 11
5x = 10
x = 2
y = 2(2) + 1 = 5

How does the elimination method work?

The elimination method adds or subtracts the equations so one variable cancels. If the coefficients of a variable are opposites, adding the equations removes it.

In 2x + 3y = 12 and 5x − 3y = 9, the y terms are +3y and −3y. Add the equations:

(2x + 3y) + (5x − 3y) = 12 + 9
7x = 21
x = 3
2(3) + 3y = 12, so 3y = 6 and y = 2

How do you solve a system with three variables?

With three variables, use elimination twice to get two equations in two variables, solve that smaller system, then back-substitute. You need three equations to pin down three unknowns.

Take x + y + z = 6, 2x − y + z = 3 and x + 2y − z = 2. The third equation has −z, so pair it with each of the others:

First + third: 2x + 3y = 8
Second + third: 3x + y = 5
From 3x + y = 5: y = 5 − 3x
2x + 3(5 − 3x) = 8, so −7x = −7 and x = 1
y = 5 − 3(1) = 2
z = 6 − 1 − 2 = 3

When does a system have no solution or infinitely many?

A system has no solution when the lines are parallel, and infinitely many when the two equations describe the same line. You’ll know because both variables cancel during elimination.

For x + y = 3 and x + y = 5, subtracting gives 0 = 2, which is false. The lines are parallel, so there is no solution. For x + y = 3 and 2x + 2y = 6, the second is just the first doubled. Elimination gives 0 = 0, so every point on the line works, which you can write as x = 3 − y with y any real number.

How do you check a solution to a system?

Substitute both values into every original equation. If each one comes out true, the solution is right.

For (4, 2) in 3x + 2y = 16 and 2x − 5y = −2: 3(4) + 2(2) = 12 + 4 = 16, and 2(4) − 5(2) = 8 − 10 = −2. Both work. Checking only one equation isn’t enough, because infinitely many points sit on a single line. It’s the second equation that pins the answer down. The same habit from our article on checking algebra answers by substitution applies here.

How do you set up a system from a word problem?

Give each unknown its own letter, then write one equation for each fact in the problem. Two unknowns need two facts.

Say 3 notebooks and 2 pens cost $16, and 5 pens cost $2 more than 2 notebooks. Let x be the price of a notebook and y the price of a pen. The first fact gives 3x + 2y = 16. The second gives 5y = 2x + 2, which rearranges to 2x − 5y = −2.

That is the same system solved by elimination above, so a notebook costs $4 and a pen costs $2. Check the story, not only the equations. Three notebooks and 2 pens cost $12 + $4 = $16. Five pens cost $10, which is $2 more than the $8 for 2 notebooks.

What are common mistakes when solving systems of equations?

The most common mistake in solving systems of equations is multiplying only one side of an equation during elimination. If you multiply 3x + 2y = 16 by 5, the 16 becomes 80 too.

Other frequent slips are stopping after finding x, and losing a negative sign when subtracting one equation from another. Adding is safer: multiply by a negative number instead of subtracting. And always check the final pair in both original equations, since a pair that fits one equation can still miss the other.

Frequently asked questions

What is the elimination method?

The elimination method adds or subtracts the equations so that one variable cancels out. You may need to multiply an equation first so that the coefficients are opposites, like 10y and −10y.

What is the solution to a system of equations?

It is the set of values that makes every equation in the system true at once. For two lines, it is the point where they cross.

Is substitution or elimination better?

Neither is always better. Substitution is quicker when a variable is already isolated, like y = 2x + 1. Elimination is quicker when the coefficients of one variable match or are opposites.

How do you know if a system has no solution?

If both variables cancel and you get a false statement like 0 = 2, there is no solution. The lines are parallel.

Can a system of equations have infinitely many solutions?

Yes. If both variables cancel and you get a true statement like 0 = 0, the equations describe the same line and every point on it is a solution.

How many equations do you need for three variables?

You need three independent equations to find a single solution for three variables. With fewer, there are infinitely many solutions or none.

References and further reading