# Systems of Linear Equations

# Solving Systems of Linear Equations by Substitution

To solve linear systems by substitution, we solve one equation for one variable and then use that information to solve the other equation for the other variable. It's exactly the same as when a basketball team makes a substitution, except with less basketball and more math.

Let's do a couple of examples and see what happens.

### Sample Problem

Solve the system

The first thing we need to do has already been done: the first equation has been solved for *y*. Don't you love it when someone's already come by and done the work for you? Shmoop Algebra: we're a river to our people.

We know that

*y* = 6*x* -4,

so we can substitute (6*x* – 4) for *y* in the second equation:

Now we can solve the new equation for *x*. If

6*x* -4 = 3*x* + 5,

then by subtracting 3*x* from each side and adding 4 to each side we get 3*x* = 9, so *x* = 3.

Since a solution to a system of linear equations is a **point**, we need to know what *y* is. Until we know *y*, all we have is half a point, and it's difficult to win an argument with one of those.

To find *y*, we take our value for *x*, stick it into either equation we like, and solve for *y*. If *x* = 3 and *y* = 6*x* – 4, then

We think the point (3, 14) is the answer. To confirm this, we need to make sure this point satisfies both of the original equations. If it fails either test, we can toss it out with yesterday's garbage. Hope it likes day-old sushi.

Is the point (3, 14) on the line *y* = 6*x* – 4?

When *x* = 3 and *y* = 14, the right-hand side of this equation is

6(3) – 4 = 18 – 4,

which agrees with the left-hand side of the equation. The point (3, 14) is on the first line.

Is the point (3, 14) on the line *y* = 3*x* + 5?

When *x* = 3 and *y* = 14, the right-hand side of this equation is

3(3) + 5 = 14

which agrees with the left-hand side of the equation. The point (3, 14) is on the second line.

Since the point (3, 14) is indeed on both lines, it's the solution to the system of equations and the answer to all our dreams. Well, except for that one dream where our hands are giant meatballs. We still don't have an answer for that one.

## A Summary, So Far

We've now used substitution to successfully find the point of intersection for two lines that intersect exactly once. Let's tidy things up a bit and figure out the general steps we need to take for this sort of problem. Once we're done, we should also tidy up the living room. It's great that you wanted to build a fort out of the couch cushions, but people have to live here.

- Solve one equation for one variable.

- In the "other" equation, perform substitution to get rid of the variable we solved for in (1).

- After substituting, solve the "other" equation.

- Find the value of the variable we solved for in step (1).

- Check that the answer works in
*both*original equations.

### Sample Problem

Solve the system of equations

1. Solve one equation for one variable.

The first equation has *x* all by itself (with a coefficient of 1), so it's easiest to solve that equation for *x*. We find that

*x* = 7 – 4*y*.

2. In the "other" equation, perform substitution to get rid of the variable we solved for in (1).

The "other" equation is 2*y* -3*x* = 8.

Performing substitution gives us 2*y* – 3(7 – 4*y*) = 8.

3. After substituting, solve the "other" equation.

We need to solve 2*y* -3(7 – 4*y* ) = 8.

We simplify to find 2*y* – 21 + 12*y* = 8.

Simplify a bit more to get

14*y* = 29,

and we can conclude that

*.*

Ugh, we're left with a fraction. However, it's the best we can do in this instance. Let's try to overlook our dislike of fractions, though, and make the most of a bad situation. Where are you from, fraction? Oh, really? Well did you...okay, we can't do this. We tried.

4. Find the value of the variable we solved for in step (1).

We know that *x* = 7 – 4*y*, so when we find

Another fraction. A negative one this time. Oh joy.

5. Check that the answer works in *both* original equations.

We think the answer is .

Oy, we almost hope we're wrong. Do these values work in the equation *x* + 4*y* = 7?

When and , the left-hand side of the equation is

which is indeed 7.

Do these values work in the equation 2*y* -3*x* = 8?

Let's see if 2*y* – 3*x* really does equal 8 for these bizarro values of *x* and *y*.

How about that, it actually worked! There may be a place for fractions in the universe after all.

We were right. The answer is .

So far, each of the systems we've solved using substitution has had exactly one answer, but a system of equations could have no solutions *or* infinitely many solutions. How's that for a wide range of options? Just somewhere between "none" and "infinity, " that's all.

Seems like a good time to introduce substitution.

### Sample Problem

Solve the system

Let's do substitution. All the cool kids are doing it.

1. Solve one equation for one variable.

The first equation is already solved for *y*, which makes our lives better.

2. In the "other" equation, perform substitution to get rid of the variable we solved for in (1).

We substitute for *y* in the equation 2*y*-*x* = 8 to get

3. After substituting, solve the "other" equation.

To solve ,

first we simplify to find *x* + 2 – *x* = 8.

Then we run into trouble. Even if "Trouble" is your middle name, you're not going to like what comes next. When we combine the *x* terms, we're left with the statement 2 = 8.

Uh-oh. We know 2 doesn't equal 8, or else the Raptors got royally ripped off by the official scorers at last night's game.

What does this incorrect equation tell us? There is no solution to the system. For these lines to intersect, 2 must equal 8, which is ridiculous. Our calculator agrees.

Whenever substitution leads us to such a ridiculous and impossible statement, it means the system of equations has no solution, which leads us to an important life lesson: being ridiculous and impossible never solves anything.

On the other hand, if substitution leads us to a statement that's always true, such as 1 = 1, it means that the lines are actually the same, and every point on either line is a solution. Everyone is happy, and order is restored. Now the only thing that's ridiculous is how much we're enjoying solving substitution problems.

If one or both of the equations in a system contains fractions, we get rid of the fractions and then proceed as usual. We know you like this news. It's actually a little scary how much you enjoy getting rid of fractions; we only hope it doesn't give way to more destructive behavior, such as torturing polynomials.

### Sample Problem

Solve the system of equations

Since each equation has fractions, we'll get rid of the fractions first. Multiply both sides of the first equation by 2 to find

6*y* = *x* + 2,

and multiply both sides of the second equation by 4 for

8*x* -*y* = 4.

Now, instead of solving the original system of equations, we can solve the system of equations

We know how to do this: we merely follow the same steps we've been following. They have to lead somewhere.

1. Solve one equation for one variable.

Since *x* has a coefficient of 1 in the first equation, we'll solve the first equation for *x*, to get

*x* = 6*y* – 2.

2. In the "other" equation, perform substitution to get rid of the variable we solved for in (1).

We replace the *x* in the second equation:

3. After substituting, solve the "other" equation.

We need to solve the equation 8(6*y* – 2) – *y* = 4.

Simplify to find 48*y* –16 – *y* = 4,

and rearrange to get *.*

4. Find the value of the variable we solved for in step (1).

Since we found that *x* = 6*y* – 2 when , we get

We're not thrilled about these fractions, but we also weren't thrilled after seeing the previews for Adam Sandler's *Jack and Jill*, and look how great that turned out! ("Jack and what?" you say? Exactly.)

5. Check that the answer works in *both* original equations.

We think the answer is .

Let's make sure these values work in the original equations—you know, the ones with the fractions in them. First, let's check that we have a solution to the equation

.

When we substitute in the values we found for *x* and *y*, the left-hand side of this equation is

.

The right-hand side of the equation is

Since the left-hand and right-hand sides of the equation agree, we have a solution. It gives us even more confidence in our solution to know that four out of five dentists also agree.

Second, let's check the equation .

When we substitute in the values we found for *x* and *y*, the left-hand side of this equation is

which agrees with the right-hand side of the equation. Houston, we also have a solution to the second equation.

We can safely say that the solution to the system of equations is

.

When solving systems of equations that have fractions in them, it's best to check the answers in the original equations. Although it's tempting to check the answers in the *nicer* equations, what if we made a mistake when getting rid of the fractions? Almost inconceivable, we know, yet possible. Then we'd be finding the right solutions for the wrong equations, which wouldn't help us any more than if we were to be in the right place at the wrong time. For example, at the Kodak Theatre four months before the Oscars, or in Central Park at 4 a.m.