TITLE: Center of Mass with two functions
QUESTION [7 upvotes]: I am having trouble trying to figure out how to go about this problem. I can do problems with single variables but I can not solve this one. I think I would need to subtract the functions from one another but I am not sure which should be subtracted from which. If anyone can help with tips or solutions it would be greatly appreciated. Thank you.

REPLY [2 votes]: The formula for Centroid
$$f\left(x\right) = 9\cos \left(x\right) ; g\left(x\right) = 9\sin \left(x\right)$$
$$\bar x =\dfrac{ ∫_0^{\frac{{π}}{4}} x\left(f\left(x\right)-g\left(x\right)\right) dx}{∫_0^{\frac{{π}}{4}} \left(f\left(x\right)-g\left(x\right)\right)dx}$$
$$\bar y= \dfrac{ ∫_0^{\frac{{π}}{4}} \frac{\left(f\left(x\right)+g\left(x\right)\right)}{2}\left(f\left(x\right)-g\left(x\right)\right) dx}{∫_0^{\frac{{π}}{4}}\left(f\left(x\right)-g\left(x\right)\right)dx}$$
To further elaborate:
Denominator = $$9∫_0^{\frac{{π}}{4}}\left(\cos \left(x\right) -\sin \left(x\right)\right) dx = 9.\left(2\right).\frac{1}{\sqrt{2}}-9 = 9.\sqrt{2}-9$$
Numerator for $$\bar x = 9∫_0^{\frac{{π}}{4}}\left(x\cos \left(x\right) -x\sin \left(x\right)\right) dx$$
Evaluate the integral by integration by parts.  I will show the example for one of them:
$$∫_0^{\frac{{π}}{4}}x\cos \left(x\right)dx $$
Put u = x, dv = cos(x)dx => du = dx and v = sin(x)
$$∫_0^{\frac{{π}}{4}} udv = uv -∫_0^{\frac{{π}}{4}}vdu = \left[x\sin \left(x\right) +\cos \left(x\right)\right] |\frac{π}{4},0$$
Similarly Put Put u = x, dv = sinxdx => du = dx and v = -cos(x)
$$∫_0^{\frac{{π}}{4}} udv = uv -∫_0^{\frac{{π}}{4}}vdu = \left[-x\cos \left(x\right) +\sin \left(x\right)\right] |\frac{π}{4},0$$
Thus the numerator $$= 9*\left[x\sin \left(x\right) +\cos \left(x\right) - \left[-x\cos \left(x\right) +\sin \left(x\right)\right]\right]= x\left(\sin \left(x\right) + \cos \left(x\right)\right) + \cos \left(x\right) - \sin \left(x\right) = 9\left(\frac{π}{4}.\sqrt{2}-1\right)$$
$$\bar x = \dfrac{9\frac{π}{4}\sqrt{2} -9}{9\sqrt{2}-9}$$
For the $\bar y$
Numerator = 
$$∫_0^{\frac{{π}}{4}} \frac{81}{2} \left[\cos \left(x\right) - \sin \left(x\right)\right]\left[\cos \left(x\right) + \sin \left(x\right)\right]$$
$$∫_0^{\frac{{π}}{4}} \frac{81}{2}\left[\cos ^{2}\left(x\right) - \sin ^{2}\left(x\right)\right] $$
$$∫_0^{\frac{{π}}{4}} \frac{81}{2}\cos \left(2x\right) = \frac{81}{2} \frac{\sin \left(2x\right)}{2}$$
$$\bar y =\frac{81}{4}.1$$
$$\bar y = \frac{81}{4}$$
Centroid = $$\left(\bar x, \bar y\right) = \left(\dfrac{9\frac{π}{4}\sqrt{2}-9}{9\sqrt{2}-9}, {\frac{81}{4\left(9\sqrt{2}-9\right)}}\right)$$
Thanks
Satish