Skip to content
PiRush

LearnAlgebra

Two equations, two unknowns

Find x and y when you have two equations, by adding the equations together or by putting one into the other.

Here is an old kind of puzzle: "Two numbers add up to 10, and one is 4 more than the other. What are they?" There are two unknown numbers, so we need two facts to find them. In algebra, the two facts become two equations, and together they are called a system of equations. About 2,000 years ago, a Chinese book called The Nine Chapters on the Mathematical Art already solved systems like this with counting rods on a board. The method it used is the same one we use first here: combine the equations so that one unknown disappears.

Why one equation is not enough

Take x + y = 10. Many pairs of numbers fit it: 1 and 9, 2 and 8, 6 and 4, 7 and 3, and also numbers like 2.5 and 7.5. One equation alone cannot tell us which pair we want. A second equation, like x − y = 4, picks out exactly one pair.

xyx + yx − y
64102
73104
82106

Only x = 7 and y = 3 make both equations true. Trying pairs works for small numbers, but it is slow. The methods below find the answer directly.

Method 1: add the two equations

An equation is a balance: both sides have the same value. So if you add the left sides of two equations, and add their right sides, the results are still equal. The trick is to choose this so that one letter cancels out.

Example 1

x + y = 12 and x − y = 2. Find x and y.

  1. Add the left sides: x + y + x − y = 2x. The +y and the −y cancel.
  2. Add the right sides: 12 + 2 = 14.
  3. So 2x = 14.
  4. Divide both sides by 2: x = 7.
  5. Put x = 7 into the first equation: 7 + y = 12, so y = 5.
  6. Check in the second equation: 7 − 5 = 2. Correct.

Answer: x = 7 and y = 5

  1. Write the two equations one under the other, with x under x and y under y.
  2. If one letter has a plus in one equation and a minus in the other, add the equations. That letter cancels.
  3. Solve the simple equation that is left.
  4. Put that answer into either of the two equations to find the other letter.
  5. Check both answers in both equations.

Example 2

x + y = 18 and x − y = 8. What is y?

  1. Add the equations: 2x = 26.
  2. Divide by 2: x = 13.
  3. Now find y: 13 + y = 18, so y = 5.
  4. Check: 13 − 5 = 8. Correct.

Answer: y = 5

When the numbers in front are different

The adding method also works when the letters have numbers in front of them, as long as one letter cancels. Look at the y terms first.

Example 3

3x + y = 17 and x − y = 3. What is x?

  1. The y terms are +y and −y, so adding cancels them.
  2. Add the left sides: 3x + x = 4x.
  3. Add the right sides: 17 + 3 = 20.
  4. So 4x = 20, and x = 5.
  5. Then 5 − y = 3, so y = 2.
  6. Check in the first equation: 3(5) + 2 = 15 + 2 = 17. Correct.

Answer: x = 5

Example 4

x + 3y = 14 and x − 3y = −4. What is y?

  1. The y terms are +3y and −3y, so add the equations.
  2. 2x = 14 + (−4) = 10, so x = 5.
  3. Put x = 5 into the first equation: 5 + 3y = 14.
  4. Take 5 away from both sides: 3y = 9.
  5. Divide by 3: y = 3.
  6. Check in the second equation: 5 − 9 = −4. Correct.

Answer: y = 3

When to subtract instead

Sometimes both equations have the same sign in front of y, like +y and +y. Adding would give 2y, and nothing cancels. Then you subtract one equation from the other: take the second left side away from the first left side, and the second right side away from the first right side.

Example 5

4x + y = 19 and x + y = 7. What is y?

  1. Both have +y, so subtract the second equation from the first.
  2. Left sides: (4x + y) − (x + y) = 4x + y − x − y = 3x.
  3. Right sides: 19 − 7 = 12.
  4. So 3x = 12, and x = 4.
  5. Then 4 + y = 7, so y = 3.
  6. Check in the first equation: 4(4) + 3 = 16 + 3 = 19. Correct.

Answer: y = 3

Remember

When a letter has the same number in front of it in both equations: if the signs are opposite, add the equations; if the signs are the same, subtract them.

Method 2: put one equation into the other

The second method is called substitution, which means "putting one thing in place of another". If one equation tells you what one letter equals, you can put that into the other equation. Then only one letter is left.

Example 6

y = 2x and x + y = 15. Find x and y.

  1. The first equation says y is the same as 2x.
  2. Put 2x in place of y in the second equation: x + 2x = 15.
  3. So 3x = 15, and x = 5.
  4. Then y = 2(5) = 10.
  5. Check: 5 + 10 = 15. Correct.

Answer: x = 5 and y = 10

Example 7

Solve 2x + y = 11 and x − y = 1 by substitution.

  1. From the second equation, add y to both sides: x = y + 1.
  2. Put y + 1 in place of x in the first equation: 2(y + 1) + y = 11.
  3. Multiply out the bracket: 2y + 2 + y = 11.
  4. Collect the y terms: 3y + 2 = 11.
  5. Take 2 away from both sides: 3y = 9, so y = 3.
  6. Then x = 3 + 1 = 4.

Answer: x = 4 and y = 3

Try it yourself

  1. 1.x + y = 16 and x − y = 10. What is y?

    Show the answer

    3

    Adding gives 2x = 26, so x = 13. Then y = 16 − 13 = 3.

  2. 2.x + y = 11 and x − y = 5. What is x?

    Show the answer

    8

    Adding gives 2x = 16, so x = 8.

  3. 3.2x + y = 13 and x − y = 2. What is x?

    Show the answer

    5

    Adding cancels y: 3x = 15, so x = 5. Then y = 3, and 10 + 3 = 13.

  4. 4.5x + 2y = 16 and x + 2y = 8. What is y?

    Show the answer

    3

    Subtracting gives 4x = 8, so x = 2. Then 2 + 2y = 8, so 2y = 6 and y = 3.

  5. 5.y = 3x and x + y = 20. What is y?

    Show the answer

    15

    Put 3x in place of y: 4x = 20, so x = 5 and y = 3(5) = 15.

  6. 6.Two numbers add up to 30, and one is 8 more than the other. What are they?

    Show the answer

    19 and 11

    x + y = 30 and x − y = 8. Adding gives 2x = 38, so x = 19 and y = 11.

Ready to test yourself?

Play Algebra: 20 seconds per question, and it gets harder as you go.