all. I am trying integrate this equation(gamma density). $$\int\limits_0^\infty \frac{1}{\sqrt{\left| x-1 \right|}}\exp \left( -\left| 1-x \right| \right) \;dx$$
What I have done is split it into 2 cases, but stuck on integrating with square root.
$$f(x)= \begin{cases} \int\limits_{0}^{1}{\frac{1}{\sqrt{1-x}}\exp \left( -(1-x) \right)}\;dx & x<1 \\ \int\limits_{1}^{\infty }{\frac{1}{\sqrt{x-1}}\exp \left( -(x-1) \right)}\;dx & x>1 \\ \end{cases}$$
How do I integrate each one? Thanks!
In the former integral, the substitution $u=\sqrt{1-x}$ gives
$$\int_1^0 e^{-u^2}(-2du)=\sqrt{\pi}\operatorname{erf}(1). $$
In the latter integral, the substitution $u=\sqrt{x-1}$ gives
$$\int_0^\infty e^{-u^2}(2du)=\sqrt{\pi}.$$
Put them together and we have $\sqrt{\pi}\big(1+\operatorname{erf}(1)\big)$. Here $\operatorname{erf}$ is the error function.