How to change the order of integration when limit is a function?

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

region of integration

You see immediately $0\leq x \leq 5, x \leq x' \leq 5$.


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.


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.