 Let us continue our discussion of centroids and now let's step away from the easy, discrete setting and let's try to go towards the continuous setting. Suppose next that we have a region R that's bounded by some function f of x. And so if we have just our typical x-axis and y-axis and so we have some function f, which maybe it looks something like this. So we have some function f and then maybe we have some bounds on x. We have some x equals a and x equals b. And so consider this region that's below the curve, it's above the x-axis and it's bounded left and right by x equals a and x equals b. So this is a region on the interval a to b. And so this is what we mean by this region R, like so. Now we know how to calculate the area of such a thing, right, the area of the region R is going to be the typical formula, a equals the integral from a to b of f of x dx. We're used to that type of calculation. Now what I want to do is let's try to approximate R by in many rectangles, all right? So we've done this many times in the past, let's subdivide the interval into pieces and then we can construct rectangles and then for simplicity's sake, we'll make the height of the rectangle be determined by the midpoint, like so we get the height right here, we get the height right here, midpoint, we get the idea, we get all of these midpoint rectangles, like so I do apologize for the crudeness of the drawing but this is just for illustrator purposes just to give you the idea. So we can approximate the area under the curve using these rectangles. Now kind of like this when we approximate the region as this system of rectangles, what we can do is we can consider for each rectangle, what if this was just a single object? We're gonna assume each one is an object all by itself, right? Where would the centers of each of these rectangles be? Well if you take a typical rectangle between xi and xi minus one, so xi bar is the midpoint right here, well that's where the similar mass is gonna be, its x-coordinate is gonna be xi bar, which of course is namely just xi plus xi minus one over two and then the y-coordinate, the y-bar is just gonna be halfway up this thing which the height of the whole rectangle is f of xi bar and then we're gonna take half of that, like so. So the center of mass for a single rectangle is xi bar and one half f of xi bar, we get that center. Well how massive is one of these objects? Well assuming the entire lamina here is uniform density, then we could actually equate the mass of a single rectangle with the area of a single rectangle and we know what the area of this thing is gonna be, it's gonna be f of xi bar times delta x, like so that's the mass of a single one, the area of a single one. And so what we wanna do is think of this as a system with n points in it. The location will be the centroid of the rectangle and then the mass will be the area of the rectangle and so if we start to try to compute this, we're gonna take x-bar, it'll be approximately, it's gonna be the moment where i equals one to n, we're gonna take the masses of all of these things and the mass remember is this f of xi bar delta x, then we'll multiply this by its location which is just xi bar and then we're gonna divide this by the sum of the masses which is f of xi bar delta x. Now this is an approximation of x-bar. If we take the limit as n goes to infinity, well the one on the bottom, we know this one super well, the region on the bottom, this is the Riemann sum which we're just using the midpoint rule approximation. As n goes to infinity, this is gonna go towards the true area under the curve which is the integral from a to b f of x dx. That we've seen before, what happens on the top? Well on the top as n goes to infinity, f of xi bar, that's gonna converge to just f of x, the delta x is gonna converge to a dx, this xi bar will just become an x and then our Riemann sum becomes an integral from a to b and so there you have it, this gives a formula for the center x-coordinate x-bar. You're gonna get one over the area which the area is the integral of f of x and then you get the integral from a to b of x f of x dx, there's this extra x that pops out here and so this process of accumulation which we've seen many times comes down to the fact that when you have a continuous problem subdivided into smaller linear or so to speak discrete problems, solve each of the discrete problems and take the limit and that will give us the solution to the continuous problem, we get this x bar right here. So it's one over a the integral of x f of x dx. Now the y-bar is a little bit different and that's because the geometry is a little bit different here and so let's illustrate what that would look like. Let me clear off my board. If we repeat this example for y-bar, well it's basically the same idea, the denominator is gonna be the sum of all of the masses so I equals one to n, the area of each rectangle will be f of xi bar delta x. In the top, we take this sum where i equals one to n, we have to take the mass which is f of xi bar delta x and then we have to dine it by the y-corner which is gonna be one half f of xi bar and so when you put these things together as n goes to infinity again, right? As n goes to infinity, the bottom will again converge to the integral from a to b of f of x dx. The top on the other hand, it'll approach one half the integral from a to b of f of x squared dx or sometimes they stick the one half inside here, right? And so when you put those together, y-bar is gonna be one over the area divided by one half f of x squared dx. And so we get these formulas for, we get the formula for x-bar and y-bar and these are just come from this idea of taking limits of this system of discrete problems putting together. And so in the next video, we're going to take a look of how one can use the centroid formless x-bar and y-bar to find the center of mass of various regions. So take a look for those videos.