# Changing the order of integration using Heaviside step function

I am trying to change the order of integration for the double integral below using the Heaviside step function. I'm following the example given in this answer.

So far:

\begin{eqnarray*} \int_{\frac{1}{4}}^{\frac{1}{2}}\int_{\frac{1}{4}}^{y_1}f\left(y_1, y_2\right)\,{\rm d}y_2\,{\rm d}y_1 & = & \int_{\frac{1}{4}}^{\frac{1}{2}}\left\lbrack\int_{\frac{1}{4}}^{1}\Theta\left(y_1 - y_2 \right) {\rm f}\left(y_1, y_2\right)\,{\rm d}y_2\right\rbrack{\rm d}y_1 \\ & = & \int_{\frac{1}{4}}^{1}\left\lbrack\int_{\frac{1}{4}}^{\frac{1}{2}}\Theta\left(\_\_\_\_\right) {\rm f}\left(y_1, y_2\right)\,{\rm d}y_1\right\rbrack{\rm d}y_2 \end{eqnarray*}

I am not sure what to do with $\Theta\left(y_1 - y_2 \right)$ at this point.

\begin{align} \int_{\frac 14}^{\frac 12} \int_{\frac 14}^{y_1} f(y_1,y_2)dy_2dy_1 = \int_{\frac 14}^{\frac 12} \int_{\frac 14}^{1} \Theta(y_1-y_2)f(y_1,y_2)dy_2dy_1 \\ = \int_{\frac 14}^{1} \int_{\frac 14}^{\frac 12} \Theta(y_1-y_2)f(y_1,y_2)dy_1dy_2 \tag{Fubini} \\ = \int_{\frac 14}^{\frac 12} \int_{y_2}^{\frac 12} f(y_1,y_2)dy_1dy_2 \tag{simplified $\Theta$} \end{align}
Note that the $1$, which is the upper limit of one of the integrals, plays no special role, really. In the last step, when we simplify $\Theta(y_1-y_2)$, this is $1$ only when $y_1 \geq y_2$. But we are only letting $y_1$ vary between $\frac 14$ and $\frac 12$, so if $y_2$ is for example $\frac 23$ then the inner integral will just be zero in the second step. That's why I had to adjust the outer limit also to account for the simplification of $\Theta$. But the answer is right.
• So the upper limit, instead of 1 would depend on the bounds of $y_2$? Dec 11 '17 at 5:15
• What if the bounds were say, something like: $0 \leq y \leq 1$, $1 \leq x \leq e^{y}$. How do I determine the bounds exactly for the Heavside function? I think that's what I'm having trouble understanding. Dec 11 '17 at 5:42