Substitution and evaluating expressions
Now, let's think about expressions with more than one variable. So say I had the expression a plus-- I'll do a really simple one, a plus b. And I want to evaluate this expression when a is equal to 7 and b is equal to 2. And I encourage you to pause this and try this on your own. Well, wherever we see the a, we would just replace it with the 7. And wherever we see the b, we'd replace it with the 2. So when a equals 7 and b equals 2, this expression will be 7 plus 2, which, of course, is equal to 9. So this expression would be equal to 9 in this circumstance. Let's do a slightly more complicated one. Let's say we have the expression x times y minus y plus x. Actually, let's make it plus 3x. Or another way of saying it plus 3 times x. So let's evaluate this when x is equal to 3 and y is equal to 2. And once again, I encourage you to pause this video and try this on your own. Well, everywhere we see an x, let's replace it with a 3. Every place we see a y, let's replace it with a 2. So this is going to be equal to 3 times y. And y is 2 in this case. 3 times 2 minus 2 plus this 3 times x. But x is also now equal to 3. So what is this going to be equal to? Well, this is going to be equal to 3 times 2 is 6. This 3 times 3 is 9. So it simplifies to 6 minus 2, which is 4, plus 9, which is equal to 13. So in this case, it is equal to 13.