# Evaluate $\int_0^{\infty} x p^xe^{\Large-\frac{x}{a}}\ dx$

I need to evaluate the integral:

$$\int_0^{\infty} x p^xe^{\Large-\frac{x}{a}}\ dx$$

for $0<p<1$. Unfortunately I do not know where to begin. I tried integration by parts but got nowhere so I would appreciate some help.

Thank you.

Write $p^x$ as $e^{x\ln p}$, then \begin{align} \int_0^{\infty} e^{\Large-\frac{x}{a}} x p^x\ dx&=\int_0^{\infty} e^{\Large-\frac{x}{a}} x e^{\large x\ln p}\ dx\\ &=\int_0^\infty xe^{\Large-x\left(\frac{1}{a}-\ln p\right)}\ dx \end{align} Let $u=x\left(\frac{1}{a}-\ln p\right)$, then \begin{align} \int_0^\infty xe^{\Large-x\left(\frac{1}{a}-\ln p\right)}\ dx&=\frac{1}{\left(\frac{1}{a}-\ln p\right)^2}\int_0^\infty ue^{-u}\ du\\ &=\frac{a^2}{(1-a\ln p)^2}\Gamma(2)\\ &=\frac{a^2}{(1-a\ln p)^2} \end{align} where $\displaystyle\int_0^\infty ue^{-u}\ du$ can be evaluated by using integration by parts or using gamma function.

• Very helpful, thank you. Jun 2, 2014 at 15:05
• Your substitution misses an extra factor, examples show my answer is correct. Jun 2, 2014 at 15:14
• @JohnFernley I know that and I fixed it but you no need to downvote my answer. You at least can comment to ask me to fix it ┻━┻ ︵ヽ(`▭´)ﾉ︵ ┻━┻ Jun 2, 2014 at 15:18

$$\int_0^{\infty} e^{-x/a} x p^x dx = \int_0^{\infty} e^{-x/a} x e^{x \log p} dx = \int_0^{\infty} x e^{x(\log p -1/a)} dx = \frac{1}{(\log p -1/a)^2}$$

This is using this bit of integration by parts and assuming $\log p < 1/a$

Your integral is equivalent to:

$$\int_{0}^{\infty}xe^{bx}\mathrm{d}x,$$

where $b=\dfrac{-1}{a}+\log p$.


$$\color{#66f}{\large\int_{0}^{\infty}x\,p^{x}\expo{-x/a}\,\dd x ={1 \over \bracks{\ln\pars{p} - 1/a}^{2}}}\,,\qquad 0 <\verts{p\expo{-1/a}} < 1$$

• VERY nice! Thank you. Jul 2, 2014 at 20:18
• @JohnK You're welcome. Thanks. Jul 2, 2014 at 20:21