Invert double integral I'm trying to reverse the order of integration of the following double integral:
$$\int _0^2\int _x^{2x}x^2dydx$$
I am aware that it is not possible to invert all double integrals, but my teacher told me this one can be inverted. I believe he is wrong but I want to make sure about that. I would highly appreciate if anyone can help me with this.
 A: The region of integration is a triangle. Crudely drawn here:
         (2,4)
         (2,2)
(0,0)

To reverse the order, $y$ would run from $0$ to $4$. 
Within that, $x$ would at first run from $y/2$ to $y$. But halfway up, $x$ would start running from $y/2$ to $2$. Most people would break up the integral in two: $$\int_{y=0}^2\int_{x=y/2}^y+\int_{y=2}^4\int_{x=y/2}^2$$
You could express it as a single integral like $$\int_{y=0}^4\int_{x=y/2}^{f(y)}$$ where $f$ is a piecewise function that changes behavior at $y=2$. $$f(y)=\begin{cases}y/2&y\leq2\\2&y>2\end{cases}$$ You can be "clever" and find this way to express the same function $$f(y)=\frac{y+2-|y-2|}{2}$$ So you have $$\int_{y=0}^4\int_{x=y/2}^{\frac{y+2-|y-2|}{2}}$$
A: When reversing the order of integration the integral has two sets of bounds for different regions in the original bounds. The final answer becomes
$$\int_0^2\int_{y/2}^{y} x^2 \mathrm{d}x\mathrm{d}y+\int_2^4\int_{y/2}^2 x^2 \mathrm{d}x\mathrm{d}y$$
I would draw a graph of
$$x\le y\le 2x$$
$$0\le x \le 2$$
in order to understand this.
