Solving a System of Equations with Substitution
Now that we have the system set up, we can actually begin to solve it. We're going to go over 2 ways of solving a system of equations, the first of which is called substitution. It is called this because we're going to take one expression from one equation and substitute it in for one of the variables in our second equation.
For example, we can take the equation that says C + P = 7, telling us the total number of pizzas we're getting, and we can solve this equation for P by undoing C from both sides with subtraction. We find an equivalent equation that says that P = 7 - C.
Now that I know what P equals, and since I want these two equations to be the same, I can substitute into the second equation what I now know what P is. So instead of writing 8C + 11P = $68, I can write 8C + 11(7 - C) = $68. Now I only have one variable in one equation, which is solvable for that variable.
I can use inverse operations to get the C by itself. First, you distribute the 11 to both terms: 8C + 77 - 11C = $68. Then, you can combine like terms, grouping the Cs together because they're on the same side of the equals sign: -3C + 77 = $68. Next, you undo an addition of 77 with a subtraction of 77: -3C = -9. Last but not least, you undo a multiplication of -3 with a division of -3 to both sides. You find that C, the number of cheese pizzas we're going to get, is 3: C = 3.
Now that I know the number of cheese pizzas, it's a pretty easy process to just take that and substitute back into the first equation: P = 7 - C. I now know that C is 3, which means that P = 7 - 3. This means that P is 4. I now know how many pepperoni pizzas we should buy.
Solving a System of Equations with Elimination
So that's the substitution method to solving a system of equations. But there's another method called the elimination method, which is really nice to use when both of my equations are in standard form. This means that both of my equations have the C's and the P's on the same side.
The elimination method requires us to add the two equations together in order to eliminate one of the variables. Right now, if I add these two equations together, none of my variables are going to eliminate. I'm going to end up with 9C and 12P and that doesn't really get me anywhere.
But if I first multiply the top equation by -8, and I have to distribute it into everything, it changes that equation into: -8C - 8P = -56. If I leave the bottom equation the same and now add the two equations, my C's cancel. What I've done is that I've made the coefficients (which is a fancy word for the numbers in front of the variables) on my C variable opposites.
The 8 and the -8 cancel. I just get 0C. On the P's, I get -8P plus 11 P which is 3P. On the other side of the equals sign, I get -56 plus 68, which is 12: 0C + 3P = 12.
Now I have one equation with one variable. I can solve pretty quickly by undoing times 3 by dividing by 3, and we find that P = 4. The number of pepperoni pizzas is 4. Again, the same answer.
Once we have one answer, we do the same step as we did in the substitution method. We take our one answer and we substitute it back into one of the original equations. We now know that P = 4, so I know that C + 4 = 7. I undo adding 4 by subtracting 4 and I find that C = 3. We need 3 cheese pizzas.