How do you change the order of integration without sketching? Specifically, for a double integral $$\int_a^b \int_{g_1(x)}^{g_2(x)} f(x,y) \, dy \, dx$$ how would you change the order of integration without having to sketch it out? I came across this while researching which talks about the use of the Heaviside function, however I am unsure how to apply this process to all double integrals.
Thanks!

\begin{align}
& \int_a^b \int_{g_1(x)}^{g_2(x)} f(x,y) \, dy \, dx \\[10pt]
= {} & \iint\limits_{\begin{array}{c} a\,\le\,x\,\le\,b \\g_1(x) \,\le\,y\,\le\,g_2(x) \end{array}} f(x,y) \, d(x,y) \\[10pt]
= {} & \int_{\min g_1}^{\max g_2} \left(\,\, \int\limits_{x\,\in\,g_1^{-1}(-\infty,y] \,\cap\,g_2^{-1}[y,+\infty)} f(x,y) \, dx \right) \,dy
\end{align}
where $\displaystyle g_1^{-1}(-\infty,y] = \{ x : g_1(x) \le y \},$ and similarly for the other set. (This does not mean that $g_1$ or $g_2$ has an inverse function; it just means one can take the inverse image of a set under a function.)
Without more information about $g_1$ and $g_2,$ I don't think one can be more specific.
