Skip to content
tryhardprep
All lessons

Systems of two linear equations in two variables

14 minute read · 10 sections

Read first: Math: how the section works, Desmos basics for the test

0 of 10 sectionsSections

What the questions look like

A Two or more equations that all have to be true at the same time. is two equations about the same two unknowns, usually xx and yy. On a graph each one is a straight line. A solution is one pair of numbers that makes both equations true.

Read the last line first. It might say:

  • “The solution to the given system of equations is (x,y)(x, y). What is the value of xx?” Some ask for x+yx+y instead.
  • “What system of linear equations is represented by the lines shown?”
  • “Which system of equations describes this situation?”
  • “Which of the following systems of linear equations has no solution?”
  • “In the given system of equations, pp is a A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson. If the system has no solution, what is the value of pp?” Here pp stands for one number you haven't been told, and it's the answer.

Check a pair in both equations.

Right
(3,1)(3,1) is the solution to 3x+5y=143x+5y=14 and 5x+3y=185x+3y=18.
Wrong
(8,−2)(8,-2) is the solution to 3x+5y=143x+5y=14 and 5x+3y=185x+3y=18.

(8,−2)(8,-2) works in the first equation, since 24−10=1424-10=14. In the second it gives 40−6=3440-6=34, so it's on only one of the lines.

If one letter is already alone, put it into the other equation. If not, make one letter cancel, or let Desmos solve it.

When one letter is already alone

y=2x−1 y=2x-1 3x+4y=29 3x+4y=29

The solution to the given system of equations is (x,y)(x, y). What is the value of xx?

  1. The first equation says yy is 2x−12x-1. Put that into the second equation, in parentheses.

    3x+4(2x−1)=293x+4(2x-1)=29
  2. Multiply both terms in the parentheses by 4.

    3x+8x−4=293x+8x-4=29
  3. Combine 3x3x and 8x8x.

    11x−4=2911x-4=29
  4. Add 4 to both sides.

    11x=3311x=33
  5. Divide both sides by 11.

    x=3x=3
  6. Put 3 into the first equation to get yy.

    y=2(3)−1=5y=2(3)-1=5
  7. Check in the second equation: 9+20=299+20=29.

    3(3)+4(5)=293(3)+4(5)=29

The question asks for xx, so the answer is 3. Once yy is gone, you're solving an equation with one letter, which the one-variable lesson covers.

Put the Numbers and letters combined with no equals sign, like 5x + 7.Read the lesson in parentheses, so the number in front multiplies all of it.

Right
3x+4(2x−1)=293x+4(2x-1)=29
Wrong
3x+8x−1=293x+8x-1=29

The 4 multiplies the −1-1 too. Leaving it out gives 11x=3011x=30, and x=3011x=\frac{30}{11}.

The expression has to go into the other equation. If you put 2x−12x-1 back into y=2x−1y=2x-1, you get 2x−1=2x−12x-1=2x-1, which is true for every xx and doesn't tell you anything.

Trap: The other letter

5 is a choice. It's the value of yy, worked out correctly, when the question asked for xx.

What to do: Write what the question asks for at the top of your scratch work, like “x = ?”, and check your answer against it before you pick.

Making one letter cancel

When both equations look like ax+by=cax+by=c, you can add them so one letter drops out. The number in front of a letter is its The number multiplying a letter, like the 5 in 5x.Read the lesson. A letter cancels when its two coefficients are opposites, like 12y12y and −12y-12y.

3x+4y=115 3x+4y=115 7x−3y=71 7x-3y=71
  1. Multiply every term of the first equation by 3.

    9x+12y=3459x+12y=345
  2. Multiply every term of the second by 4. Now the yy terms are 12y12y and −12y-12y.

    28x−12y=28428x-12y=284
  3. Add the equations: left side plus left side, right side plus right side.

    (9x+28x)+(12y−12y)=345+284(9x+28x)+(12y-12y)=345+284
  4. 12y−12y12y-12y is 0, so yy is gone.

    37x=62937x=629
  5. Divide both sides by 37.

    x=17x=17
  6. Put 17 into the second original equation.

    7(17)−3y=717(17)-3y=71
  7. Subtract 119 from both sides.

    −3y=−48-3y=-48
  8. Divide both sides by −3-3.

    y=16y=16
  9. Check in the first equation: 51+64=11551+64=115.

    3(17)+4(16)=1153(17)+4(16)=115

Multiply every term, including the number on the right side.

Right
Tripling 3x+4y=1153x+4y=115 gives 9x+12y=3459x+12y=345.
Wrong
Tripling 3x+4y=1153x+4y=115 gives 9x+12y=1159x+12y=115.

Tripling only the left side makes a different line, and every number after it comes out wrong.

You don't always need to multiply first. In 3x+4y=263x+4y=26 and 8x+4y=518x+4y=51, both yy terms are already +4y+4y.

When the matching terms have the same sign, subtract the equations. When they have opposite signs, add.

Right
Subtract: (8x+4y)−(3x+4y)=51−26(8x+4y)-(3x+4y)=51-26, so 5x=255x=25.
Wrong
Add: (8x+4y)+(3x+4y)=51+26(8x+4y)+(3x+4y)=51+26, so 11x+8y=7711x+8y=77.

4y+4y4y+4y is 8y8y, so adding keeps both letters. 4y−4y4y-4y is 0.

Trap: A letter that didn't cancel

Subtracting 28x−12y=28428x-12y=284 from 9x+12y=3459x+12y=345 gives −19x+24y=61-19x+24y=61. Both letters are still there, because 12y−(−12y)12y-(-12y) is 24y24y.

What to do: If the letter you wanted gone is still there, check whether you should have added or subtracted.

When the question asks for x + y

Sometimes the last line asks for x+yx+y or x−yx-y, and you never need xx or yy alone. Look for the same two coefficients in swapped places, as in the system from the first section:

3x+5y=14 3x+5y=14 5x+3y=18 5x+3y=18

What is the value of x+yx+y?

  1. Add the equations.

    (3x+5x)+(5y+3y)=14+18(3x+5x)+(5y+3y)=14+18
  2. Both letters now have 8 in front.

    8x+8y=328x+8y=32
  3. Divide every term by 8.

    x+y=4x+y=4

The solution is (3,1)(3,1), and 3+1=43+1=4, so it checks. Subtracting the first equation from the second gives 2x−2y=42x-2y=4 instead, so x−y=2x-y=2.

Trap: The combination done backward

When the question asks for x−yx-y, −2-2 is a choice. It's y−xy-x, from subtracting the equations in the other order.

What to do: Copy the combination from the question letter for letter, in its order. A negative x−yx-y is a normal answer, so keep it.

Adding and subtracting equations only gives sums and differences. For a product like xyxy, solve for both letters and multiply, which here is 3×1=33\times1=3.

If the last line asks for a multiple like 11x11x, watch for it on the way. Solving y=2x−1y=2x-1 and 3x+4y=293x+4y=29 reaches 11x=3311x=33 a step before x=3x=3, so the answer is 33. If the multiple never shows up, find xx and multiply.

Here's one to try.

Worked example

11x+5y=3085x+11y=428\begin{aligned}11x + 5y &= 308 \\ 5x + 11y &= 428\end{aligned}

The solution to the given system of equations is (x,y)(x, y). What is the value of x−yx-y?

  1. A

    −20-20

  2. B

    2020

  3. C

    1313

  4. D

    4646

Show the answer
  • A

    −20-20

    Correct answer

    Subtract the second Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson from the first: 6x−6y=−1206x-6y=-120. Dividing by 66 gives x−y=−20x-y=-20.

  • B

    2020

    Subtracting the first Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson from the second gives −6x+6y=120-6x+6y=120, which simplifies to y−x=20y-x=20. This reverses the requested difference.

  • C

    1313

    Solving the system gives x=13x=13, but the question asks for x−yx-y, not xx alone.

  • D

    4646

    Adding the Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson gives 16x+16y=73616x+16y=736, so x+y=46x+y=46. This computes the sum instead of the requested difference.

Solution

Subtract the second Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson from the first:

(11x+5y)−(5x+11y)=308−428(11x+5y)-(5x+11y)=308-428

Combine Parts of an expression with the same letter raised to the same power, like 5x and 2x, which you can add together.Read the lesson to get 6x−6y=−1206x-6y=-120. Divide both sides by 66:

x−y=−20x-y=-20

Therefore, the requested value is −20-20.

Writing the equations from a story

Name each unknown in words before you write anything: “ww = water bottles, hh = hoodies.” Then turn each fact into its own equation. Often one fact is a count and the other is an amount of money.

A school club sold 58 water bottles and hoodies at a fundraiser. Water bottles cost $8, hoodies cost $14, and the club took in $590 in all.

A count equation counts each item once. A money equation multiplies each count by its price.

Right
w+h=58w+h=58 and 8w+14h=5908w+14h=590
Wrong
w+h=58w+h=58 and 8w+14h=588w+14h=58

8w+14h8w+14h counts dollars, and 58 counts bottles and hoodies.

  1. Get ww alone in the count equation by subtracting hh.

    w=58−hw=58-h
  2. Put it into the money equation, in parentheses.

    8(58−h)+14h=5908(58-h)+14h=590
  3. Multiply both terms by 8.

    464−8h+14h=590464-8h+14h=590
  4. Combine −8h-8h and 14h14h.

    464+6h=590464+6h=590
  5. Subtract 464 from both sides.

    6h=1266h=126
  6. Divide both sides by 6.

    h=21h=21
  7. Find ww.

    w=58−21=37w=58-21=37
  8. Check the money: 296+294=590296+294=590.

    8(37)+14(21)=5908(37)+14(21)=590

That's 37 water bottles and 21 hoodies.

Trap: The prices swapped

14w+8h=59014w+8h=590 gives each water bottle the hoodie price. That system says 21 water bottles, which is the number of hoodies.

What to do: Read each equation back as a sentence with its units: 8 dollars times the number of water bottles.

“Times as many” gets turned around a lot. Say a farm stand sold 5 times as many ears of corn as melons.

Put the multiplier on the smaller amount. “PP is kk more than QQ” works the same way: P=Q+kP=Q+k.

Right
C=5MC=5M
Wrong
5C=M5C=M

5C=M5C=M makes the melons 5 times the corn. Test a number: 10 melons should mean 50 ears of corn, and only C=5MC=5M gives that.

If the stand sold 240 items in all, the second equation is C+M=240C+M=240, and 5M+M=2405M+M=240 gives 40 melons.

If the question only asks which system describes the story, stop once both equations match a choice. Here's a word problem to try.

Worked example
100%
Graph with x as the number of youth visitors and y as the number of adult visitors. One line represents 13 more adults than youths, and the other represents $910 in admission revenue.

At Rafiq’s museum, adult admission cost $8, youth admission cost $5, and 13 more adults than youths visited.

How many youth visitors came to the museum that day?

  1. A

    78

  2. B

    75

  3. C

    70

  4. D

    62

Show the answer
  • A

    78

    This results from writing the comparison backward as x=y+13x=y+13, which treats the number of youths as 13 greater than the number of adults and produces x=78x=78.

  • B

    75

    This is the adult count, since y=62+13=75y=62+13=75. The question asks for the number of youth visitors.

  • C

    70

    This results from calculating 910÷(5+8)=70910\div(5+8)=70, which ignores that 13 additional adults each paid $8\$8.

  • D

    62

    Correct answer

    Let xx be the number of youth visitors. Since there were 13 more adults, the revenue Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson is 5x+8(x+13)=9105x+8(x+13)=910. Solving gives 13x=80613x=806, so x=62x=62.

Solution

Let xx be the number of youth visitors. Then the number of adult visitors is x+13x+13.

Use the admission prices and total revenue to write 5x+8(x+13)=9105x+8(x+13)=910. Distribute and combine Parts of an expression with the same letter raised to the same power, like 5x and 2x, which you can add together.Read the lesson:

5x+8x+104=9105x+8x+104=910

13x=80613x=806

x=62x=62

Therefore, 62 youth visitors came to the museum that day.

Clearing fractions first

Fractions make it hard to match coefficients by hand. Multiply each whole equation by a number all its bottoms go into.

Multiply every term on both sides by the same number.

Right
3x4+y6=512\frac{3x}{4}+\frac{y}{6}=\frac{5}{12} times 12 is 9x+2y=59x+2y=5.
Wrong
3x4+y6=512\frac{3x}{4}+\frac{y}{6}=\frac{5}{12} without the bottoms is 3x+y=53x+y=5.

Dropping the bottoms multiplies each term by a different number, so you get a different line.

When a letter sits on the right side, move it left first.

  1. Start from the equation.

    56s=38r+2\frac{5}{6}s=\frac{3}{8}r+2
  2. Subtract 38r\frac{3}{8}r from both sides, so both letters are on the left.

    56s−38r=2\frac{5}{6}s-\frac{3}{8}r=2
  3. Multiply every term by 24, since 6 and 8 both go into 24.

    20s−9r=4820s-9r=48

A word problem can hand you the fractions. “One-fourth of rr exceeds one-sixth of dd by 23\frac{2}{3}” works like this:

  1. “Exceeds by” means the first amount minus the second.

    r4−d6=23\frac{r}{4}-\frac{d}{6}=\frac{2}{3}
  2. Multiply every term by 12.

    3r−2d=83r-2d=8

The choices may show only the cleared form, so you'd look for 3r−2d=83r-2d=8.

In Desmos you can skip the cleanup and type the fractions, pressing the right arrow after each bottom number. For 3x4+y6=512\frac{3x}{4}+\frac{y}{6}=\frac{5}{12}, type 3/4 → x+1/6 → y=5/12, where → is the right arrow. Check that both letters sit outside the fractions.

Graphs, and solving in Desmos

On a graph, the solution is the point where the lines cross.

Write the crossing as (x,y)(x,y), with the horizontal number first.

Right
Lines crossing 3 across and 14 up meet at (3,14)(3,14).
Wrong
Lines crossing 3 across and 14 up meet at (14,3)(14,3).

(14,3)(14,3) is 14 across and 3 up, a different point.

Trap: A point on only one line

Say the lines cross at (3,14)(3,14), and one of them meets the vertical One of the two lines a graph is measured against, one running across and one running up. at (0,11)(0,11). (0,11)(0,11) is a choice, but it's on only one line.

What to do: Check the scale on each axis, since a square may not be 1. Trace from the crossing straight down and straight across, and make sure the point is on both lines.

“What system of linear equations is represented by the lines shown?” asks for both equations. Find each line's How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson and The output when the input is 0, which is where a graph crosses the vertical axis.Read the lesson from its own two labeled points. For a line through (0,9)(0,9) and (7,23)(7,23):

  1. Change in yy over change in xx.

    m=23−97−0=2m=\frac{23-9}{7-0}=2
  2. The line crosses the vertical axis at (0,9)(0,9), so b=9b=9.

    y=2x+9y=2x+9

Do the other line the same way. If the choices look like ax+by=cax+by=c, move the xx term over to compare: y=2x+9y=2x+9 is −2x+y=9-2x+y=9. The linear functions lesson shows how to get an equation from two points.

Typing both equations into Desmos takes about ten seconds, which is worth it when there are fractions, messy numbers, or letters on both sides. If one equation already gives you a value, like y=23y=23, or one subtraction finishes the work, it's quicker by hand.

Solve a system by graphing

  1. Type the first equation on line 1 and the second on line 2. Letters on both sides are fine. Desmos needs xx and yy, so if the letters are rr and ss, type xx for every rr and yy for every ss, and write down which is which.
  2. Click a line, then click the gray dot where the lines cross to read its coordinates.

If you don't see a crossing, zoom out before you decide there isn't one. The coordinates show as decimals. A value like 3.5 goes into a A question where you type your own answer instead of picking one of four.Read the lesson as it is. For a long decimal, finish by hand to get the exact fraction. The solving by graphing lesson has more.

One solution, none, or infinitely many

Put both equations in y=mx+by=mx+b form, then compare the slopes, and after that the y-intercepts.

SlopesY-interceptsSolutions
DifferentAnyExactly one
SameDifferentNone
SameSameInfinitely many
Two lines on one grid with the same slope, one crossing the y-axis at 5 and the other at −5. They stay the same distance apart everywhere and never meet, so the system they describe has no solution.

When both equations look like ax+by=cax+by=c, multiply one so its left side matches the other's, then compare the right sides.

3x+7y=20 3x+7y=20 9x+21y=50 9x+21y=50
  1. Triple every term of the first equation. Now the left sides match.

    9x+21y=609x+21y=60
  2. The right sides don't. The lines are parallel and never meet, so there's no solution.

    60≠5060\ne50

For infinitely many solutions, one equation has to be the other times a single number, right side included.

Right
4x+3y=124x+3y=12 and 8x+6y=248x+6y=24 have infinitely many solutions.
Wrong
4x+3y=124x+3y=12 and 8x+6y=128x+6y=12 have infinitely many solutions.

The wrong pair doubles the left side and not the 12. 8x+6y=128x+6y=12 is a parallel line, so that system has no solution.

Trap: The same line called parallel

Asked which system has no solution, a choice pairs 4x+7y=224x+7y=22 with 8x+14y=448x+14y=44. The slopes match, but 44 is 2 times 22, so it's one line drawn twice.

What to do: Once the left sides match, always compare the right sides before you pick.

Some choices have a letter in every equation. Compare y=ax−3y=ax-3 with 6y=6ax+126y=6ax+12.

  1. Divide every term of the second equation by 6.

    y=ax+2y=ax+2
  2. Same slope, aa, and different y-intercepts. No solution, whatever aa is.

    −3≠2-3\ne2

A question can also add a third line to a system you've solved. Say y=2x+1y=2x+1 and y=−x+7y=-x+7 cross at (2,5)(2,5), and the third line is y=x+3y=x+3. Put in x=2x=2: 2+3=52+3=5, so the third line goes through (2,5)(2,5) too, and the three equations have one solution. If the third line were y=x+4y=x+4, it would miss (2,5)(2,5), and there'd be no solution.

Trap: More lines, more solutions

“Infinitely many” is a choice, because three lines seem to give more chances to cross. A solution has to be on all three lines, and (2,5)(2,5) is the only point on the first two.

What to do: Solve the first two equations, then test that point in the third.

Finding the constant

Here the question tells you the system has no solution and asks for the letter. Make the left sides match, then check that the right sides don't.

2x+5y=9 2x+5y=9 6x+py=4 6x+py=4
  1. Triple every term of the first equation, so its xx term matches the 6x6x.

    6x+15y=276x+15y=27
  2. For no solution, the yy terms have to match too.

    p=15p=15
  3. Check the right sides. They're different, so the lines are parallel.

    27≠427\ne4

Don't skip the last row. If the second equation had been 6x+py=276x+py=27, then p=15p=15 would make it the same line, with infinitely many solutions.

The harder version puts a letter on the right side, so the printed numbers aren't the real ones.

6x+11y=5y−7 6x+11y=5y-7 px−2y=3 px-2y=3

In the given system of equations, pp is a constant. If the system has no solution, what is the value of pp?

  1. Subtract 5y5y from both sides of the first equation.

    6x+6y=−76x+6y=-7
  2. Multiply every term of the second equation by −3-3, so its yy term becomes 6y6y.

    −3px+6y=−9-3px+6y=-9
  3. For no solution, the xx terms have to match too.

    −3p=6-3p=6
  4. Divide both sides by −3-3.

    p=−2p=-2
  5. Check: this is the second equation times −3-3 with p=−2p=-2. −9≠−7-9\ne-7, so there's no solution.

    6x+6y=−96x+6y=-9

Trap: Matched before moving the letter

An answer of −1211-\frac{12}{11} comes from using 11y11y, the printed term, as the first equation's yy term. That leaves out the 5y5y on the right.

What to do: Move every letter to the left side first, then match.

Negative and fraction answers are normal here, so don't change your work because of one.

Now try one where the constant is squared.

Worked example

9x+4y=8x+129x+4y=8x+12

p2x+y=p+52p^2x+y=p+\frac{5}{2}

In the given system of equations, pp is a constant less than 1. If the system has no solution, what is the value of pp?

Show the answer

Accepted answers: -1/2, -0.5, -.5

Solution

Subtract 8x8x from both sides of the first Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson to get x+4y=12x+4y=12, then solve for yy: y=−14x+3y=-\frac14x+3. The second equation becomes y=−p2x+p+52y=-p^2x+p+\frac52.

For the system to have no solution, the lines must have equal How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson and different Where a graph crosses an axis.Read the lesson. Set p2=14p^2=\frac14, which gives p=±12p=\pm\frac12. Both values are less than 11. When p=12p=\frac12, the second intercept is 33, so the equations describe the same line and have infinitely many solutions. When p=−12p=-\frac12, the second intercept is 22, so the lines are parallel and distinct. Thus, p=−12p=-\frac12.

The wrong answer −1.5-1.5 comes from matching slopes with the printed 9x9x and leaving out the 8x8x on the right side. That makes the first slope −94-\frac94, so p2=94p^2=\frac94 and p=−1.5p=-1.5. Moving 8x8x to the left side first leaves xx, with a The number multiplying a letter, like the 5 in 5x.Read the lesson of 11.

The wrong answer −2-2 comes from taking the first line’s slope as −4-4 instead of −14-\frac14, dividing the 44 by the 11 instead of the 11 by the 44. Then p2=4p^2=4, so p=−2p=-2. Solving x+4y=12x+4y=12 for yy divides every term by 44, so the slope is −14-\frac14.

Note that −1/2-1/2, −0.5-0.5, and −.5-.5 are examples of ways to enter a correct answer.

Practice

Before each one, write what the last line asks for. When you finish, check your answer against both equations.

Try it

5 questions on this skill, with every choice explained.

Start the drill

Next steps