 In order to get some more practice with composition of functions, I wanna do another example, but this time we're gonna use rational functions. Rational functions do have some restrictions on their domains. The first function f of x, which is given as one over x plus two, its domain will be all real numbers x, such that x does not equal negative two, right? That makes the denominator go to zero. And likewise for the function g, g is four over x minus one. The domain of g is gonna be all real numbers x, such that x does not equal one in this situation. So that's the domain of the two functions. Let's now compose these functions together and see what happens. When you do f of g of x, we're gonna put inside of f g of x, and you can evaluate this however you want. You could do the first one, the inside function first of the second outside function. f of g of x, this would look like one over, we're gonna write the formula for f, but instead of seeing x, we're gonna write g of x. So we get one over g of x plus two, but g of x, it's itself a fraction. So you get one over four divided by x minus one, plus two, like so. And so this is an example of what one often calls, textbooks often call this a complex fraction. I'm not a big fan of that term because a complex fraction makes it seem like maybe complex numbers are involved whatsoever, like one plus i over two minus i or something, nothing like that, that's a complex fraction. In this context, we have a compounded fraction, maybe a nested fraction, where we have fractions inside of fractions. And whenever we have a fraction inside of a fraction, it means it's needlessly complicated, and we can simplify this thing. And so when you look at this nested fraction, you're gonna see this big fraction bar, that's gonna represent the mommy, and then you're gonna see these little fraction bars right here, which are gonna be the babies. So I want you to identify the least common denominator of all of the baby fractions you see there. And as there's only one baby fraction, the least common denominator is its denominator, x minus one. You're gonna be multiplying the mother fraction by the least common denominator of all the baby fractions. Basically what we're saying here, is that baby needs to grow up and move out of mom's house right here. You're gonna multiply top and bottom by x minus one, and we're gonna distribute this here. You're gonna see in the numerator, you're just gonna get one times x minus one, not a whole lot to say there. In the denominator, you're gonna get four times x minus one, times x minus one, and then you're gonna get two times x minus one, like so. The x minus one on the first part will cancel, which was the whole point of this. And then if we look at the rest of it, one times x minus one is just x minus one. In the denominator, we get a four, and you get a two times x minus one. In which case, then we can simplify the denominator by distributing that two. You get four plus two x minus two, the four and the negative two are gonna combine together. So we get x minus one over two x plus two. You can factor out the two from the denominator if you want to, but there's not gonna be a huge benefit of doing that at this venture right here. But I mean, like I said, you can do it. So the simplified form would be x minus one over two x plus one. That gives us here the composite of the two functions. When you put a rational function inside of a rational function itself becomes a rational function. But what can we say about the domain of this rational expression? We can see when we look at the formula there, the domain of f composed with g, we get all real numbers x such that x does not equal negative one. We can see very quickly that negative one would make this denominator go to zero, right? And that's maybe no surprise in here, not negative one. Oh, I mean, it is negative one, excuse me. We can't let the denominator go to negative one, but it turns out there's another problem as well. And we've seen this issue before. The question is, is this function x minus one over two times x plus one, is this actually equal to the original expression we had right here? Because yeah, we can't let the denominator of the mother fraction go to zero, but we also can't let the denominator of the baby fraction go to zero. We were able to simplify out the baby fractions, but those domain restrictions have consequences on this formula. F composed with g is not defined when x equals negative one or x equals one. Because the first function g here, anything that fits inside of f composed with g has to fit inside of g and one does not fit inside of g. So this machine will break if you try to shove one into it. But you also have that negative one was unallowed. Why was negative one not allowed? Well, the thing is the stuff going inside of g will process and will come out of g. But the thing's coming out of g have to fit inside of f. f doesn't allow negative two. And notice if you take g of negative one, you get drum roll, you get a negative two right there. Negative one is exactly the number which put inside of g will produce a negative two. We didn't actually have to compute that because as we simplify the fraction we see very naturally that there's a restriction there. So when it comes to finding the domain of these composite rational functions, what I want you to do is look at the final simplified form see what is unallowed, you see negative one, go back to the original form, see what's not allowed. It's a positive one, put those things together and that's the domain of the composite, these rational functions. Let's do another example. This time let's do g of f of x, right? So g of x, which you can't see it on the screen anymore but remember g of x was four over x minus one. We're gonna replace the x with f of x here. And then f of x, again it's also off the screen remember f of x was one over x plus two minus one here. And so in order to calculate the domain, I'm already gonna say it here, the domain of g of f here, it's gonna be all real numbers x, such that x is not equal to, first of all we can't allow negative two because that makes this fraction undefined. But if x is not negative two then we can proceed to the next step, identifying the baby fraction here. We're gonna times top and bottom by x plus two. And so that'll cancel the x plus two in the denominator. We end up with four times x plus two in the numerator. And then we're gonna get one minus x plus two in the denominator. In which case we get four times x plus two in the numerator, I'm just gonna leave it factored. And then in the denominator when you distribute this negative sign, you end up with a negative x and then you're gonna get a minus one right there. Assuming we did everything right there. And which case since everything in the denominator is negative I'm just gonna factor out the negative. So we get a negative four times x plus two and then an x plus one in the denominator. So looking at the final form here we see that there's another restriction, x cannot equal negative one, like so. Now we're usually pretty good at identifying the negative one in the final form but we have to also remember the restriction from the original form. That's the most common mistakes students make. They forget that we can't go from this part to this part, that these things are not equal if x is negative two. So the fact that we go from here to here we're assuming that x equals, doesn't equal negative two and why is that? Well look at this thing right here. What is this quantity? In a previous lecture when we did something like this I said that this quantity is one but that's not exactly true, it depends on x. If x is any number other than negative two then this is in fact one. But what if x is negative two? Then you get zero divided by zero which zero divided by zero is not one. It's undefined because if we allowed zero divided by zero to equal one then we're allowing division by zero in fact all numbers are then equal to zero and we just blew up the universe. Why is all just dropping a meteor on Cedar City right now if we're gonna divide by zero? Let's not do that. So because we don't divide by zero we do have to require that x doesn't equal negative two and that's a consequence of the domain right here. You put negative two inside, that is you don't allow negative two inside the domain because if you did, you might as well just kiss your family goodbye right now. I apologize for the dark metaphor there but division by zero is just that dark. It really is right. One last example, let's do f composed with f here. So f of f of x, we're gonna put f of x inside of f of x. Remember f of x was given by the formula one over x plus two. And so we're gonna replace x with f of x which itself is one over x plus two plus two. So we can already see that with the domain of f of f. Oops, f of f. We get all numbers x such that x is not equal to the following with rational functions it's just easier to list what's not in the domain. We can't have negative two because that's not inside the domain of f. And so then we're gonna times the numerator by x plus two and the denominator by x plus two to be rid of this x plus two. Upon doing so the numerator will then become x plus two one times x plus two and the denominator gonna get one plus two times x plus two multiplying out the denominator here we get one plus two x plus four x plus two on the bottom. And so then you get a two x plus five in the denominator, right? And the numerator left unaffected x plus two. And so what makes the denominator go to zero here? We're gonna take two x plus five equals zero. If you're not sure, I mean, you don't have to do in your head. I mean, if you can that's great but if not no big deal just write it out. Subtract five from both sides you get two x equals negative five divided by two x would equal negative five over two. That makes the denominator go to zero. So negative five halves is forbidden from the domain. And that gives us the domain of the composite of these two functions and gives us more practice on how to compute the composite of two rational functions here.