What to do if partial integration yields $\infty-\infty$?

75 Views Asked by At

I have an integral where partial integration yields

$$\begin{aligned}\int_{-\infty}^{\infty}\underbrace{f(x)}_{=u}~\underbrace{\log\left(1+\exp\left(x\right)\right)}_{=V}~\mathrm{d}x &= \left[UV\right]_{-\infty}^{\infty}-\int_{-\infty}^{\infty}Uv~\mathrm{d}x \\ &= \left[F(x)\log\left(1+\exp\left(x\right)\right)\right]_{-\infty}^{\infty}-\int_{-\infty}^{\infty}F(x)\frac{1}{1+\exp\left(-x\right)}~\mathrm{d}x \\ &= \infty-\infty \end{aligned}$$

where $f(x)$ is a pdf and $F(x)$ is a CDF. Numerically, the integral $\displaystyle \int_{-\infty}^{\infty}f(x)\log\left(1+\exp\left(x\right)\right)~\mathrm{d}x$ always yields nice solutions. Is there also a way to fix this problem?

1

There are 1 best solutions below

0
On BEST ANSWER

$V(x)=\log(1+\exp(x))$ is lovely and bounded for $x<0$. For $x>0$ $$V(x)=\log(1+\exp(x))=x+\log(\exp(-x)+1)=x+V(-x).$$ Then $$\int_0^\infty f(x)V(x)\,dx=\int_0^\infty xf(x)\,dx+\int_0^\infty V(-x)f(x)\,dx$$ and $$\int_{-\infty}^0 f(x)V(x)\,dx=\int_{-\infty}^0V(x)f(x)\,dx.$$ Therefore $$\int_{-\infty}^\infty f(x)V(x)\,dx=\int_0^\infty xf(x)\,dx +\int_{-\infty}^\infty V(-|x|)f(x)\,dx.$$ The final integral above is nice and always converges. The integral of $xf(x)$ may or may not converge, but certainly does when the associated random variable $X$ has $E(|X|)<\infty$. It will diverge if say $X$ is a Cauchy RV.