$$\int \int y^2\sin(x^2+y^2)dxdy$$ calculate over D region which is defied as :
$D:{(x,y) x^2+y^2\leq\pi,|x|\leq y}$
(I sketched the region)
we started to study it today and teacher solved in a very peculiar way..
$y=rsin\theta , x=rcos\theta , 0 \leq r \leq \pi , \pi/4 \leq \theta \leq 3\pi/4 $
coverting the integral to polar coordinates we get:
$$\int_{0}^{\sqrt \pi} \int_{\frac{\pi}{4}}^{\frac{3\pi}{4}}r^2\sin^2\Theta \sin(r^2)r drd\Theta $$ then he did something which I don't fully understand. He wrote the intgral in the following way : $$\int r^3\sin(r^2)dr \int \sin^2\theta d\theta$$ Is it valid to write the integral like this(dividing the integral into 2 inetgrals regarding the fact that there is multiplication in the original integral)?

Yes, it is valid.
If a function $f(x,y)$ can be factored as the product of a function of $x$ and a function of $y$, then we can do that.
Suppose $f(x,y)=g(x)h(y)$ and the double integration is over the domain $R=[a,b]×[c,d]$. From Fubini's Theorem,
$ \iint_Rf(x,y)dA=\int_c^d\int_a^bg(x)h(y)dxdy=\int_c^d\left[\int_a^bg(x)h(y)dx\right]dy $
Observe that in the inner integral, $y$ is a constant, so $h(y)$ is a constant. Therefore, we can write
$ \int_c^d\left[\int_a^bg(x)h(y)dx\right]dy=\int_c^d\left[h(y)\left(\int_a^bg(x)dx\right)\right]dy=\int_a^bg(x)dx\int_c^dh(y)dy $
The last equality is obtained observing $\int_a^bg(x)dx$ is a constant.
Remember, also, that this is generically written for the two dummy variables $x$ and $y$. This is valid for any function of two variables. Particularly in your case, $f(r,\theta)=g(r)h(\theta)$ and the relation still holds.