Evaluating integral using Beta and Gamma functions. 
$$\int_0^{\infty} x^{-3/2} (1 - e^{-x})\, dx$$

Evaluate the above integral with the help of Beta and Gamma functions. I'm badly stuck. I'm getting Gamma of a negative number and have no clue how to proceed further. Please help me!
For your reference, answer is $2\sqrt{\pi}$.
 A: You can just use ordinary integration by part. It works because
$1-e^{-x} \sim O(x)$ for small $x$ and hence $\lim\limits_{x\to0+}x^{-1/2}(1-e^{-x}) = 0$.
Everything else is relatively standard.
$$\begin{align}
\int_0^\infty x^{-3/2} (1-e^{-x}) dx
&= \int_0^\infty (1-e^{-x}) d( -2x^{-1/2})\\
&= \big[ -2x^{-1/2} (1-e^{-x})\big]_0^\infty + 2 \int_0^\infty x^{-1/2} d(1 - e^{-x})\\
&= 2 \int_0^\infty x^{-1/2} e^{-x} dx = 2\Gamma\left(\frac12\right) = 2\sqrt{\pi}
\end{align}
$$
The moral of the story is when dealing with integral that contains divergence pieces in the integrand, pay attention to the grouping of individual pieces. Maintaining the right grouping avoids the headache of dealing with infinities at the end.
A: As you noted, the integrals $\int_0^\infty x^{-3/2}dx$ and $\int_0^\infty x^{-3/2}e^{-x}dx$ both diverge due to a singularity in $0$. The reason for this is that the exponent $-\frac32$ is too deep below $0$, making the integrals diverge. For the sake of making this exponent higher, we could try partial integration, and introducing an additional factor $x$. Hopefully this will turn $x^{-3/2}$ into $x^{-1/2}$, which would give rise to converging integrals of the type $\int_0^\infty x^{-1/2}e^{-x}dx$. Let's see where it brings us...
Of course, to make partial integration possible, we'll have to write
$$\int_0^\infty x^{-3/2}(1-e^{-x})dx=\lim_{a\to0}\lim_{b\to\infty}\int_a^bx^{-3/2}(1-e^{-x})dx.$$
As suggested, we'll do partial integration with $u=x^{-3/2}(1-e^{-x})$ and $v=x$. This gives
$$\begin{align}\int_a^bx^{-3/2}(1-e^{-x})dx
&=\left[uv\right]_a^b-\int_a^bu'vdx\\
&=\left[x^{-1/2}(1-e^{-x})\right]_a^b\\&\qquad-\int_a^b\left(-\frac32x^{-5/2}(1-e^{-x})\cdot x+x^{-3/2}e^{-x}\cdot x\right)dx.\end{align}$$
Note how the original integral re-appears in the RHS, with an additional factor $\frac32$. I guess you know how to deal with that: if we name our integral $I_a^b$, we can write
$$I_a^b=\left[x^{-1/2}(1-e^{-x})\right]_a^b+\frac32I_a^b-\int_a^bx^{-1/2}e^{-x}dx.$$
As we hoped, $x^{-3/2}$ has turned into $x^{-1/2}$! We have
$$\frac12I_a^b=\int_a^bx^{-1/2}e^{-x}dx-\left[x^{-1/2}(1-e^{-x})\right]_a^b.$$
We're almost done, it remains to take the limits $a\to0$ and $b\to\infty$:
$$\begin{align}\frac12I_0^\infty&=\int_0^\infty x^{-1/2}e^{-x}dx-\lim_{b\to\infty}\frac{1-e^{-b}}{\sqrt b}+\lim_{a\to0}\frac{1-e^{-a}}{\sqrt a}\\
&=\Gamma\left(\frac12\right)-0+0\end{align}$$
where L'Hopital's rule was used for the second limit. Hence
$$\int_0^\infty x^{-3/2}(1-e^{-x})dx=2\sqrt\pi.$$
