How to integrate this equation

226 Views Asked by At

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!

2

There are 2 best solutions below

11
On BEST ANSWER

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.

3
On

The second one is easy (with $x-1=t^2$) : $$\int_0^{\infty} \frac1{\sqrt{t^2}} e^{-t^2} 2t\ dt=2\int_0^{\infty}e^{-t^2}dt=\sqrt{\pi}$$

The first one (with $1-x=t^2$) gives : $$-\int_1^0 \frac1{\sqrt{t^2}} e^{-t^2} 2t\ dt=2\int_0^1 e^{-t^2}dt= \sqrt{\pi} \ \mathrm{erf}(1)$$ by definition of the error function