Answer
The iterated integral after changing the order of integration:
$\mathop \smallint \limits_0^{\pi /2} \mathop \smallint \limits_0^1 x\cos \left( {xy} \right){\rm{d}}y{\rm{d}}x$
Evaluate:
$\mathop \smallint \limits_{x = 0}^{\pi /2} \left( {\mathop \smallint \limits_{y = 0}^1 x\cos \left( {xy} \right){\rm{d}}y} \right){\rm{d}}x = 1$
Since there is a $x$ variable inside of the cosine function, we would have to use Integration by Parts to evaluate the original integral. However, by changing the order of integration, we achieved a simple and easier computation.
Work Step by Step
We have $\mathop \smallint \limits_0^1 \mathop \smallint \limits_0^{\pi /2} x\cos \left( {xy} \right){\rm{d}}x{\rm{d}}y$.
From the limits of the integrals we obtain the domain description:
${\cal D} = \left\{ {\left( {x,y} \right)|0 \le y \le 1,0 \le x \le \frac{\pi }{2}} \right\}$
Notice that this is a horizontally simple region.
Using this description we sketch the the domain of integration. Please see the figure attached.
We change the order of integration such that the domain becomes a vertically simple region. In this case, the left and right boundaries are $x=0$ and $x = \pi /2$, respectively. Whereas, the lower boundary is $y=0$ and the upper boundary is $y=1$. So, the new domain description:
${\cal D} = \left\{ {\left( {x,y} \right)|0 \le x \le \frac{\pi }{2},0 \le y \le 1} \right\}$
So, the iterated integral after changing the order of integration:
$\mathop \smallint \limits_0^{\pi /2} \mathop \smallint \limits_0^1 x\cos \left( {xy} \right){\rm{d}}y{\rm{d}}x$
Next, we evaluate this integral:
$\mathop \smallint \limits_{x = 0}^{\pi /2} \left( {\mathop \smallint \limits_{y = 0}^1 x\cos \left( {xy} \right){\rm{d}}y} \right){\rm{d}}x$
$ = \mathop \smallint \limits_{x = 0}^{\pi /2} \left( {\sin \left( {xy} \right)|_0^1} \right){\rm{d}}x$
$ = \mathop \smallint \limits_{x = 0}^{\pi /2} \sin x{\rm{d}}x$
$ = - \left( {\cos x|_0^{\pi /2}} \right)$
$ = 1$
Suppose that we evaluate the integral without changing the order of the integration, that is, holding $y$ constant and evaluate the inner integral first with respect to $x$, that is
$\mathop \smallint \limits_0^1 \mathop \smallint \limits_0^{\pi /2} x\cos \left( {xy} \right){\rm{d}}x{\rm{d}}y$
Since, there is a $x$ variable inside of the cosine function, we would have to use Integration by Parts to evaluate the inner integral. However, by changing the order of integration, we achieved a simple and easier computation.