How to change the order of integration when limit is a function? Consider the double integral:
$A=\displaystyle\int_0^5   \left(     \int_0^7    {x'}^2x^3   dx    \right)   dx'$
We can change the order of integration:
$B=\displaystyle\int_0^7   \left(     \int_0^5    {x'}^2x^3   dx'    \right)   dx$

Now consider another double integral:
$C=\displaystyle\int_0^5   \left(     \int_0^{x'}    {x'}^2x^3   dx    \right)   dx'$
How shall one change the order of this integral, i.e. when the limit is a function?


EDIT (Generalization)
Now consider another double integral:
$D=\displaystyle\int_0^5   \left(     \int_0^{f(x')}    {x'}^2x^3   dx    \right)   dx'$
How shall one change the order of this integral, i.e. when the limit is an arbitrary function $f(x')$?

 A: Often, as in your case, a picture is very helpful:

You see immediately $0\leq x \leq 5, x \leq x' \leq 5$.
A: Same as what @metamorphy said:
You should find appropriate limit for $x'$ by $x$:
$$C = \int_0^5   \left(     \int_x^5    {x'}^2x^3   dx'    \right)   dx$$
In fact you integrate on a triangle of points $(0,0),(0,5),(5,5)$, by order of $(x,x')$, as @trancelocation showed it in graph.
A: For its generalization, in fact you need to solve this:
$$x \leqslant f(x') \Longrightarrow g(x) \leqslant x'$$
At first look, it may seems that $g=f^{-1}$ is the solution! It isn't true always, but we can do it by some prework. The above conclusion is true for $g=f^{-1}$, if $f$ be an increasing function in which domain we want to solve that inequality. And when it be decreasing function, just reverse the direction to get answer. So in fact we need to break the domain $0 \leqslant x' \leqslant 5$ to some $a_i \leqslant x' \leqslant b_i$ for $1 \leqslant i \leqslant n$ such that $a_1=0, b_i=a_{i+1}, b_n=5$ such that all $a_i,b_i$ are optimum points of $f$ that it's monotone in every interval. After that you can change order of integral, but you need to break it over intervals that expressed.
