Centroid calculation using integrals

In summary, the author is given a function and is supposed to find the centroid of the function. However, the author has problems understanding the function and is not sure how to calculate the area under the curve.
  • #1
arhzz
268
52
Homework Statement
Find xs and ys
Relevant Equations
Integration
Hello!

Im given this function ## f:[-\pi/2,1] -> [0,1]## with f(x) = 1-x for x (0,1] and f(x) = cos(x) for x ##[-\pi/2,0] ##

And im susposed to find the centroid of this function so xs and ys.

For that I am given these 2 equations ( I found them in the notes)

## x_s =\frac{1}{A} \int_{a}^{b} f(x) x dx ## and ##y_s =\frac{1}{A} \int_{a}^{b} \frac{f(x)}{2}*f(x) dx##

Now to calculate A I found this formula ## A = \int_{a}^{b} f(x) dx ##

Okay so now looking at my problem specificly I have 2 diffrent values for the function depending on where it is. So I calculated A1 and A2; one for 1-x with the integral bounderies going from 0 to 1 and A2 for cos(x) with integral bounderies being -pi/2 and 1

I get ## A_1= \frac{1}{2} ## and ##A_2 = 1 ## Think that should be correct. Now since I have 2 A's (A should be the surface) I went ahead and caluclated using the formulas I posted above xs1 and xs2. For xs1 I used A1 and the same integral bounderies (0 to 1); for xs2 I used A2 and -pi/2 to 1

I get ##xs_1 = \frac{1}{3} ## and ##xs_2 = 1 - \frac{\pi}{2} ## Okay now to get a final xs I tried adding xs1 and xs2 together

After doing that i get this ##x_s =\frac{8-3\pi}{6} ## for xs. The solution says it should be ##xs = \frac{7-3\pi}{9} ##

I have rechecked all of my integrals and they should be correct,so im making a mistake somewhere else.I am not to sure what to do when I have 2 xs's, can i just add them together or not? Am i choosing the integral bounderies correctly or not?

Thanks in advance.
 
Last edited:
Physics news on Phys.org
  • #2
arhzz said:
Im given this function ## f:[-\pi/2,1] -> [0,1]## with f(x) = 1-x for x (0,1] and f(x) = cos(x) for x ##[-\pi/2,1] ##
For the above function, I think that for the 2nd part of your function the definition should be ##f(x) = \cos(x)## for ##x \in [\frac{-\pi}2, 0]##.

I'll take a look at the rest of your work and reply on it later.
 
  • #3
arhzz said:
Okay so now looking at my problem specificly I have 2 diffrent values for the function depending on where it is. So I calculated A1 and A2; one for 1-x with the integral bounderies going from 0 to 1 and A2 for cos(x) with integral bounderies being -pi/2 and 1
This is the source of your problems. If I am correct in what I wrote in the previous post, the interval for the f(x) = cos(x) part should be ##[-\pi/2, 0]##, not ##[\pi/2, 1]##. With the intervals you wrote, you'll get two different function values on the interval [0, 1], so you'll get the wrong values for the area beneath the cos(x) part as well as the moment about the y-axis, which you're calling xs.
arhzz said:
I get ## A_1= \frac{1}{2} ## and ##A_2 = 1 ## Think that should be correct.
I get the same values for the two areas. Was this your integral for ##A_2##: ##\int_{-\pi/2}^0~\cos(x)dx##? If so, you are using the correct interval; namely ##[-\pi/2, 0]##.

You don't show the work you did for what you're calling xs (the moment about the y-axis). If you use the wrong interval for this integral, you'll get a wrong value.

Also for what you're calling ys, the moment about the x-axis, you'll need to use ##\cos^{-1}(x)## in the integrand, with the limits of integration being 0 and 1.
 
  • #4
Mark44 said:
This is the source of your problems. If I am correct in what I wrote in the previous post, the interval for the f(x) = cos(x) part should be ##[-\pi/2, 0]##, not ##[\pi/2, 1]##. With the intervals you wrote, you'll get two different function values on the interval [0, 1], so you'll get the wrong values for the area beneath the cos(x) part as well as the moment about the y-axis, which you're calling xs.

I get the same values for the two areas. Was this your integral for ##A_2##: ##\int_{-\pi/2}^0~\cos(x)dx##? If so, you are using the correct interval; namely ##[-\pi/2, 0]##.

You don't show the work you did for what you're calling xs (the moment about the y-axis). If you use the wrong interval for this integral, you'll get a wrong value.

Also for what you're calling ys, the moment about the x-axis, you'll need to use ##\cos^{-1}(x)## in the integrand, with the limits of integration being 0 and 1.
Oh I just checked I made a mistake in the original post. The interval you posted is correct and that is the one I used; A2 you just typed in. I will edit my post.

Although I typed it in the forum wrong I calculated with the right intervals; hence you get the same area under the curve. The rest what I did is I just pluged in the formula. I can post it in detail if it will help.
 
  • #5
arhzz said:
The rest what I did is I just pluged in the formula. I can post it in detail if it will help.
Yes, please post your integrals for xs and ys. If you click on the integral I wrote you can see the Tex that I wrote for it.
 
  • #6
Okay here we go

$$ x_s1 = \frac{1}{A1} \int_{0}^{1} xf(x)dx $$ With plug in values $$ x_s1 = \frac{1}{1/2} \int_{0}^{1} (1-x) * x dx $$

Multiply the brackets out and get rid of the double fraction $$ 2 * \int_{0}^{1} x^2 - x dx $$ Now solve the Integral, it should be only the power rule so we get $$ 2 * ( \frac{x^2}{2} - \frac{x^3}{3}) $$ And I dont know how to do it in LaTeX but evalute the brackets at 1 and 0. Now I put the bracket term on a common denominator and get this $$ 2*(\frac{3x^2-2x^3}{6}) $$ So now we have to plug in 1 into x and subtract that from plugging 0 into x. If we plug 1 into this we get 1/6, if we plug 0 we get 0 hence we are left with. $$ 2 * \frac{1}{6} $$ and that is 1/3.

Okay for xs2 =$$ 1 * \int_{-pi/2}^{0} xcos(x) dx $$ Use partiall integration to solve the integral; I get $$ 1* (xsin(x)+cos(x))$$ and evaluate at -pi/2 and 0. Plug in first 0 than -pi/2 and subract them from each other.We should get $$ 1*(1-\frac{pi}{2} )$$.

This is how I did it
 
  • #7
That doesn't look right to me.

The moment about the y-axis, which you have separated into s1 and s2 has to be done as a single quantity. You can't do them separately.

This is what you need. $$\overline x = \frac{M_{y, 1} + M_{y, 2}}{A_1 + A_2} = \frac{\int_{-\pi/2}^0~x\cos(x)dx + \int_0^1 ~x(1 - x)dx}{A_1 + A_2}$$

Your values for the two integrals look ok to me, but you can't calculate the two parts of this moment separately.

The value I get for ##\overline x = \frac{M_y}{A_1}##, the x-coordinate of the centroid, is ##1 - \frac \pi 3##. I don't guarantee that I haven't made any mistakes.

Calculating ##M_x## will be a bit harder, but you need it to get the other coordinate of the centroid, ##\overline y##.
 
  • Like
Likes arhzz
  • #8
Mark44 said:
That doesn't look right to me.

The moment about the y-axis, which you have separated into s1 and s2 has to be done as a single quantity. You can't do them separately.

This is what you need. $$\overline x = \frac{M_{y, 1} + M_{y, 2}}{A_1 + A_2} = \frac{\int_{-\pi/2}^0~x\cos(x)dx + \int_0^1 ~x(1 - x)dx}{A_1 + A_2}$$

Your values for the two integrals look ok to me, but you can't calculate the two parts of this moment separately.

The value I get for ##\overline x = \frac{M_y}{A_1}##, the x-coordinate of the centroid, is ##1 - \frac \pi 3##. I don't guarantee that I haven't made any mistakes.

Calculating ##M_x## will be a bit harder, but you need it to get the other coordinate of the centroid, ##\overline y##.
Ahh okay that makes sence.See I did not know this formula existed, and I knew I was calculating the integrals right. So if I understood you correctly this will give me the value of my xs? So for ys I need to the same but solve a trickier integral?
 
  • #9
arhzz said:
Ahh okay that makes sence.See I did not know this formula existed, and I knew I was calculating the integrals right. So if I understood you correctly this will give me the value of my xs? So for ys I need to the same but solve a trickier integral?
Yes.
 
  • Like
Likes arhzz
  • #10
Okay I finally got around to revisiting this.And you are right,the formula was wrong. Using the formula you gave me the right result (the result I was not been able to find in post #1). Thank you for your great help as always!
 

FAQ: Centroid calculation using integrals

What is a centroid, and why is it important in geometry and physics?

A centroid is the geometric center of a shape or object, often referred to as the "center of mass" when dealing with physical objects of uniform density. It is important in geometry and physics because it helps in understanding the balance, stability, and distribution of mass within an object. The centroid is the point where the shape could be perfectly balanced if it were made of a uniform material.

How do you calculate the centroid of a 2D shape using integrals?

To calculate the centroid of a 2D shape using integrals, you need to determine the coordinates (x̄, ȳ) of the centroid. These coordinates can be found using the following formulas:\[ x̄ = \frac{1}{A} \int_{A} x \, dA \]\[ ȳ = \frac{1}{A} \int_{A} y \, dA \]where \( A \) is the area of the shape, and \( dA \) is an infinitesimal element of the area. The integrals are evaluated over the entire area of the shape.

What are the steps to find the centroid of a region bounded by curves?

To find the centroid of a region bounded by curves, follow these steps:1. Determine the boundaries of the region and set up the limits of integration.2. Divide the region into infinitesimal elements (usually vertical or horizontal strips).3. Express the area element \( dA \) in terms of the variable of integration.4. Set up the integrals for \( x̄ \) and \( ȳ \) using the formulas for the centroid coordinates.5. Evaluate the integrals to find the area \( A \).6. Substitute the results into the centroid formulas to find \( x̄ \) and \( ȳ \).

Can you provide an example of calculating the centroid of a simple shape, such as a triangle?

Sure! Let's calculate the centroid of a right triangle with base \( b \) and height \( h \). The triangle is positioned with its right angle at the origin (0,0), base along the x-axis, and height along the y-axis.1. The area \( A \) of the triangle is \( \frac{1}{2} b h \).2. For \( x̄ \):\[ x̄ = \frac{1}{A} \int_{0}^{b} x \left( \frac{h}{b} x \right) dx = \frac{1}{\frac{1}{2} b h} \int_{0}^{b} \frac{h}{

Back
Top