 In this video we provide the solution to question number 5 for practice exam number 3 for math 12-20, in which case we're asked to set up and simplify an integral that'll compute x bar for the following region. So we want to find the centroid. We don't need the y-coordinate, we just need the x-coordinate of the centroid there. And so let's consider our region that's given to us. We have the curve y equals x cubed, x plus y equals 2, that's a line, and then the line y equals zero. I'm going to try to draw a sketch of this just to help me out here. So y equals zero, of course, is the x-axis, so I might begin by drawing just that. And for the sake of it, I'll label it. This is the x-axis there, y equals zero. The line x plus y equals 2, it'll be helpful to also introduce the y-axis into consideration here. So we'll draw that right there. And so the line y, or x plus y equals 2, if you prefer, you can put it into slope intercept form, y equals negative x plus 2. You have a y-intercept of 2, a slope of negative 1, that actually also tells you you have an x-intercept of 2. So I'm going to put those on my, I'm going to put those on the screen as well. So we have y equals 2 right here, x equals 2. And so then we're going to connect the dots like so. So that's our line x plus y equals 2. And so then the last part is we have the curve y equals x cubed. I'll do that one in blue. That curve looks something like the following, like so, y equals x cubed. Notice that this will go through the point 11, which 11 is on this line as well. That's actually the point of intersection right here. So that was actually kind of fortuitous. I thought of that. So then looking at the region we're interested in, like we said earlier, we want y equals 0. So we have this right here. So this right here is the region that we're interested in. So on the left side, we have x equals 0. On the right side, we have x equals 2. And then we come to this corner right here at 11. So this actually suggests to me that we might need to break up our integral. So think of this. Like, let's take this curve right here on the top. I'm almost running out of colors here. So take this curve on the top. It does have that nondifferentiable cut at x equals 1. But we're going to call this function y equals f of x. And so we want to then find where's the centroid of this thing with regard to this function f of x. Now, since we're looking for x bar, we can apply the formula for x bar, which is you take one over the area. So we have to find the area of the region. We'll come back to that in just a moment. We have to find the area of the region. We're going to integrate from 0 to 2. Then you end up with x f of x dx, like so. Okay. So what we can then do is we can break this thing up along at the point x equals 1. So you're going to get 1 over a times the integral from 0 to 1 of x times. Now in this situation, f of x is the function x cubed in that situation. And so then we have the other one, 1 over a times the integral from 1 to 2. And this time our function is going to be what we had before 2 minus x. That's the line in that situation. So that's then going to give us the bounds. That's going to give us the integral. The only thing that's left here for us is to find the area of the region. But by good fortune, the area is already given to us so that we don't have to compute it. Notice this is the area. We need 1 over the area. And as such, we're going to take the reciprocal of those things. And so putting it then together at the end, we're going to get two integrals. And so we get a, we'll write it up here, four thirds integral from 0 to 1 of x to the fourth dx plus four thirds, the integral from 1 to 2 of, and that one, if you want to multiply out the x, you can if you leave a factor, I'm okay with either 2x minus x squared, I chose to multiply it out. And so the sum of those two integrals will give us the x bar, the x coordinate of the centroid of this region.