# How can we derive the formula of the centroid?

In order to find the coordinates of the center of an area, we can use this formula: \begin{align} \overline{x} &= \frac{\int x\text{d}A}{A} \\ \overline{y} &= \frac{\int y\text{d}A}{A} \end{align}

How can we derive this formula? Can you help me understand it so it becomes intuitive?

Think about the centroid that way: If you have this curve $y(x)$ (first graphic), where its "mass" is its area $A$. The centroid $(x_s,y_s)$ is the place where you would have to put a point mass of equal mass to produce the same static moment about any arbitrary point, thus you could balance this thin plate on your finger if you put your finger right at the centroid.
Now to derive the first moment of area: We know that the moment of a point mass wrt. to a point equals the mass multiplied by the distance to said point. In the second graphic you have a bar chopped out of the first one. The moment of the hatched area wrt to $x_0=0$ equals: $$S_{y'}= m'y = (y'+\Delta y - y)\Delta x \cdot y'= y'\Delta y \Delta x$$ $$\Delta y \Delta x =\Delta A \qquad \mbox{(that's the hatched area)}$$ So the total First Moment of Area of the bar equals $$S_{y,bar}= y\cdot dA$$ If you integrate that for the whole $y(x)$ you get the entire FMoA: $$S_y=\int y\cdot dA$$ Now the moment generated must equal to that of a point mass at the centroidal coordinate $y_s$, which equals: $$S_{y,centroid}=m\cdot y_s$$ As stated before the mass is equal to the entire area $m=A=\int dA$ Thus: $$S_y=\int y\cdot dA = \int dA \cdot y_s$$ $$\to y_s=\frac{\int y dA}{\int dA}$$
$x dA$ is the differential moment around the y-axis. Xbar is the x coordinate where the integrated differential moments cancel each other out. Obviously the same is true for $y dA$