I'm having trouble computing the following exercise concerning the centroid of a general triangle, be it scalene, isosceles or equilateral. It goes like this: Point A is the origin, point B belongs to x-axis at $x = b$ and point C is at $y = h$.
I then proceeded to find a relation between $x$ and $y$ so it could be integrable, as suggested by the professor. It follows that for a given $y$ there is a similar triangle with base $\delta x$ and height $h - y$, which produces $y = h - \frac{h*\delta x}{b}$. Integrating the vector $(x,y)$ with respect to $d\delta x$ from $0$ to $b$, I find the correct absolute value, only it has the opposite sign. Besides getting what's wrong with this integral, I'd also like to know how can this work as the triangle itself is composed by at least 2 functions, so it would make sense to split the integral likewise. Thanks in advance.