 Let's take a look at another example of finding centroids of a region in this example We're going to look for the centroid of the region bounded by the curves y equals cosine of x y equals zero x equals zero and x equals pi halves now admittedly y equals zero is really just the x-axis and x equals zero It's just the y-axis and since x equals pi halves is an x-intercept of cosine We didn't need the last one so it's somewhat implied, but that's okay To find this centroid here. We first want to look for x bar and so remember the formula we have x bar is equal to 1 over a Times the integral from a to b of the function x times f of x dx So let's first figure out the area the area under the curve We've done many times we want to find the integral from a to b in this case We're gonna go from zero to pi halves of our function f of x which in this case is cosine of x dx so Anti-derivative of cosine would be sine of x We get that we have to evaluate from zero to pi halves Now sine of pi halves is one sign of zero is zero So we subtract that one minus zero and we get one so the area under the curve is just gonna be one So as we kind of we kind of can ignore the one over a part there Because divide my one doesn't do much which kind of simplifies our calculation here So do x bar. We're now going to integrate from zero to pi halves The function x times cosine of x dx Now this calculation right here in order to do this we're gonna have to use integration by parts We're gonna set you equal to x. We're gonna set du equal to dx dv then becomes cosine x dx and Then we get that v would then be sine of x great So when we apply the integration by parts formula, we're gonna get u times v which is x times sine of x We're gonna evaluate that from zero to pi halves And then we subtract from that the integral of Vdu that'll still go from zero to pi halves and we're gonna get sine of x dx Great plugging in like we saw before plugging in pi halves into sine gives us a one so you plug into the x You're gonna get pi halves. So we're gonna start off with a pi halves Then you're gonna subtract from that plug it in zero well zero for x or zero in for sine You're gonna get zero in both cases. So it's just gonna disappear Moving on to the next part the anti derivative of negative sine is cosine So we get a positive cosine right there. We evaluate that from zero to pi halves Let's copy down the pi halves one more time When you plug in cos or when you plug in pi halves into cosine, you're gonna get zero and then when you subtract When you plug in zero into cosine, you're gonna get a one So we see that the x-coordinate for the x-coordinate for Sorry the x-bar for the for the for the centroid. It's gonna be this value right here pi halves minus one Great How about y bar? What is that thing gonna look like? Let's put it let's put a box around the answer there So for y bar we have the formula one over the area times the integral from a to b one half f of x Squared dx now like we saw before the area in this case is one so we can ignore it And then proceeding forward our integral would look like the integral from zero to pi halves one half cosine squared of X dx now in this situation because we have to enter a cosine squared We're gonna use the half-angle identity here, so we're gonna get one fourth the integral from zero to pi halves of one plus cosine of 2x dx now you'll notice that we got a we got a One-fourth in front of this thing This is a consequence of having a one half already there And then there's a one half that pops out from the half-angle identity So taking the anti-derivative of these things we got a one-fourth in front One is gonna race to become an x and then cosine will race to become a one half Sign of 2x as we go from zero to pi halves like so So when we plug in pi halves into x you'll just get a pi halves when you plug it into sign Well, you're gonna get two pi over two which is actually sign of pi sign of pi is zero So it's just gonna vanish So we're gonna get one-fourth times pi halves And then last when you plug in the zero it'll disappear there and then sign of zero is again zero So it's goner and so you're just gonna subtract zero from that and we see that the y-coordinate of the centroid is gonna be pi 8th Which if we come back up to our picture which this this diagram here is drawn to scale We see that does look like the center of gravity there