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.
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?
Your turn
Is (1, 4) a solution of x + y = 5 and 3x − y = 2?
Show answer
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.
- Write each equation in slope-intercept form, y = mx + b, if it isn’t already.
- Graph both lines on the same grid.
- Read the point where they cross.
- Check that point in both original equations.
Example: y = 2x − 3 and y = −x + 3
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.
Try the interactive version at jugami.com/algebra/systems-of-equations/
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.
- Solve one equation for one variable.
- Substitute that expression into the other equation. Now it has only one variable.
- Solve for that variable.
- Put the value back in to find the other variable, and check in both equations.
Example 1: y = 3x − 5 and 2x + y = 10
Example 2: x − 2y = 1 and 3x + 4y = 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.
- Line up the equations in the form Ax + By = C.
- If needed, multiply one or both equations so the coefficients of one variable are opposites, like 2y and −2y.
- Add the equations. That variable cancels.
- Solve for the other variable, put it back into either equation, and check.
Example 1: 3x + 2y = 16 and 5x − 2y = 0
Example 2: 2x + 3y = 12 and 5x − 4y = 7
| If the system looks like this | Try |
|---|---|
| One equation already says y = … or x = … | Substitution |
| A variable has coefficient 1 or −1 | Substitution |
| Opposite coefficients, like 4y and −4y | Elimination: just add |
| Both equations in Ax + By = C form | Elimination: multiply first |
| You want a picture, or an estimate | Graphing |
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.
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
Example: 2x + y = 4 and 4x + 2y = 8
| Slopes and y-intercepts | Lines | Solutions | Eliminating gives |
|---|---|---|---|
| different slopes | cross once | one | x = a number |
| same slope, different intercepts | parallel | none | 0 = 4 or similar |
| same slope, same intercept | same line | infinitely many | 0 = 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
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
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
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
Practice problems
Try each one on paper, then open the answer to check your work.
- Is (3, 1) a solution of 2x + y = 7 and x − y = 2?
Show answer
2(3) + 1 = 7True3 − 1 = 2TrueYesIt works in both - 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 - 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) - 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) - 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 - 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) - 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 - 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 - 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 ✓ - 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
Try the interactive version at jugami.com/algebra/systems-of-equations/
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.