Solve Systems of Algebraic Equations Containing Two Variables

In a "system of equations," you are asked to solve two or more equations at the same time. When these have two different variables in them, such as x and y, or a and b, it can be tricky at first glance to see how to solve them. Fortunately, once you know what to do, all you need is basic algebra skills (and sometimes some knowledge of fractions) to solve the problem. If you are a visual learner or if your teacher requires it, learn how to graph the equations as well. Graphing can be useful to "see what's going on" or to check your work, but it can be slower than the other methods, and doesn't work well for all systems of equations.

Steps

Using the Substitution Method

  1. Move the variables to different sides of the equation. This "substitution" method starts out by "solving for x" (or any other variable) in one of the equations. For example, let's say your equations are 4x + 2y = 8 and 5x + 3y = 9. Start by looking just at the first equation. Rearrange it by subtracting 2y from each side, to get: 4x = 8 - 2y.
    • This method often uses fractions later on. You can try the elimination method below instead if you don't like fractions.
  2. Divide both sides of the equation to "solve for x." Once you have the x term (or whichever variable you are using) on one side of the equation, divide both sides of the equation to get the variable alone. For example:
    • 4x = 8 - 2y
    • (4x)/4 = (8/4) - (2y/4)
    • x = 2 - ½y
  3. Plug this back into the other equation. Make sure you go back to the other equation, not the one you've already used. In that equation, replace the variable you solved for so only one variable is left. For example:
    • You know that x = 2 - ½y.
    • Your second equation, that you haven't yet altered, is 5x + 3y = 9.
    • In the second equation, replace x with "2 - ½y": 5(2 - ½y) + 3y = 9.
  4. Solve for the remaining variable. You know have an equation with only one variable. Use ordinary algebra techniques to solve for that variable. If your variables cancel out, skip ahead to the last step. Otherwise, you'll end up with an answer for one of your variables:
    • 5(2 - ½y) + 3y = 9
    • 10 – (5/2)y + 3y = 9
    • 10 – (5/2)y + (6/2)y = 9 (If you don't understand this step, learn Add-Fractions. This is often, but not always, necessary for this method.)
    • 10 + ½y = 9
    • ½y = -1
    • y = -2
  5. Use the answer to solve for the other variable. Don't make the mistake of leaving the problem half-finished. You'll need to plug the answer you got back into one of the original equations, so you can solve for the other variable:
    • You know that y = -2
    • One of the original equations is 4x + 2y = 8. (You can use either equation for this step.)
    • Plug in -2 instead of y: 4x + 2(-2) = 8.
    • 4x - 4 = 8
    • 4x = 12
    • x = 3
  6. Know what to do when both variables cancel out. When you plug x=3y+2 or a similar answer into the other equation, you're trying to get an equation with only one variable. Sometimes, you end up with an equation with no variables instead. Double check your work, and make sure you are plugging the (rearranged) equation one into equation two, not just back into equation one again. If you're confident you didn't make any mistakes, you have one of the following results:[1]
    • If you end up with an equation that has no variables and isn't true (for instance, 3 = 5), the problem has no solution. (If you graphed both of the equations, you'd see they were parallel and never intersect.)
    • If you end up with an equation without variables that is true (such as 3 = 3), the problem has infinite solutions. The two equations are exactly equal to each other. (If you graphed the two equations, you'd see they were the same line.)

Using the Elimination Method

  1. Find the variable that cancels out. Sometimes, the equations will already "cancel out" a variable once you add them together. For instance, when you combine the equations 3x + 2y = 11 and 5x - 2y = 13, the "+2y" and "-2y" will cancel each other, removing all the "y"s from the equation. Look at the equations in your problem and figure out if one of the variables will cancel out like this. If neither of them will, read the next step for advice.
  2. Multiply one equation so a variable will cancel out. (Skip this step if the variables already cancel out.) If the equations don't have a variable that cancels out naturally, change one of the equations so they will. This is easiest to follow with an example:
    • You have the system of equations 3x - y = 3 and -x + 2y = 4.
    • Let's change the first equation so that the y variable will cancel out. (You can choose x instead, and you'll get the same answer in the end.)
    • The - y on the first equation needs to cancel with the + 2y in the second equation. We can make this happen by multiplying - y by 2.
    • Multiply both sides of the first equation by 2, like this: 2(3x - y)=2(3), so 6x - 2y = 6. Now the - 2y will cancel out with the +2y in the second equation.
  3. Combine the two equations. To combine two equations, add the left sides together, and add the right sides together. If you set your equation up right, one of the variables should cancel. Here's an example using the same equations as the last step:
    • Your equations are 6x - 2y = 6 and -x + 2y = 4.
    • Combine the left sides: 6x - 2y - x + 2y = ?
    • Combine the right sides: 6x - 2y - x + 2y = 6 + 4.
  4. Solve for the last variable. Simplify the combined equation, then use basic algebra to solve for the last variable. 'If there are no variables after simplifying, skip down to the last step in this section instead. Otherwise, you should end up with a simple answer to one of your variables. For example:
    • You have 6x - 2y - x + 2y = 6 + 4.
    • Group the x and y variables together: 6x - x - 2y + 2y = 6 + 4.
    • Simplify: 5x = 10
    • Solve for x: (5x)/5 = 10/5, so x = 2.
  5. Solve for the other variable. You've found one variable, but you're not quite done yet. Plug your answer in to one of the original equations so you can solve for the other variable. For example:
    • You know that x = 2, and one of your original equations is 3x - y = 3.
    • Plug in 2 instead of x: 3(2) - y = 3.
    • Solve for y in the equation: 6 - y = 3
    • 6 - y + y = 3 + y, so 6 = 3 + y
    • 3 = y
  6. Know what to do when both variables cancel out. Sometimes, combining the two equations results in an equation that makes no sense, or at least that doesn't help you solve the problem. Double check your work from the beginning, but if you didn't make a mistake, write down one of the following as your answer:[1]
    • If your combined equation has no variables and is not true (like 2 = 7), there is no solution that will work on both equations. (If you graph both equations, you'll see they're parallel and never cross.)
    • If your combined equation has no variables and is true (like 0 = 0), there are infinite solutions. The two equations are actually identical. (If you graph them, you'll see that they're the same line.)

Graphing the Equations

  1. Only use this method when told to do so. Unless you are using a computer or graphing calculator, many systems of equations can only be approximately solved using this method.[2] Your teacher or math textbook may require you to use this method so you are familiar with graphing equations as lines. You can also use this method to double-check your answers from one of the other methods.
    • The basic idea is to graph both equations, and find the point where they intersect. The x and y values at this point will give us the value of x and the value of y in the system of equations.
  2. Solve both equations for y. Keeping the two equations separate, use algebra to turn each equation into the form "y = __x + __".[3] For example:
    • Your first equation is 2x + y = 5. Change this to y = -2x + 5.
    • Your second equation is -3x + 6y = 0. Change this to 6y = 3x + 0, then simplify to y = ½x + 0.
    • If both equations are identical, the entire line will be an "intersection". Write infinite solutions.
  3. Draw coordinate axes. On a piece of graph paper, draw a vertical "y axis" and a horizontal "x axis." Starting at the point where they intersect, label the numbers 1, 2, 3, 4, etc. moving up on the y-axis, and again going right on the x-axis. Label the numbers -1, -2, etc. moving down on the y-axis and left on the x-axis.
    • If you don't have graph paper, use a ruler to make sure the numbers are spaced precisely apart.
    • If you are using large numbers or decimals, you may need to scale your graph differently. (For example, 10, 20, 30 or 0.1, 0.2, 0.3 instead of 1, 2, 3).
  4. Draw the y-intercept for each line. Once you have an equation in the form y = __x + __, you can start graphing it by drawing a dot where the line intercepts the y-axis. This is always going to be at a y-value equal to the last number in this equation.
    • In our examples from earlier, one line (y = -2x + 5) intercepts the y-axis at 5. The other (y = ½x + 0) intercepts at 0. (These are points (0,5) and (0,0) on the graph.)
    • Use different colored pens or pencils if possible for the two lines.
  5. Use the slope to continue the lines. In the form y = __x + __, the number in front of the x is the slope of the line. Each time x increases by one, the y-value will increase by the amount of the slope. Use this information to plot the point on the graph for each line when x = 1. (Alternatively, plug in x = 1 for each equation and solve for y.)
    • In our example, the line y = -2x + 5 has a slope of -2. At x = 1, the line moves down 2 from the point at x = 0. Draw the line segment between (0,5) and (1,3).
    • The line y = ½x + 0 has a slope of ½. At x = 1, the line moves up ½ from the point at x=0. Draw the line segment between (0,0) and (1,½).
    • If the lines have the same slope, the lines will never intersect, so there is no answer to the system of equations. Write no solution.
  6. Continue plotting the lines until they intersect. Stop and look at your graph. If the lines have already crossed, skip ahead to the next step. Otherwise, make a decision based on what the lines are doing:
    • If the lines are moving toward each other, keep plotting points in that direction.
    • If the lines are moving away from each other, move back and plot points in the other direction, starting at x = -1.
    • If the lines are nowhere near each other, try jumping ahead and plotting more distant points, such as at x = 10.
  7. Find the answer at the intersection. Once the two lines intersect, the x and y values at that point are the answer to your problem. If you're lucky, the answer will be a whole number. For instance, in our examples, the two lines intersect at (2,1) so your answer is x = 2 and y = 1. In some systems of equations, the lines will intersect at a value between two whole numbers, and unless your graph is extremely precise it will be difficult to tell where this is. If this happens, you can write an answer such as "x is between 1 and 2", or use the substitution or elimination method to find the precise answer.

Tips

  • You can check your work by plugging the answers back into the original equations. If the equations end up true (for instance, 3 = 3), your answer is correct.
  • In the elimination method, you will sometimes have to multiply one equation by a negative number in order to get a variable to cancel out.

Warnings

  • These methods cannot be used if there is a variable raised to an exponent, such as x2. For more information on equations of this type, look up a guide to factoring quadratics with two variables.[4]

Sources and Citations