Solving a double integral with infinite bounds with a set of rules on a function with two variables

Here's the problem description:

Let the function $f(x,y)$ be defined by

$f(x)= \begin{cases} g(x)/x,&\text{if}\, 0 < y < x\\ 0, &\text{otherwise} \end{cases}$

where $g(x)$ is a non-negative function defined on $(0, \infty)$ and $\int_{0}^{\infty}$ $g(x) dx = 1$.

Compute $\int_{-\infty}^{\infty}$ $\int_{-\infty}^{\infty}$ $f(x,y)dx dy$

I swear this should be pretty easy but for some reason I'm just stumped. I tried integration first with respect to $dx$ and splitting up the improper integral on the inside from $-\infty$ to $0$ and $0$ to $\infty$... but I just ended up with something that I couldn't really compute.

I'm also not really sure how I'm supposed to use the fact that $\int_{0}^{\infty}$ $g(x) dx = 1$ when I have to integrate $g(x)/x$. I'm guessing I'm pretty rusty on my calc.

I would appreciate it if anyone could help me out here.

HINT: Observe that $$\int_0^x (g(x)/x)\,dy=(g(x)/x)\cdot1\Bigr|_0^x=g(x).$$ Let $D=\{(x,y):0\leq x\leq y\}$. Then $$\int\int_{D}f(x,y)\,dx\,dy=\int_0^\infty g(x)\,dx=1.$$
• Ahh, that makes a lot of sense! But I'm having some trouble actually getting to that step. How would I end up with the bounds $0$ to $x$? Because I'm splitting up the integral on the inside from $-\infty$ to $0$ and $0$ to $\infty$. The $-\infty$ to $0$ part is just equal to $0$, but then I have an integral from $0$ to $\infty$. The good thing now is that I'm integrating with respect to dy, though. Sep 4 '18 at 5:23
• @Kawaiiii The actual domain of integration is an infinite triangle $\{(x,y):0<y<x,0<x<\infty$ and every integral with respect to $y$ gives $g(x)$. Sep 4 '18 at 5:28
• Hmm, I'm really sorry but I'm having a bit of a hard time understanding how every integral with respect to $y$ gives $g(x)$... I get that the domain is an infinite triangle in the first quadrant, but how does that lead to the first statement? Sep 4 '18 at 5:53
• So we're integrating over the region D, with D being an infinite triangle in the first quadrant, but how do we get from that double integral to $\int_0^\infty g(x)\,dx$?... I'm so sorry if I'm being dumb, something just isn't clicking for me for some reason... Sep 4 '18 at 6:20