Combining functions: algebraic metods Functions can be added, subtracted, multiplied, divided, and raised to a power, just like numbers or algebra expressions. If f(x) = x 2 and g(x) = x + 2, clearly f(x) + g(x) = x 2 + x + 2. Anoter way to say te same ting: If f(x) = x 2 and g(x) = x + 2, let = f + g be te sum of te functions f and g. Ten we define te sum function f + g and write (f + g)(x) = f(x) + g(x) = x 2 + x + 2. A problem arises if f and g ave different domains. In tat case, te domain of te sum function f + g consists of all points tat are in te domains of bot f and g. Example 1: Let f(x) = x and g(x) = 1 x. Let (x) = f(x) + g(x). Find te formula for (x) and find te domain of (x). Solution: Te domain of f is all x wit x 0 wile te domain of g is x 0. If we want to add f(x) and g(x), tese must bot be defined, and so we need x 0 and x 0. Tese are bot satisfied precisely wen x > 0. Tus te sum function is defined by (x) = (f + g)(x) = x + 1 x wit domain (0, ). A similar discussion olds for multiplying, dividing, and subtracting functions. Note tat te domain of te quotient function f/g consists of numbers x tat are in te domains of bot f and g and provided g(x) 0. M19500 Precalculus Capter 2.6: Combining functions
Composing functions However, tere is a completely different metod of combining functions tat is not connected wit algebra. Tis metod is called composition, and is based on letting te output of one function be te input for te oter. Here s a real-life example. At starting time t = 0, te side lengt of a square is 10 cm. Te square s side lengt grows at a rate of 3 cm per second. Ten te formula for te side is easy to figure out: s = 10 + 3t In tis formula, s depends on t. t is te independent variable and s is te dependent variable. t is te input and 10 + 3t is te output. s is a function of t. M19500 Precalculus Capter 2.6: Combining functions
Let t be time, s te side lengt of a square, and A te square s area. Ten A = s 2 and s = 10 + 3t Now A depends on s, wic in turn depends on t. To sow ow, just substitute 10 + 3t for s in A = s 2. Of course, make sure to use parenteses. Tus A = (10 + 3t) 2. Example 2: Te volume of a sperical balloon wit radius r is 4 3 πr3. Suppose te balloon is being filled wit air, and its radius at time t is 3 + 4t. Find te balloon s volume at time t. Solution: V = 4 3 πr3 = 4 3 π(3 + 4t)3. We need to repeat te above discussion, tis time using function notation. Altoug it s not obvious wy tis more complicated notion is necessary, please accept tat it is needed for more advanced courses. M19500 Precalculus Capter 2.6: Combining functions
If f and g are functions, tey can be composed to form a new function given by te formula (x) = f(g(x)). In oter words, if you start wit an input x, ten use te output of g as te input of f, ten te output for will be te output from f. Tis is a clumsy explanation. It says noting more tan te formula (x) = f(g(x)). We say tat is f composed wit g. Some people like to draw a picture: Input x g g(x) f f(g(x)) = output Example 3: Let f(x) = x + 2 and let g(x) = x 2. Find a) f(g(x)) and b) g(f(x). Solution: a) f(g(x)) = f(x 2 ) = (x 2 ) + 2 = x 2 + 2 b) g(f(x)) = g(x + 2) = (x + 2) 2. Composition is not commutative. In plain Englis: f composed wit g, given by (x) = f(g(x)), will usually be unequal to and ave no relationsip wit g composed wit f, given by g(f(x)). M19500 Precalculus Capter 2.6: Combining functions
Tere is a simple rule for working wit algebra expressions involving functions: Parentesis Rule 3 Wen you substitute any expression for f(x) in a formula, replace f(x) by te expression enclosed in parenteses. In oter words, wen you substitute an expression for f(x), use parenteses just as you would wen you substitute an expression for x. In section 2.4, we followed tis rule (witout calling attention to it) wen we calculated average rates of cange for a function. Now we need to concentrate on getting te algebra correct. Example 4: Given f(x) = 3x x 2 f(x + ) f(x), find and simplify. Solution: see next slide. M19500 Precalculus Capter 2.6: Combining functions
Start wit te function definition f(x) = 3x x 2 Substitute x + for x: f(x + ) = 3(x + ) (x + ) 2 Here is te problem: f(x + ) f(x) Substitute for f(x) and f(x + ): = (3(x + ) (x + )2 ) (3x x 2 ) Expand (x + ) 2 : = (3x + 3) (x2 + 2x + 2 ) (3x x 2 ). Distribute two minus signs: = 3x + 3 x2 2x 2 3x + x 2 3 2x 2 Collect terms = Factor and cancel = (3 2x ) = 3 2x Back in Section 2.4, we studied te function f(t) = 96t 16t 2, te eigt above ground of a rock trown upward from te ground at speed 96 feet per second. For various small values of, we calculated te average rate of cange of f(t) from t = 2 to t = 2 + as f(2+) f(2). Let s do te same ting ere, but for arbitrary. M19500 Precalculus Capter 2.6: Combining functions
Example 5: Given f(t) = 96t 16t 2, find and simplify f(2+) f(2). Solution: Start wit te function definition f(t) = 96t 16t 2 Substitute 2 for t: f(2) = 96(2) 16(2) 2 = 128 Substitute 2 + for t: f(2 + ) = 96(t + ) 16(2 + ) 2 Average rate of cange is: f(2 + ) f(2) Substitute for f(2 + ): = (96(2 + ) 16(2 + )2 ) 128. Expand (x + ) 2 : = 96(2) + 96 16(4 + 4 + 2 ) 128 Distribute 16: = 192 + 96 64 64 162 128 Collect terms 32 162 =. Factor and cancel (32 = 16) = 32 16 Conclusion: te average velocity of te rock from time t = 2 to time t = 2 + is 32 16 feet/second. Tus te rock s instantaneous velocity at t = 2, obtaining by letting approac 0, is 32 feet/second. M19500 Precalculus Capter 2.6: Combining functions
Example 6: Given f(x) = 3x x 2 and g(x) = 4x + 7, find f(g(x)) and g(f(x) and rewrite eac as a simplified product. Solution: f(g(x)) = f(4x + 7) = 3(4x + 7) (4x + 7) 2 = (4x + 7)(3 (4x + 7)) = (4x + 7)(3 4x 7) = (4x + 7)( 4x 4) = 4(x + 1)(4x + 7) g(f(x)) = 4(3x x 2 ) + 7 = 4x 2 + 12x + 7. To decide weter tis factors, calculate te discriminant D = b 2 4ac = 144 4( 4)(7) = 144 112 = 32. Since D = 32 = 4 2 is not a wole number, te quadratic factoring criterion from Section 1.5 tells us tat g(f(x)) = 4x 2 + 12x + 7 does not factor and is terefore a simplified product. Note tat g(f(x)) and f(g(x)) are unrelated: in general, composition is not commutative. M19500 Precalculus Capter 2.6: Combining functions
Example 7: Given f(x) = 3x + 2 5 rewrite eac as a simplified sum. and g(x) = 5x 2, find f(g(x)) and g(f(x)) and 3 Solution: f(g(x)) = f ( ) 5x 2 3 ( ) 5x 2 3 = 3 + 2 = 5x 2 + 2 = 5x 5 5 5 = x g(f(x)) = g ( ) 3x+2 5 ( ) 3x+2 5 = 5 2 = 3x + 2 2 = 3x 4 3 3 = x Note tat g(f(x)) and f(g(x)) are bot equal to x. If you start wit any number, apply eiter function, ten apply te oter function, you get back to te original number. We say tat te functions f and g undo eac oter. Te more tecnical language is tat tey are inverse functions, wic we will study in detail in Capter 2.7. Te problem on te next slide is a warmup for te material in tat capter. M19500 Precalculus Capter 2.6: Combining functions
Example 8: Solve y = 3x 2 5x+7 for x and ceck your answer. Solution: Te given equation is y = 3x 2 5x+7 Multiply bot sides by 5x + 7 (5x + 7)y = 3x 2 Remove parenteses 5xy + 7y = 3x 2 Terms wit x to left side 5xy 3x + 7y = 2 Terms wit y on rigt side 5xy 3x = 2 7y Factor out x on left side x(5y 3) = 2 7y Divide by 5y 3 x = 2 7y 5y 3 Multiply answer by 1 1 x = 7y+2 Te ceck is on te following slide. M19500 Precalculus Capter 2.6: Combining functions
Te given equation is y = 3x 2 5x+7 We want to ceck te answer x = 7y+2 ( Plug in te answer y =? 3 7y+2 ( 5 7y+2 ( Rewrite -2 and 7 as fractions y =? 3 7y+2 Combine fractions y =? ) 2 ) +7 ) 2() ( ) 5 7y+2 + 7() 21y+6+10y 6 35y+10 35y+21 Multiply by 7y+2 7y+2 y =? 31y 31...Y ES! M19500 Precalculus Capter 2.6: Combining functions