We've been taught that you can change the order of integrations and it doesn't change the result (for common functions). However, this doesn't seem to be the case:
$$\int_{0}^{3} \int_0^1 3(x-1)^2 + (y-2)^2+2 \,dx\,dy \neq \int_{0}^{1} \int_0^3 3(x-1)^2 + (y-2)^2+2 \,dy\,dx$$
The result of the first one is $12$ while the second one equals $6$. Why doesn't it work here?
\begin{align} \int_{0}^{1} \int_0^3 3(x-1)^2 + (y-2)^2+2 \,dy\,dx & = \int_{0}^{1} \left.\left[3y(x-1)^2 + \frac{(y-2)^3}{3}+2y\right]\right|_0^3 dx \\ & = \int_{0}^{1} 9(x-1)^2 -\frac{1}{3}+6-\frac{8}{3} \,dx \\ & = \int_{0}^{1} 9(x-1)^2 + 3 \,dx \\ & = 3\int_{0}^{1} 3(x-1)^2 + 1 \,dx \\ & = 3\Big[(x-1)^3 + x\Big]\bigg|_0^1dx \\ & = 3 + 3 \\[0.3ex] & = 6 \end{align}