 Welcome back everyone for one more example about area between the curve. On this example, we're gonna take two functions, two curves again, we're gonna take y equals x squared minus two x of parabola and y equals x, just a standard line. And we'll find the area of the region between the goal post x equals zero and x equals four. Now you can see in the illustration here that if we take the green line to be y equals x and then the yellow curve is our parabola y equals x squared minus two x here. If we look at the goal post, x equals zero is the origin over here, where they both intersect, notice that, and x equals four is actually over here. In this situation, the bounds are given to us specifically zero to four, but somewhere in the middle the two functions cross each other and actually the bigger function gets swapped, right? The line, the green function is on top first from zero to this intersection, the parabolas below it and then they switch roles. So the thing is if we look at this, if we call the green function, we'll call this f of x and if we call the parabola g of x, we have somewhat of a problem here that if we take the integral from zero to four, if we take f of x minus g of x here and integrate this, you're gonna end up with some positive region plus some negative region and these things are gonna cancel out, not entirely necessarily, but there's gonna be, this is actually only gonna give us the net area of the region we see here, not necessarily the total area and that's because as you switch roles, this region over here is considered negative in terms of area and this region here would be considered positive and switching the roles of f and g isn't gonna really fix it either. The fix that we need, give rid of this here is we wanna make sure both regions are considered positive area. The fix we need to have is we need to make sure we're taking the absolute value of these things and so what that's gonna do for us is essentially the following. We need to find this point of intersection, where do the functions cross and we saw how to do this previously, right? We need to take f of x and set it equal to g of x and so we need f of x, we decide to be x and g of x is x squared minus two x. If we solve this quadratic equation, let's minus x from both sides, we end up with x squared minus three x equals zero. A simple factorization gives us x times x minus three equals zero. Our points of intersection are gonna be x equals zero, which we saw earlier with the origin and x equals three and that's maybe not too surprising. We can see right here, we get the point three comma three for the two functions. So we get this point of intersection, we have the origin as well and so what we're gonna do is we're gonna have to treat this as a piecewise function because integrating with absolute value can be somewhat of a challenge if the function switches its sign inside of the domain like it does here from zero to four. So what we're gonna do is we're gonna break up the integral into two pieces, right? What I mean is we wanna integrate from zero to four of the absolute value of f minus g dx. We're gonna break it up into two pieces. We're gonna go from zero to three take the absolute value of f minus g dx and then we're gonna add this to the integral from three to four, the absolute value of f minus g dx here because the property of integration that we know about is that if you pick any intermediate value between a and b you can break up the integral into two pieces where you integrate from zero to the middle and then from the middle to the end if so you have to do that. And the reason we wanna do that in this situation is that the way we've chosen f minus g is that g is the parabola and f was the line there as we can still see from the picture above the f minus g is gonna be positive entirely from zero to three and so we can actually drop the absolute value because we know that function is gonna be entirely positive f minus g because on that interval f is always bigger than g but on the second interval, right because f is now gonna be smaller than g we know the area here is gonna be negative and so we can be proactive about that if we drop the absolute value sign we just know there's gonna be a negative sign there as we integrate from three to four here of f minus g like so. We know that the integral we know that it's gonna give us a negative area like so and so we have the same function, different bounds we do have to be careful about the bounds the bounds are different but the function we're dealing with here f minus g is gonna be the exact same with both situations so even though we're doing two integrals it's not exactly reinventing the wheel when we do the second one. So plugging in f minus g remember remember f was the function y equals x so we end up with just an x right here minus the second part which g of x was x squared minus two x make sure you subtract the entire thing like so we subtract the three to four and then when you combine the like terms I'm gonna kinda get ahead of myself here we're gonna combine some like terms we're gonna get a three x minus x squared as the function we're gonna integrate here notice what happened as we distribute the negative sign here so then you get a double negative of two x plus x goodness the three x right there and if you don't like this negative sign in front of the second integral you can always make it a positive by swapping the roles of the bounds three and four you can do that either approach is perfectly fine I don't have a strong preference one way or the other personally but you can do whatever you want there so we wanna integrate the function three x minus x squared the anti-derivative would then give us three halves x squared minus x cubed over three plugged in the boundaries three to zero three I'm gonna leave the minus sign the way it was we're gonna do the exact same anti-derivative three x squared minus x cubed over three and as anti-differentiation is one of the hardest parts about calculating integrals it's nice that we don't have to calculate the anti-derivative twice be aware that this thing is gonna be subtracted right here like so and so plug all these numbers in here we'll do the first one plug in the three we end up with three times nine over two minus three cubed over three we'll come back to that one you're gonna subtract from it plug in zero I love that one you're just gonna get zero minus zero wish everything could be that simple right this will give us the first group the first integral that we calculated we're gonna leave that one right here and then we're gonna remember to subtract the second one in which case now we're gonna plug in four we get three times 16 four squared over two minus four cubed over three like so and then bring in one other term we're going to minus we plug in three three times nine over two minus three cubed over three is it that's right and then this represents the second one right here now I want you to be very cautious because we see this term right here we see this term right here even though we haven't simplified it yet we know they're identical and we see this subtraction right so we're tempted like oh no this cancel out right because you subtract them but JK there there's a subtraction there's also a subtraction this is a double negative these things are actually gonna combine together into one right much like the lions of Voltron they're gonna combine even a larger value than we might have anticipated in the first place so I'm actually gonna combine those things together just slap a two in front of them right we end up with three times nine which is 27, 27 over two and then we're gonna get three cubed is again 27 but if you divide that by three you're gonna get a nine right there so we're gonna get two of those things the zeros from the first group they're just gone entirely because subtracting zero is not gonna do much so then we're left with subtracting what we have right here two goes into 16, eight times three times eight is gonna be 24 so we get a negative 24 and then again distribute this negative sign to these so we're gonna get a plus four cubed is a 64 over three so kind of stuck with that fraction for right now if you don't want the fractions too much you can distribute at least the two right here 27 halves times two of course will just give us 27 so we get 27, nine times two is 18 we get minus 24 and 64 thirds I'm gonna procrastinate the fraction until the very end if I can avoid it 27 take away 18 would give us nine and then we have another 24 to take away from that it would appear right and so that ends up with a negative 15 plus 64 fifths thirds excuse me and so it looks like we can't there's nothing that can cancel out with the 60 the 64 thirds other than we just gotta write this as a common denominator right so we could times top and bottom of the 15 three over three there so that would give us a negative 45 over three plus 64 over three and that gives us a 19 thirds in the end and so this gives us the area under the curve now this is the area of the entire region this is going back to the very top of this thing here we get the area of both this positive reason and this region which is we have to switch it from a negative to a positive that's why we broke up this thing at this value three so for these areas between the curves these are some of the most challenging parts here and we saw examples like this similar to in calculus one where we want to find the area under a curve not necessarily between two curves but if we wanted to find the geometric area the total area we have to kind of treat the area below the x-axis as positive in this situation we're trying to treat this area as positive here as well and we also see examples in science where this is an appropriate thing to do sometimes and sometimes it's not if we think of this situation as a position a motion type problem are we interested in the total distance traveled by a particle in some time limit or are we looking at just the displacement the net distance changed right and the two are very different questions but also very related to each other and so this example demonstrates if we're interested in the total distance traveled we have the key track of signs and make sure we take absolute values but if we're only interested in the net the net distance then we would treat this as negative and this as positive so the definite integral has this net area built into it but it can be modified into total area if we need it to be so thanks for watching our videos here about area between the curve stay tuned for our next videos about a volume using integrals to calculate volumes and I'll see you then bye everyone