Integrate $\int_0^\infty \int_0^\infty \frac{\sin \pi x}{(y+e^x|\sin \pi x|)^2}dx \, dy$ using Fubini or Tonelli theorems I am trying to show that this integral 
$$\int_0^\infty \int_0^\infty \frac{\sin \pi x}{(y+e^x|\sin \pi x|)^2}dx \, dy $$ 
exists and is finite and then finding its value.
Since $\sin \pi x$ takes positive and negative values, Tonelli does not apply and hence we should use Fubini. To use Fubini we need to prove that $f(x,y)=\sin \pi x/(y+e^x|\sin\pi x|)^2$ is integrable with respect to $m\times m$ Lebesgue product measure on $[0,\infty)\times [0,\infty)$. Notice that 
\begin{align*}
\int_{[0,\infty)\times [0,\infty)}\dfrac{|\sin \pi x|}{(y+e^x |\sin \pi x|)^2}\,dm(x\times y)&=\int_{[0,\infty)\times [0,\infty)}\dfrac{1}{(\dfrac{y}{\sin^2\pi x}+\dfrac{e^x}{|\sin\pi x|})^2}\,dm(x\times y)\\
&\leq \int_{[0,\infty)\times [0,\infty)}\dfrac{1}{(y+e^x)^2}\,dm(x\times y)
\end{align*}
How can I prove that $f(x,y)$ is integrable? Any other ideas? Maybe we can use Tonellis somehow if we find a region such that $\sin \pi x$ is positive and the double integral of $f(x,y)$ out of this region is $0$? 
 A: I will here focus on finding the value of the integral leaving out the justification of all the steps (which should be filled in). We first switch the order of the integration (this requires Fubini) and integrate over $y$ with the result
$$I = \int_0^\infty \left[-\frac{\sin(\pi x)}{y + e^x|\sin(\pi x)|}\right]_{y=0}^\infty dx = \int_0^\infty \frac{\sin(\pi x)}{|\sin(\pi x)|}e^{-x} dx$$
To evalute the last integral we split $[0,\infty)$ into intervals where $\frac{\sin(\pi x)}{|\sin(\pi x)|} \equiv \text{sign}(\sin(\pi x))$ is constant. This gives
$$I = \int_0^\infty \frac{\sin(\pi x)}{|\sin(\pi x)|}e^{-x} dx = \sum_{n=0}^\infty \int_n^{n+1}(-1)^{n}e^{-x}dx = \sum_{n=0}^\infty (e^{-n}-e^{-(n+1)})(-1)^{n}$$
which is just a geometric series with sum
$$I = \frac{e-1}{e+1}$$
A: Notice that $f(x,y)=1/(y+e^x)^2$ is continuous for all $x,y\in [0,\infty)$, hence $m\times m$-Lebesgue measurable, $f(x,y)\geq 0$ and $([0,\infty),\mathcal{M},m)$ is $\sigma$-finite measure space. Thus by Tonelli's Theorem
\begin{align*}
\int_{[0,\infty)\times [0,\infty)}\dfrac{1}{(y+e^x)^2}\,dm(x\times y)&=\int_0^\infty\int_0^\infty \dfrac{1}{(y+e^x)^2}\,dy\,dx\\
&=\int_0^\infty \dfrac{-1}{y+e^x}\Big|_0^\infty \,dx=\int_0^\infty e^{-x}\,dx=1<\infty.
\end{align*}
Hence the function  $\sin\pi x/(y+e^x|\sin\pi x|)^2$ is integrable and hence Fubini theorem applies. Then continue as Winther did.
