Answer
There are two cases based on the given boundaries:
Case 1. ${\cal D}$ is a vertically simple region
$\mathop \smallint \limits_{}^{} \mathop \smallint \limits_{\cal D}^{} f\left( {x,y} \right){\rm{d}}A = \frac{{27}}{4}$
Case 2. ${\cal D}$ is a horizontally simple region
$\mathop \smallint \limits_{}^{} \mathop \smallint \limits_{\cal D}^{} f\left( {x,y} \right){\rm{d}}A = \frac{{175}}{{12}}$
Work Step by Step
We have the region $\cal D$ bounded by $y = x$, $y = 4x - {x^2}$, and $y=0$.
First, we find the intersection points between $y = x$ and $y = 4x - {x^2}$ by solving the following equation:
$x = 4x - {x^2}$
${x^2} - 3x = 0$
$x\left( {x - 3} \right) = 0$
So, the intersection occurs at $x=0$ and $x=3$.
Case 1. ${\cal D}$ is a vertically simple region
In this case, the lower boundary is $y=x$ and the upper boundary is $y = 4x - {x^2}$. Whereas, the left boundary is $x=0$ and the right boundary is $x=3$. So, the domain description is given by
${\cal D} = \left\{ {\left( {x,y} \right)|0 \le x \le 3,x \le y \le 4x - {x^2}} \right\}$
We integrate $f\left( {x,y} \right) = x$ over ${\cal D}$ as an iterated integral:
$\mathop \smallint \limits_{}^{} \mathop \smallint \limits_{\cal D}^{} f\left( {x,y} \right){\rm{d}}A = \mathop \smallint \limits_{x = 0}^3 \mathop \smallint \limits_{y = x}^{4x - {x^2}} x{\rm{d}}y{\rm{d}}x$
$ = \mathop \smallint \limits_{x = 0}^3 x\left( {y|_x^{4x - {x^2}}} \right){\rm{d}}x$
$ = \mathop \smallint \limits_{x = 0}^3 x\left( {3x - {x^2}} \right){\rm{d}}x$
$ = \mathop \smallint \limits_{x = 0}^3 \left( {3{x^2} - {x^3}} \right){\rm{d}}x$
$ = \left( {{x^3} - \frac{1}{4}{x^4}} \right)|_0^3$
$ = 27 - \frac{{81}}{4} = \frac{{27}}{4}$
Case 2. ${\cal D}$ is a horizontally simple region
In this case, the left boundary is $y=x$ and the right boundary is $y = 4x - {x^2}$ (please see the figure attached). Whereas, the lower boundary is $y=0$ and the upper boundary is $y=3$.
First, we apply the quadratic formula to the right boundary curve to solve for $x$ as a function of $y$:
$y = 4x - {x^2}$
${x^2} - 4x + y = 0$
$x = \frac{{4 \pm \sqrt {{{\left( { - 4} \right)}^2} - 4\cdot1\cdot y} }}{{2\cdot1}} = 2 \pm \sqrt {4 - y} $
We notice that the right boundary curve has two branches corresponding to the two signs. From the figure attached we see that the correct choice of $x$ as a right boundary of ${\cal D}$ for $x \ge 2$ is $x = 2 + \sqrt {4 - y} $.
Thus, the domain description is given by
${\cal D} = \left\{ {\left( {x,y} \right)|0 \le y \le 3,y \le x \le 2 + \sqrt {4 - y} } \right\}$
We evaluate the integral of $f\left( {x,y} \right) = x$ over ${\cal D}$ as an iterated integral:
$\mathop \smallint \limits_{}^{} \mathop \smallint \limits_{\cal D}^{} f\left( {x,y} \right){\rm{d}}A = \mathop \smallint \limits_{y = 0}^3 \mathop \smallint \limits_{x = y}^{2 + \sqrt {4 - y} } x{\rm{d}}x{\rm{d}}y$
$ = \frac{1}{2}\mathop \smallint \limits_{y = 0}^3 \left( {{x^2}|_y^{2 + \sqrt {4 - y} }} \right){\rm{d}}y$
$ = \frac{1}{2}\mathop \smallint \limits_{y = 0}^3 \left( {4 + 4\sqrt {4 - y} + 4 - y - {y^2}} \right){\rm{d}}x$
$ = \frac{1}{2}\mathop \smallint \limits_{y = 0}^3 \left( {8 + 4\sqrt {4 - y} - y - {y^2}} \right){\rm{d}}x$
$ = \frac{1}{2}\left( {8y - \frac{8}{3}{{\left( {4 - y} \right)}^{3/2}} - \frac{1}{2}{y^2} - \frac{1}{3}{y^3}} \right)|_0^3$
$ = \frac{1}{2}\left( {24 - \frac{8}{3} - \frac{9}{2} - \frac{{27}}{3} + \frac{{64}}{3}} \right)$
$ = \frac{{175}}{{12}}$