Jugami Algebra

Jugami › Algebra › Systems of Linear Equations

Systems of Linear Equations

How to solve two linear equations together by graphing, substitution and elimination.

Gym A charges $20 to join and $10 a month. Gym B charges $50 to join and $5 a month. After how many months do they cost the same? Gym A costs y = 10x + 20 dollars after x months, and Gym B costs y = 5x + 50. The answer is the one pair of numbers that makes both equations true: after 6 months, both cost $80.

Two equations that have to be true at the same time are called a system of equations. This unit shows three ways to solve one: by graphing, by substitution and by elimination. It also shows how to tell when a system has no solution or infinitely many.

Graph of two lines on a grid from −6 to 6. The solid teal line y = x + 1 rises from left to right. The dashed coral line y = −1/2x + 4 falls from left to right. They cross at the point (2, 3), marked in purple.xy−6−5−4−3123456−6−5−4−3−2−123560y = x + 1y = −1/2x + 4(2, 3)
The solution of a system of two lines is the point where they cross. Here it is (2, 3).

What is a system of equations?

A system of linear equations is two or more linear equations that use the same variables. In this unit each system has two equations in x and y, like this one:

x + y = 5 and 2x − y = 1

A solution of the system is an ordered pair (x, y) that makes every equation true. One equation alone has infinitely many solutions (all the points on its line), but the system asks for the points that work in both.

Example: is (2, 3) a solution?

2 + 3 = 5First equation: true2(2) − 3 = 1Second equation: trueYes(2, 3) works in both, so it is a solution

Your turn

Is (1, 4) a solution of x + y = 5 and 3x − y = 2?

Show answer
1 + 4 = 5First equation: true3(1) − 4 = −1Second equation: −1 is not 2, so falseNoA solution has to work in both equations

Solving a system by graphing

Every point on a line is a solution of that line’s equation. So a point on both lines is a solution of both equations: the solution of the system is where the lines intersect.

  1. Write each equation in slope-intercept form, y = mx + b, if it isn’t already.
  2. Graph both lines on the same grid.
  3. Read the point where they cross.
  4. Check that point in both original equations.

Example: y = 2x − 3 and y = −x + 3

Line 1: slope 2, y-intercept (0, −3)Plot (0, −3), then go up 2 and right 1Line 2: slope −1, y-intercept (0, 3)Plot (0, 3), then go down 1 and right 1The lines cross at (2, 1)Read the intersection1 = 2(2) − 3 and 1 = −2 + 3Check: both are true
The solid teal line y = 2x − 3 and the dashed coral line y = −x + 3 cross at (2, 1).xy−6−5−4−3−2−123456−6−5−3−2−1124560y = 2x − 3y = −x + 3(2, 1)

When graphing isn’t enough

Graphing shows you the answer, but it is hard to read exactly when the lines cross at a point like (7/3, −1/2). Substitution and elimination, below, give exact answers every time.

Two-line explorer

Change the slope and y-intercept of each line and watch where they cross. Give both lines the same slope and see what happens, then give them the same slope and the same intercept.

Solving by substitution

Substitution turns two equations into one. Use it when one equation already says “y =” or “x =”, or when a variable is easy to get alone.

  1. Solve one equation for one variable.
  2. Substitute that expression into the other equation. Now it has only one variable.
  3. Solve for that variable.
  4. Put the value back in to find the other variable, and check in both equations.

Example 1: y = 3x − 5 and 2x + y = 10

2x + (3x − 5) = 10Replace y with 3x − 5 in the second equation5x − 5 = 10Combine like terms5x = 15Add 5 to both sidesx = 3Divide by 5y = 3(3) − 5 = 4Put x = 3 into y = 3x − 5(3, 4)Check: 2(3) + 4 = 10 ✓

Example 2: x − 2y = 1 and 3x + 4y = 23

x = 2y + 1Solve the first equation for x3(2y + 1) + 4y = 23Substitute into the second equation6y + 3 + 4y = 23Distribute10y + 3 = 23Combine like terms10y = 20Subtract 3y = 2Divide by 10x = 2(2) + 1 = 5Put y = 2 into x = 2y + 1(5, 2)Check: 3(5) + 4(2) = 23 ✓

Use parentheses

When you substitute an expression, put it in parentheses. In Example 2, 3(2y + 1) means 3 times the whole expression, which is 6y + 3, not 6y + 1.

Solving by elimination

Elimination adds the two equations so that one variable cancels. It works because adding equal amounts to both sides of an equation keeps it true.

  1. Line up the equations in the form Ax + By = C.
  2. If needed, multiply one or both equations so the coefficients of one variable are opposites, like 2y and −2y.
  3. Add the equations. That variable cancels.
  4. Solve for the other variable, put it back into either equation, and check.

Example 1: 3x + 2y = 16 and 5x − 2y = 0

8x = 16Add the equations: 2y and −2y cancelx = 2Divide by 83(2) + 2y = 16Put x = 2 into the first equation2y = 10Subtract 6y = 5Divide by 2(2, 5)Check: 5(2) − 2(5) = 0 ✓

Example 2: 2x + 3y = 12 and 5x − 4y = 7

8x + 12y = 48Multiply the first equation by 415x − 12y = 21Multiply the second equation by 323x = 69Add: 12y and −12y cancelx = 3Divide by 232(3) + 3y = 12Put x = 3 into the first equation3y = 6Subtract 6y = 2Divide by 3(3, 2)Check: 5(3) − 4(2) = 7 ✓
Which method to choose
If the system looks like thisTry
One equation already says y = … or x = …Substitution
A variable has coefficient 1 or −1Substitution
Opposite coefficients, like 4y and −4yElimination: just add
Both equations in Ax + By = C formElimination: multiply first
You want a picture, or an estimateGraphing

All three methods give the same answer. Pick the one that means the least work.

One solution, no solution or infinitely many

Two lines in a plane can meet in three ways, so a system of two linear equations has exactly one solution, no solution or infinitely many solutions.

Two lines with different slopes: the solid teal line y = x and the dashed coral line y = −x + 4 cross at exactly one point, (2, 2).xy−5−4−3−21234−6−5−4−3−212356y = xy = −x + 4(2, 2)
One solution. Different slopes: the lines cross once.
Two parallel lines: the solid teal line y = 2x + 1 and the dashed coral line y = 2x − 3. They have the same slope and never cross.xy−5−4−3−22345−6−5−3−2−11234560y = 2x + 1y = 2x − 3
No solution. Same slope, different y-intercepts: parallel lines never meet.
One line, y = −2x + 4. The equations 2x + y = 4 and 4x + 2y = 8 both describe this same line, so every point on it is a solution.xy−5−4−3−2−11345−6−5−4−3−2−1123460both: y = −2x + 4
Infinitely many. Same slope and same y-intercept: it is one line.

You don’t need a graph to tell. When you solve, both variables cancel in the last two cases, and what is left tells you which one you have:

Example: −2x + y = 1 and −2x + y = −3

2x − y = 3Multiply the second equation by −10 = 4Add the equations: x and y both cancelNo solution0 = 4 is never true. These are the parallel lines y = 2x + 1 and y = 2x − 3

Example: 2x + y = 4 and 4x + 2y = 8

−4x − 2y = −8Multiply the first equation by −20 = 0Add the equations: x and y both cancelInfinitely many solutions0 = 0 is always true. The second equation is the first one times 2, so both are the line y = −2x + 4
Telling the three cases apart
Slopes and y-interceptsLinesSolutionsEliminating gives
different slopescross onceonex = a number
same slope, different interceptsparallelnone0 = 4 or similar
same slope, same interceptsame lineinfinitely many0 = 0

Word problems

Many real problems have two unknowns and two facts about them. Name the unknowns, write one equation for each fact, then solve.

Example 1: tickets

Let x = adult tickets, y = student ticketsName the unknownsx + y = 200200 tickets were sold8x + 5y = 1240Adults pay $8, students $5, and the total was $1,240y = 200 − xSolve the first equation for y8x + 5(200 − x) = 1240Substitute3x + 1000 = 1240Distribute and combine like termsx = 80Subtract 1,000, then divide by 3y = 200 − 80 = 120Find y80 adult and 120 student ticketsCheck: 8(80) + 5(120) = 640 + 600 = 1240 ✓

The question: a school play sold 200 tickets and took in $1,240. Adult tickets cost $8 and student tickets cost $5. How many of each were sold?

Example 2: a mixture

Let x = liters of 20% juice, y = liters of 50% juiceName the unknownsx + y = 30The mix is 30 liters0.2x + 0.5y = 0.4(30)The juice in each part adds up to the juice in the mix2x + 5y = 120Multiply by 10 to clear the decimals−2x − 2y = −60Multiply the first equation by −23y = 60Add the equationsy = 20, x = 10Divide by 3, then x = 30 − 2010 L of 20% and 20 L of 50%Check: 0.2(10) + 0.5(20) = 2 + 10 = 12, and 0.4(30) = 12 ✓

The question: how many liters of a 20% juice drink and a 50% juice drink make 30 liters of a 40% juice drink?

Example 3: the two gyms

10x + 20 = 5x + 50Both equal y, so set them equal5x = 30Subtract 5x and 20 from both sidesx = 6Divide by 5y = 10(6) + 20 = 80Find the cost(6, 80)After 6 months both gyms cost $80

Answer the question

A solution like (80, 120) isn’t the end. Say what it means in words, with units, and check that it makes sense: you can’t sell half a ticket or use −3 liters.

Common mistakes

✗Stopping after finding x: x = 3.✓A solution is a pair. Find y as well and write (3, 4).
✗Substituting into the same equation you solved, which gives 0 = 0 or y = y.✓Substitute into the other equation.
✗Forgetting parentheses: 3(2y + 1) written as 6y + 1.✓Multiply every term: 6y + 3.
✗Multiplying only one side when scaling an equation for elimination.✓Multiply every term on both sides: 2x + 3y = 12 times 4 is 8x + 12y = 48.
✗Reading 0 = 0 as “the answer is 0”.✓0 = 0 means infinitely many solutions. 0 = 4 means no solution.
✗Writing the point backward, as (y, x).✓x comes first: (x, y).
✗Checking the answer in only one equation.✓A solution has to make both equations true. Check both.

Practice problems

Try each one on paper, then open the answer to check your work.

  1. Is (3, 1) a solution of 2x + y = 7 and x − y = 2?
    Show answer
    2(3) + 1 = 7True3 − 1 = 2TrueYesIt works in both
  2. Solve by graphing: y = x + 2 and y = −2x + 5.
    Show answer
    The lines cross at (1, 3)Graph both lines3 = 1 + 2 and 3 = −2 + 5Check
  3. Solve by substitution: y = 2x + 1 and 3x + y = 16.
    Show answer
    3x + (2x + 1) = 16Substitute5x = 15Combine, then subtract 1x = 3Divide by 5y = 2(3) + 1 = 7Find y(3, 7)
  4. Solve by substitution: x + 3y = 7 and 2x − y = 7.
    Show answer
    x = 7 − 3ySolve the first equation for x2(7 − 3y) − y = 7Substitute14 − 7y = 7Distribute and combiney = 1Subtract 14, then divide by −7x = 7 − 3(1) = 4Find x(4, 1)
  5. Solve by elimination: 4x + 3y = 5 and 2x − 3y = 13.
    Show answer
    6x = 18Add: 3y and −3y cancelx = 3Divide by 64(3) + 3y = 5Put x = 3 into the first equation3y = −7Subtract 12y = −7/3Divide by 3(3, −7/3)Not every answer is a whole number
  6. Solve by elimination: 3x + 2y = 4 and 2x + 5y = −1.
    Show answer
    6x + 4y = 8Multiply the first equation by 2−6x − 15y = 3Multiply the second by −3−11y = 11Add: the x-terms cancely = −1Divide by −113x + 2(−1) = 4Put y = −1 into the first equationx = 2Add 2, then divide by 3(2, −1)
  7. How many solutions: 6x − 2y = 8 and 3x − y = 4?
    Show answer
    −6x + 2y = −8Multiply the second equation by −20 = 0Add: everything cancelsInfinitely manyThe first equation is the second times 2: the same line
  8. How many solutions: y = −3x + 2 and 6x + 2y = 10?
    Show answer
    y = −3x + 5Solve the second equation for ySame slope −3, different y-interceptsCompare the linesNo solutionThe lines are parallel
  9. A farm has 25 chickens and goats, with 70 legs in all. How many of each? (Chickens have 2 legs, goats have 4.)
    Show answer
    x + y = 25; 4x + 2y = 70x = goats, y = chickens−2x − 2y = −50Multiply the first equation by −22x = 20Addx = 10, y = 1510 goats and 15 chickens4(10) + 2(15) = 70Check ✓
  10. Two numbers add up to 12 and differ by 4. What are they?
    Show answer
    x + y = 12; x − y = 4x = the larger, y = the smaller2x = 16Add the equationsx = 8, y = 4The numbers are 8 and 4

History: solving systems in ancient China

One of the oldest known general methods for solving systems of linear equations comes from China, in The Nine Chapters on the Mathematical Art (Jiuzhang suanshu), a handbook of 246 problems on surveying, trade, building and taxes. Historians date its parts to between about 200 BC and AD 50, and the mathematician Liu Hui wrote a famous commentary on it in AD 263.

Its eighth chapter, Fangcheng, often translated “calculation by square tables” or “rectangular arrays”, has 18 problems that come down to systems of linear equations. The numbers were set out in a table with counting rods, one column for each equation, and then columns were multiplied and subtracted from each other until the table was in a triangle shape. That is the same idea as elimination on this page, and as the method now called Gaussian elimination, which is used in computers today.

The same chapter gives rules for working with negative numbers, because subtracting columns can make negative entries.

Try one in the same style

Here is a two-grain problem written in the spirit of that chapter (it is our own, not a translation): 2 bundles of good grain and 1 bundle of ordinary grain give 11 measures; 1 bundle of good grain and 3 of ordinary grain give 13 measures. How much does each bundle give?

Show answer
2x + y = 11; x + 3y = 13x = good, y = ordinary−2x − 6y = −26Multiply the second by −2−5y = −15Addy = 3, x = 4A good bundle gives 4 measures and an ordinary one gives 3

Practice: Where Do They Cross?

A new system every time, with hints, full steps and a graph of both lines. Choose a level, or mix them all. Type a point like (3, −2) or x = 3, y = −2, or use the buttons for no solution and infinitely many.

Sources

  • J. J. O’Connor and E. F. Robertson, MacTutor History of Mathematics, University of St Andrews: Nine Chapters on the Mathematical Art (246 problems; chapter 8’s 18 problems on simultaneous linear equations solved with a table of coefficients in columns reduced to triangular form; negative numbers; dates between about 200 BC and AD 50; Liu Hui’s commentary of 263).
  • Common Core State Standards for Mathematics: Grade 8 Expressions and Equations (8.EE.C.8, systems of two linear equations), Reasoning with Equations and Inequalities (A-REI.C.5 and A-REI.C.6, solving systems exactly and by graphing) and Creating Equations (A-CED.A.3, systems as models), which this lesson supports.

Credits: all graphs on this page are original SVG drawings made for Jugami. Every system, solution and step was checked by a script against the equations it belongs to.