Example 5. Calculate the coordinates of the center of gravity of the square $0 \leqslant x \leqslant 2,0 \leqslant y \leqslant 2$ with density $\rho=x+y$.
Solution. First, we calculate the mass and static moments of the square. We have:

$$
m=\iint_{D} \rho d x d y=\int_{0}^{2} d x \int_{0}^{2}(x+y) d y=8
$$

$$
\begin{gathered}
M_{x}=\int_{D} x \rho d x d y=\int_{0}^{2} x d x \int_{0}^{2}(x+y) d y=\left.\int_{0}^{2}\left(x^{2} y+\frac{x y^{2}}{2}\right)\right|_{0} ^{2} d x= \\
\left.\left(\frac{2 x^{3}}{3}+x^{2}\right)\right|_{0} ^{2}=\frac{28}{3} \\
M_{y}=\iint_{D} y \rho d x d y=\int_{0}^{2} d x \int_{0}^{2}\left(x y+y^{2}\right) d y=\left.\int_{0}^{2}\left(\frac{x y^{2}}{2}+\frac{y^{3}}{3}\right)\right|_{0} ^{2} d x=\frac{28}{3}
\end{gathered}
$$

The coordinates of the center of mass are: $x_{\mathrm{c}}=\frac{M_{x}}{m}, y_{c}=\frac{M_{y}}{m}$. Answer. $x_{c}=\frac{7}{6}, y_{c}=\frac{7}{6}$.