<s>[INST] Centroid of the region bounded by y = f(x) and x = f(y) curve How do i find the centroid of the region if $x = f(y)$ is involved ?
For example : find the centroid of the region bounded by $y = x^2$ and $x = y^2$
And how do i find it if there is curve intersection that is below x axis ?
For example : find the centroid of the region bounded by $y = x^3$ and $x = y^2-1$
The formula I found in the book was
$$x = \frac 1{\mathcal{A}}\int_a^b x[f(x)-g(x)] \,dx$$
$$y = \frac 1{\mathcal{A}}\int_a^b \frac 12 (f(x)^2-g(x)^2) \,dx$$
$\mathcal{A}$ is the area of the region bounded by the curve.
 [/INST] In this case you can first try to sketch the region, as shown below.

From the sketch we learn that it suffice to consider the first quadrant where $ x, y \geq 0 $.
Thus the equation $ x = y^2 $ can be converted to $ y = \sqrt{x} $.
Put $ f(x) = \sqrt{x} $, $ g(x) = x^2 $, $ a = 0 $, $ b = 1 $, and using the formulae you have given yield
$$ A = \int_0^1 \sqrt{x} - x^2 \operatorname{d}\!x = \left. \frac23 x^{3/2} - \frac13 x^3 \right|^1_0 = \frac13,  $$
$$ x = \frac1A \int_0^1 x(\sqrt{x} - x^2) \operatorname{d}\!x = 3 \left[ \frac25 x^{5/2} - \frac14 x^4 \right]_0^1 = 0.45, $$
and
$$ y = \frac1A \int_0^1 \frac12 [(\sqrt{x})^2 - (x^2)^2]\operatorname{d}\!x = \frac32 \left[ \frac12 x^2 - \frac15 x^5  \right]_0^1 = 0.45. $$
</s>