Class 2 -- Manipulating algebraic expressions I. Commutative, Associative, and Distributive Properties A. Commutative property B. Associative property B. Distributive property II. Factoring and Quadratics A. Common Factors B. Multiplying Binomials C. Factoring When a = 1 D. Factoring When a != 1 E. Differences of Squares III. Fractions A. Cancelling B. Multiplying and Dividing C. Adding and Subtracting This week's class is devoted to manipulating the algebraic expressions we learned to construct last week. This will set us up to begin solving equations next week. The basic idea of manipulating algebraic expressions is that algebraic expressions describe a rule for doing a particular arithmetic operation or set of operations, and it is possible to express that rule in several equivalent ways. I. Commutative, Associative, and Distributive Properties A. Commutative property One of the most basic ways to rewrite algebraic expressions is to change the order of certain operations. Here's what that means. Supose the we have the rule that the cost of an item is the sticker price plus the tax: cost = s + t Thus if the sticker price were $100 and the tax were $5, we would have cost = 100 + 5 = 105. Clearly, however, we would have gotten exactly the same result if we put the numbers in the opposite order: cost = 5 + 100 = 105. This is true for any sticker price and any tax. Thus we can write the rule in two equivalent ways: cost = s + t = t + s The order in which we add the two numbers doesn't matter. This goes by the fancy name of the commutative property of arithmetic. It just means that it doesn't matter what order you add in. Multiplication is the same way. Suppose we have a rule that the tax is equal to the tax rate times the sticker price. Thus tax = r . s. Continuing our example, if the sticker price is $100 and the tax rate is 5% (or 0.05), we have tax = 0.05 . 100 = $5. However, we could equally well have multiplied in the opposite order: tax = 100 . 0.05 = $5. Thus we have the rule tax = r . s = s . r. Multiplication is commutative just like addition. To put this formally, any algebraic expression that involves the addition of two numbers or letters, or the multiplication of two numbers or letters, can be replaced by an equivalent one in which the order is switched: a + b = b + a for any a and b a . b = b . a for any a and b What about subtraction? Clearly 5 - 3 is not the same as 3 - 5, so subtraction is not commutative. However, we can think of it as commutative if we think of subtraction as adding a negative: 5 - 3 = 5 + (-3) = (-3) + 5 = 2 Thus we can also say that a - b = a + (-b) = -b + a for any a and b. B. Associative property Another closely-related rule we can use to find equivalent algebraic expressions involves the placement of parentheses. Since the order doesn't matter for addition or multiplication, and parentheses are just rules about order, we can move them around freely. Here's an example: suppose the rule we have is that a burrito shop's monthly income is the number of burritos it sells times the price per burrito: income = b p. One month it has a special where it sells the burritos for 20% off, and as a result it sells twice as many as usual. We can use our formula to figure out how much money the store makes compared to in a usual month: income = (2 b) (0.8 p) The b becomes 2b because the store sold twice as many burritos, but each one only made 80% as much as usual. These are all multliplicative operations, and since the order doesn't matter, we can move around the parentheses: income = (2b) (0.8p) = (2 . 0.8) (bp) = 1.6 bp. Thus we come up with a simpler expression, and see that the shop makes 1.6 times as much as it would in a normal month. The general rule here is that a(bc) = (ab)c for any a, b, and c Exactly the same argument applies to addition: a + (b + c) = (a + b) + c Here's one for practice: simplify (2x)(3y)(4x) C. Distributive property We started talking about this last week. To remind you: distributing terms. Distribution means breaking up an algebraic expression into simpler pieces. For example, suppose we had the expression 4 (x + y) The 4 gets multiplied by x and y, so we can simplify by writing out the multplication explicitly: 4 (x + y) = 4x + 4y This is called distributing the 4 over the x and y. Distribution works over any number of items (called terms) inside the parentheses: 4 (x + y + z) = 4x + 4y + 4z As with the commutative property, we can apply this with signs too, as long as we're careful. A minus sign is equivalent to multiplying by -1. Thus -(x + 1) = (-1) (x + y) = (-1)x + (-1)y = -x - y. Thus if a minus sign appears in front of a parentheses, it must be applied to every term inside the parentheses. Here's one for practice: what is -2 (a - 2b)? We can also distribute division using a similar trick: recall that dividing by a number is the same as multiplying by 1 over that number. For example, 8 / 2 is the same as (1/2) . 8. Thus we can write (x + y) / a = x/a + y/a for any x, y, and a Here's a practice example: what is (-x+y)/(-2)? II. Factoring The commutative, associative, and distributive properties are the basic rules for manipulating algebraic expressions. We can use them to construct more complex and powerful rules. Many of these fall under the heading of factoring. Factoring is a technique for taking an algebraic expression and rewriting it as an equivalent multiplication of simpler expressions. A. Common factors We have seen that the distributive property is a(b + c) = ab + ac. The simplest form of factoring is just to do this in reverse when we notice that two terms of a factor in common. Here's a simple example: in the expression 2x + 2y, both terms have a factor of 2. Thus we can rewrite this: 2x + 2y = 2(x + y). Here's a somewhat trickier one: 2x + xy = x (2 + y). The idea is the same, and it's just that this time the common factor was a letter instead of a number. As another example, consider (on board) 2x^4 + 4x^3 + 6x^2 We can notice that all of the monomials in this polynomial contain an x. We call x a common factor. Thus we can re-write this as (on board) 2x^4 + 4x^3 + 6x^2 = x (2x^3 + 4x^2 + 6x) Just by looking at this expression, it is appearant that if I were to multiply out the right-hand side I would get back to the original expression. The idea here is to find a factor that all the terms have in common, and pull it out front. In the expression we have now, we could in fact factor it further. Can anyone suggest something else that these terms have in common? (let class answer) (on board) 2x^4 + 4x^3 + 6x^2 = x (2x^3 + 4x^2 + 6x) = (x)(x) (2x^2 + 4x + 6) = x^2 (2x^2 + 4x + 6) We can pull out another factor of x. If we'd seen this originally, we could just have pulled out a factor of x^2. In fact, there's one more common factor we can pull out. Can anyone see it? (let class answer) (on board) 2x^4 + 4x^3 + 6x^2 = x (2x^3 + 4x^2 + 6x) = (x)(x) (2x^2 + 4x + 6) = x^2 (2x^2 + 4x + 6) = (x^2) (2) (x^2 + 2x + 3) = 2x^2 (x^2 + 2x + 3) Once we've pull out the full 2x^2, there's no way to pull out more common terms. There is no number or variable expression that goes into each monomial term we have left. B. Multiplying binomials We can generalize the distributive property to products that are slightly more complex. Consider (x - 4)(y + 6) We can rewrite this as follows: (x - 4)(y + 6) = x(y + 6) - 4(y + 6) = xy + 6x - 4y - 24 At each step we simply used the properties we've already derived. This leads to a general rule for multiplying things like this (a + b)(c + d) = ac + ad + bc + bd The easy way to remember this is FOIL. FOIL stands for FOIL = first, outside, inside, last We got 4 terms when we multiplied the two binomials. The first one is xy, which is just the product of the first terms of each binomial. So first means multiply the first two terms, in this case x and y. Next we have 6x, which is just the product of the two outside terms, x and 6. After that, we have -4y, which is the product of the inside two terms, -4 and y. Finally, we have -24, which is the product of the two last terms, -4 and 6. So FOIL means that to multiply two binomials, multiply first, then outside, then inside, then last, and add them all together. It's just a useful mnemonic. Practice: multiply (2x - 1)(3x + 6) C. Factoring When a = 1 Expressions that look like the one we just got, ax^2 + bx + c, where a, b, and c are numbers, are called quadratics. We often get expressions of this sort from FOILing. It is often quite useful to be able to go backwards and figure out what two things we had to FOIL together to make a given quadratic. This is called factoring the quadratic. Let's consider an example. In this case, we'll start with the binomials, then get the quadratic, then try to see how to go backwards. (on board) (x + 3)(x - 2) Let's multiply these using FOIL. Someone tell me how to do that. (let class walk through it) (on board) (x + 3)(x - 2) = x^2 - 2x + 3x - 6= x^2 + x - 6 So, suppose we were presented with x^2 + x - 6 and asked to factor it. How would we do that? We know it's going to be something of the form (on board) (_x + _) (_x + _) The challenge is to figure out what numbers to fill into the blanks. The first thing to notice is the first part of foil. The quadratic we have starts with 1x^2, not 2x^3, or 3x^2, or something like that. Thus, we know that the coefficients in front of the x's in our fill-in problem have to give us 1. Since we're dealing with all integers here, and we want to keep it that way, this means there's only one possibility: the fill-in slots in front of x are both 1's. This gives (on board) (x + _) (x + _) Now we need to fill in the last two slots. Now we can look at the "last" part of foil. The last terms have to multiply to give -6, so we need to try pairs of numbers that, when multiplied, give -6. There's no way to do this other than by trial and error. So let's make a list of integers we can multiply to get -6. Someone tell me some. (let class make list) (on board) Possibilities for -6: 1,-6 -1,6 -2,3 2,-3 Note that we have to consider all possible permutations of where the - sign could be. Now we just have to try these possibilities one by one until one of them works. Let's do that: (on board) (x + 1)(x - 6) = x^2 - 6x + x - 6 = x^2 - 5x - 6 -- doesn't work (x - 1)(x + 6) = x^2 + 6x - x - 6 = x^2 + 5x - 6 -- doesn't work (x - 2)(x + 3) = x^2 + 3x - 2x - 6 = x^2 + x - 6 -- this work Once we find the right pair, we're done. We've factored the quadratic: x^2 + x - 6 = (x - 2)(x + 3) Let's try another example, this time without knowing the answer in advance. (on board) Factor x^2 - 8x + 16. How do we do this? (let class walk through it) (on board) (x + _)(x + _) (on board) Possibilities for 16: 1, 16 -1, -16 2, 8 -2, -8 4, 4 -4, -4 (on board) Trying each: (x + 1)(x + 16) = x^2 + 17x + 16 -- doesn't work (x - 1)(x - 16) = x^2 - 17x + 16 -- doesn't work (x + 2)(x + 8) = x^2 + 10x + 16 -- doesn't work (x - 2)(x - 8) = x^2 - 10x + 16 -- doesn't work (x + 4)(x + 4) = x^2 + 8x + 16 -- doesn't work (x - 4)(x - 4) = x^2 - 8x + 16 -- this works (on board) x^2 - 8x + 16 = (x - 4)(x - 4) D. Factoring When a != 1 Things are only slightly more complicated when the thing in front of the x^2 isn't a 1. Let's consider: (on board) Factor 2x^2 + 11x + 12 We can go back to our template for what the answer has to look like: (on board) (_x + _)(_x + _) Looking at the first term, we notice that we have 2x^2, so we're going to have to multiply two things to get 2. We can make a possibilities list here: (on board) Possibilities for 2: 1,2 -1,-2 We make the same list for 12: (on board_) Possibilities for 12: 1,12 -1,-12 2,6 -2,-6 3,4 -3,-4 To check these systematically, unfortunately, we need to consider every possible was of combining the pairs for 2 and for 12. For the pairs (1,2) and (1,12), note that there are two possible ways of combining them. (on board) (1x + 1)(2x + 12) (2x + 1)(x + 12) For the pairs (1,2) and (2,6) we have: (on board) (1x + 2)(2x + 6) (2x + 2)(x + 6) We need to check each possible combination, and two orders for each combination. As you can see, this quickly becomes extremely long. There is a way of shortcutting this process, which we'll learn next week. However, for now there's nothing to do but try to use some intuition to see which pair can work. It helps to be able to do the multiplications in your head, since that's quicker than writing them down. Does anyone have a guess for the combination they'd like to try here? (let class answer) The on that works turns out to be: (on board) (2x + 3)(x + 4) = 2x^2 + 8x + 3x + 12 = 2x^2 + 11x + 12 Really the only way to be able to do these quickly is to practice a lot of them. However, I can point out some tips that may help shorten your search. These are rules of thumb to keep in mind. (on board) 1. If all the numbers in the quadratic are positive, don't bother checking negative possibilities. 2. You get larger numbers in the middle by taking possibilities for first and last that are far apart, and smaller numbers in the middle by taking first and last possibilities that are close to each other. E. Differences of Squares Before we move on, I'd like to point out one special case of factoring ax^2 + bx + c: the case when b, the coefficient of the x term, is zero. Consider (on board) x^2 - 9 How can we factor this, using our standard procedure? (let class answer) (on board) Possibilities for -9: 1,-9 -1,9 -3,3 Using our trick, we note that we're looking for a pair of numbers that add up to the coefficient of x -- which is zero in this case. Looking at this list, we can see that the answer has to be -3, 3, since only they add up to 0. Thus, the answer is (on board) (x-3)(x+3) We can see a pattern that's going to be true whenever we have a difference of squares, something like (on board) x^2 - a^2 The answer is just going to be: (on board) (x - a)(x + a) Thus, for example, what is the factorization of (on board) x^2 - 64 (let class answer) (on board) (x - 8)(x + 8) III. Fractions Let's end by discussing another type of algebraic expression: algebraic fractions. These are just things where there is one algebraic expression divided by another, for example (6x + 3) / (2x + 1). Things that look like this are also called rational expressions. A. Cancelling Factoring gives us a tool for simplifying rational expressions. Just like we can simplify fractions by getting rid of common factors, we can simplify rational expressions. Example: 4/8 = (4 . 1) / (4 . 2) = 1/2 Similarly, consider (x^2 + 5x + 6) / (2x^2 + 5x + 2) To simplify this, we factor both the numerator and the denominator: x^2 + 5x + 6 = (x+2)(x+3) 2x^2 + 5x + 2 = (2x+1)(x+2) Therefore (x^2 + 5x + 6) / (2x^2 + 5x + 2) = [(x+2)(x+3)] / [(2x+1)(x+2)] We can cancel out the common factor, which gives (x^2 + 5x + 6) / (2x^2 + 5x + 2) = [(x+2)(x+3)] / [(2x+1)(x+2)] = (x+3) / (2x+1) Let's try one more example like this: Simplify: (x^3 - 8) / (x^2 - 7x + 10) Again, we have to factor: x^3 - 8 = (x-2)(x^2 + 2x + 4) x^2 - 7x + 10 = (x-2)(x-5) So: (x^3 - 8) / (x^2 - 7x + 10) = [(x-2)(x^2 + 2x + 4)] / [(x-2)(x-4)] = (x^2 + 2x + 4) / (x-4) B. Multiplying and Dividing Now that we know how to simplify, we are ready to multiply and divide rational expressions. Again, this process is exactly the same as it is for fractions. To multiply, you just multiply the tops and the bottoms. Usually it is easiest if you factor the tops and the bottoms first, because that way you can cancel out common factors before multiplying rather than after. That will save you work. Example: [(9 - n) / (n^3 - 64)] . [(n^2 + 5n - 36) / (n^2 - 81)] Step 1: Factor everything, and rewrite in factored form. 9 - n is already factored n^3 - 64 = (n - 4)(n^2 + 4n + 16) n^2 + 5n - 36 = (n + 9)(n - 4) n^2 - 81 = (n - 9)(n + 9) So the problem becomes: {(9 - n) / [(n-4)(n^2+4n+16)]} . {[(n+9)(n-4)] / [(n-9)(n+9)]} Step 2: Cancel out common factors. For this problem, n-4 and n+9 are obviously common factors. It's a little less obvious that the 9-n and n-9 are common factors as well. That's because 9-n = -1(n-9), so (9-n)/(n-9) = -(n-9)/(n-9) = -1 Thus, after cancelling all the common factors, we get [-1/(n^2+4n+16)] . [1/1] Everything in the second term cancelled out, and we were just left with 1/1! Step 3: Multiply what's left. In this case there's no work left to do, so we have the answer: -1 / (n^2+4n+16) Note that, there is no step 4, write things in lowest terms, because if we factored first and cancelled out everything we could, there is no reduction left to be done. Division works the same way as for fractions: just flip the second term, then multiply. Example: [(3a^2 - 13ab + 4b^2) / (3a^3b - 4a^2 b^2 + ab^3)] / [(7b^2 - 6ab - a^2) / (21 a^3b^2 + 3a^4 b)] Turning this into a multiplication: [(3a^2 - 13ab + 4b^2) / (3a^3b - 4a^2 b^2 + ab^3)] / [(21 a^3b^2 + 3a^4 b) / (7b^2 - 6ab - a^2)] Now we do what we'd do for any other multiplication. Factor first: 3a^2 - 13ab + 4b^2 = (3a - b)(a - 4b) 3a^3b - 4a^2 b^2 + ab^3 = ab (3a^2 - 4ab + b^2) = ab (3a - b) (a - b) 21 a^3b^2 + 3a^4 b = 3a^3b (7b + a) 7b^2 - 6ab - a^2 = (7b + a)(b - a) Write the multiplication in factored form: {[(3a - b)(a - 4b)] / [ab (3a - b) (a - b)]} . {[3a^3 b (7b + a)] / [(7b + a)(b - a)]} Cancel where possible: [(a - 4b) / (a - b)] . [3a^2 / (b - a)] Then just combine the results to get the final answer 3a^2 (a - 4b) / [ (a-b)(b-a) ] That's it. C. Adding and Subtracting Addition and subtraction of rational expressions is also closely analagous to addition and subtraction of fractions. One has to find a common denominator by factoring before adding or subtracting. Here's a basic example: 4r/(r^2 - 6r + 9) + r/(r^2 - 11r + 24) Step 1: Factor everything. In this problem the numerators are already factored, so we just have to factor the denominators: r^2 - 6r + 9 = (r - 3)(r - 3) r^2 - 11r + 24 = (r - 3)(r - 8) Step 2: Rewrite in factored form. 4r / [(r-3)(r+3)] + 2r / [(r-3)(r-8)] Step 3: Find the least common denominator. The least common denominator is found by just taking the smallest combination of factors that contains all the factor in the denominator of every term. In our example, one denominator is (r-3)(r+3), and the other is (r-3)(r-8). The least common denominator is therefore (r-3)(r+3)(r-8). It contains every factor in either denominator. Step 4: Multiply top and bottom of both terms to convert to common denominator. {4r / [(r-3)(r+3)]}.{(r-8)/(r-8)} + {2r / [(r-3)(r-8)]}.{(r+3)/(r+3)} = [4r^2-32r] / [(r-3)(r+3)(r-8)] + [2r^2+6r] / [(r-3)(r+3)(r-8)] Step 5: Add or subtract the numerators. 6r^2 + 26r / [(r-3)(r+3)(r-8)] Step 6: Factor the numerator and reduce if possible 3r(r+13) / [(r-3)(r+3)(r-8)] In this case no reduction is possible, so we're done. Let's try another example: (1 - 2n) / (n^2 + 6n + 9) - (1 - 5n) / (n^2 - 3n - 18) Step 1: Factor n^2 + 6n + 9 = (n+3)(n+3) n^2 - 3n - 18 = (n+3)(n-6) Step 2: Rewrite in factored form (1-2n) / [(n+3)(n+3)] - (1-5n) / [(n+3)(n-6)] Step 3: Find LCD In this case the LCD is (n+3)(n+3)(n-6). Note that since (n+3) appears twice in one of the denominators, it must appear twice in the LCD. Step 4: Multiply to put in terms of LCD. {(1-2n) / [(n+3)(n+3)]} . {(n-8)/(n-8)} - {(1-5n) / [(n+3)(n-6)]} . {(n+3)/(n+3)} = (-2n^2 + 17n - 8) / [(n+3)(n+3)(n-8)] - (-5n^2 - 14n + 3) / [(n+3)(n+3)(n-8)] Step 5: Subtract. = (3n^2 + 31n - 11) / [(n+3)(n+3)(n-8)] The numerator can't be factored, so we're done.