changing the order of Integration weirdly So far what I understood is if your limits are some constant, you can find the volume under a function f(x,y) is $\begin{equation}
\int_{c}^{d} \int_{a}^{b}f(x,y) \,dx\,dy
\end{equation}$
and it is equal to $\begin{equation}
\int_{a}^{b} \int_{c}^{d}f(x,y) \,dy\,dx
\end{equation}$
And if you have a variable limit its not always equal. But I came across a problem which looks like this:
$\begin{equation}
\int_{0}^{1} \int_{x}^{x+2}f(x,y) \,dx\,dy
\end{equation}$
And here I am completely lost. I thought the question doesn't make any sense. As you can see the x limit is from x to x+2. why the x limit is not in y? How can I even draw the limit of x and x+2 in x-axis?
But in textbook they simply solved it by changing the order of Integration.
$\begin{equation}
\int_{0}^{1} \int_{x}^{x+2}f(x,y) \,dx\,dy
\end{equation}$ = $\begin{equation}
\int_{0}^{1} \int_{x}^{x+2}f(x,y) \,dy\,dx
\end{equation}$
And now the question looks normal. But can we just change the dx and dy anytime we want? I am completely lost here. Please help me!
Here is the actual question and the answer in a handwritten note that my teacher sent me.


I would also be completely lost. The inner integral of $\int_x^{x+2} f(x, y) dx$ makes little sense. However, the integral $\int_x^{x+2}f(x, y) dy$ is sensible. I suspect it was a typo and they from the start meant
$$
\int_0^1\left(\int_x^{x+2}f(x, y)dy\right)dx
$$
Assuming $f$ is nicely behaved, and we really want to, we can swap the order of integration and get that the above integral is equal to
$$
\int_0^3\left(\int_{\max(0, y-2)}^{\min(y, 1)}f(x, y)dx\right)dy
$$
In general you can't just interchange $dx$ and $dy$ in a nested integral like that without changing the limits, and you certainly cannot do that in the two examples you've shown.
