Let X an Y have the joint density function $f(x,y) and let Z=X-Y$. Show that density function is given by $$ f_z(z)=\int_{-\infty}^\infty f(x,z-x)dx$$
SOLUTION:
$$P(Z \leq z) = \int \int f(x,y)dxdy = \int_{-\infty}^\infty\int_{x-z}^\infty f(x,y)dydx = \int_{-\infty}^\infty \int_z^{-\infty} -f(x,x-v)dvdx $$
These boundaries come from the inequality $X-Y\leq Z$ and a substitution.
However, i do not get How to get to the last step in this section? I do not understand the boundaries $\int_z^{-\infty}$ and the negative sign.
$\int_a^{b} g(v)\, dv =-\int_ b^{a} g(v) \, dv$ when $b<a$. So the right side is $\int_{-\infty} ^{\infty} \int_{-\infty} ^{z} f(x,x-v)\, dv\, dx = \int_{-\infty} ^{z} \int_{-\infty} ^{\infty} f(x,x-v)\, dv\, dx$ from which the result follows.