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!

  • $\begingroup$ Integration by parts, haven't tried that but looks like it should work! Also, these integrals might have come up in Probability but they are questions about integrals more than about Probability. So I have retagged. May be this is related to $\Gamma$ integrals in the form of $\Chi^2(n)$ distibutions $\endgroup$ – user21436 Feb 13 '12 at 23:29
  • 1
    $\begingroup$ "Equation" is another frequently mis-used word. The thing you're trying to integrate is a function. $\endgroup$ – Michael Hardy Feb 13 '12 at 23:40
  • $\begingroup$ In second integral, let $x-1=\frac{u^2}{2}$. Similar substitution for first integral. $\endgroup$ – André Nicolas Feb 13 '12 at 23:41
  • $\begingroup$ thanks for retag Kannappan. Michael, I wasn't trying to say things in the simplest way possible, but I agree with your point. André, can you elaborate? Wouldn't this be applicable to first equation? $\endgroup$ – user1061210 Feb 13 '12 at 23:45

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.

  • $\begingroup$ Thanks, anon. Pretty thorough answer. Does this entire thing integrate to 1? Doesn't look like it with the erf(1) function. $\endgroup$ – user1061210 Feb 14 '12 at 0:34
  • 1
    $\begingroup$ @user1061210: Have you heard of WolframAlpha? Go there and enter Sqrt[Pi]*(1+Erf[1]); the answer is about 3.27. In order to normalize the integral (to evaluate to 1) you need to divide by $\sqrt{\pi}(1+\operatorname{erf}(1))$, obviously. $\endgroup$ – anon Feb 14 '12 at 0:42
  • $\begingroup$ HOLD ON, you meant 1 to infinity on the second integral(latter sum) correct? $\endgroup$ – user1061210 Feb 14 '12 at 2:59
  • $\begingroup$ @user106120: I do not. The map $x\mapsto\sqrt{x-1}$ takes the bounds $[1,\infty)$ and gives us the new bounds $[0,\infty)$. When doing substitutions you always have to pay attention to how the interval of integration changes. The entire reason that second integral is so easily evaluable is because it is just the Gaussian integral. $\endgroup$ – anon Feb 14 '12 at 3:06
  • $\begingroup$ Also, not sure why I called them sums. I've edited that. $\endgroup$ – anon Feb 14 '12 at 3:09

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

  • $\begingroup$ Thanks, Raymond. This is very clear! Also asked the commenter above, does this integrate to 1? If not, I want it to, which would be 1 divided by the result? $\endgroup$ – user1061210 Feb 14 '12 at 0:36
  • $\begingroup$ @user1061210: Thanks! As anon answered very clearly you'll have to divide by $\sqrt{\pi}(1+\mathrm{erf}(1))\ $ if you want $1$. $\endgroup$ – Raymond Manzoni Feb 14 '12 at 0:51
  • $\begingroup$ wait, the bounds you give are not the same as the question. $\endgroup$ – user1061210 Feb 14 '12 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.