Changing the order of integration - verify strange limits of integration I have been trapped by the following, most probably very simple situation: I have the integral
$$I = \int_0^{\infty} f(x) \int_{-\infty}^{ax +b}h(y) dy dx,\;\;\; a>0, b\in\mathbb R$$
and assume any regularity condition required.
Now, I need to change the order of integration. One moment it appears that I should write
$$I = \int_{-\infty}^{\infty} h(y) \int_{\max\{(y-b)/a,\,0\}}^{\infty}f(x) dxdy $$
but the next  moment the picture changes to 
$$I = \int_{b}^{\infty} h(y) \int_{(y-b)/a}^{\infty}f(x) dxdy $$
The following moment, both make no sense to me. And the cycle repeats. Too tired, obviously. Any help or hints?
 A: If you draw the region of integration, 
there is a line $y = ax+b$ that crosses the $y$-axis,
and the region of integration is everything under this line and to the right
of the $y$-axis.
For the integral
$\iint dy\,dx$ it seems relatively straightforward
to get the limits of the inner integral:
at each value $x$ you take the vertical line through $(x,0)$
and integrate on the part of that vertical line that is below $y=ax+b.$
But if you change the order of integration to $\iint dx\,dy,$
now for each $y$ you integrate on some part of a horizontal line
through $(0,y)$
on the right side of the $y$ axis but also under the line $y=ax+b.$
The tricky thing is, when $a>0$ the points underneath $y=ax+b$
are to the right of $y=ax+b,$
so the portion of each horizontal line that you integrate over is whatever
is both to the right of the $y$-axis and also to the right of $y=ax+b.$
That is, in the region of integration you have two conditions that are
always simultaneously true: $x \geq 0$ and $x \geq (y-b)/a.$
You can write this as $x \geq \max\{(y-b)/a, 0\}.$
But any value of $y$ can be found in the region of integration
(as long as you pair it with a large enough $x$), so
\begin{align}
I &= \int_0^\infty f(x) \int_{-\infty}^{ax +b} h(y)\, dy\, dx \\[.8ex]
&= \int_{-\infty}^\infty h(y) \int_{\max\{(y-b)/a,0\}}^\infty f(x)\,dx\,dy
\\[.8ex]
&= \int_{-\infty}^b h(y) \int_0^\infty f(x)\, dx\,dy
    + \int_{b}^{\infty} h(y) \int_{(y-b)/a}^{\infty}f(x) \,dx\,dy.
\end{align}
So your integral
$\int_{b}^{\infty} h(y) \int_{(y-b)/a}^{\infty}f(x) \,dx\,dy$
is not exactly wrong, but it only tells you about the part of the region of integration above the line $y=b,$
and you also have to integrate below that line.
