Solution of a double integral I am studying the expectation of a random variable that is given by the following double integral:
\begin{align}
\int_0^\infty\int_0^z\frac{a(j)\beta^zg(z-j)}{F(\beta)}djdz,
\end{align}
where $F(\beta)=\int_0^\infty\beta^x g(x)dx$, $\beta$ is a constant in $[0,1]$, while $g:\mathbb R^+\to\mathbb R$ and $a:\mathbb R^+\to\mathbb R$ are two real functions.
I found on the notes the following step
\begin{align}
\int_0^\infty\int_0^z\frac{a(j)\beta^zg(z-j)}{F(\beta)}djdz=\int_0^\infty a(j)\beta^jdj
\end{align}
and I would like to prove it. My idea is the following
\begin{align}
\int_0^\infty\int_0^z\frac{a(j)\beta^zg(z-j)}{F(\beta)}djdz=\int_0^\infty\int_0^z\frac{a(j)\beta^j\beta^{z-j}g(z-j)}{F(\beta)}djdz
\end{align}
after changing variable: $y:=z-j$ I should get that
\begin{align}
\int_0^\infty\int_0^z\frac{a(j)\beta^j\beta^{z-j}g(z-j)}{F(\beta)}djdz=\int_0^\infty a(j)\beta^jdj\int_0^\infty\frac{\beta^yg(y)}{F(\beta)}dy=\int_0^\infty a(j)\beta^jdj
\end{align}
because of the definition of $F(\beta)$.
Is this correct? What I don't understand well is the change of variable that, if it is correct, changes the double integral into the product of two independent integrals. Is correct that step or I am wrong?
 A: The steps are broadly right but it's unclear if the detail underpinning it is there. For example it's unclear in your solution where the limits come from in the last line.
The integral is over the triangle which is the area between the positive $z$ axis and the line $z=j$. On the left-hand side, we are integrating over $j$ first (i.e. $j$ is on the "inside"). We want to swap the order of integration.
This means we need to change
$$
\int_0^\infty dz \int_0^z dj \rightarrow \int_0^\infty dj \int_j^\infty dz
$$
We can then change variables $z\mapsto z-j$ to do the inner integral, which sums to 1. This is how we lose the second integral.
A: If we understand your integral as following
$$\int\limits_0^\infty\int\limits_0^za(j)\beta^zg(z-j)djdz = \int\limits_0^\infty\left[ \int\limits_0^za(j)\beta^zg(z-j)dj\right]dz=\int\limits_0^\infty\beta^z\left[ \int\limits_0^za(j)g(z-j)dj\right]dz$$
Then for inner one
$$ \int\limits_0^za(j)g(z-j)dj = \left| \begin{array}{l}y=z-j \\ dy=-dj\end{array}\right|=-\int\limits_z^0a(z-y)g(y)dy=\int\limits_0^za(z-y)g(y)dy$$
continuing
$$\int\limits_0^\infty\beta^z\left[ \int\limits_0^za(j)g(z-j)dj\right]dz = \int\limits_0^\infty\beta^z\left[ \int\limits_0^z a(z-y)g(y)dy\right]dz =\\\ = \int\limits_0^\infty \int\limits_y^\infty \beta^z a(z-y)g(y) dzdy$$
