How to integrate $\displaystyle 1-e^{-1/x^2}$ ?

as hint is given: $\displaystyle\int_{\mathbb R}e^{-x^2/2}=\sqrt{2\pi}$

If i substitute $u=\dfrac{1}{x}$, it doesn't bring anything:



How to continue ?

$\textbf{The original exercise was}$:

If a probability has a density $f(x)=C(1-e^{-1/x^2})$ then determine the value of constant $C$

Since $\displaystyle\int f\overset{!}=1$, i thought first to calculate the expression above.

($\textbf{ATTENTION:}$ Question edited from integrating $e^{-1/x^2}$ to integrating $1-e^{-1/x^2}$)

  • $\begingroup$ See this. $\endgroup$ – Git Gud Mar 20 '14 at 15:48
  • 1
    $\begingroup$ @Git Gud No gamma function please. $\endgroup$ – derivative Mar 20 '14 at 15:52
  • $\begingroup$ the value of the integral $ \int_{0}^{\infty} e ^{- u^2}$ is $\sqrt{\pi} / 2$ , if i dont forget. (but i dont remenber how to evaluate )) $\endgroup$ – math student Mar 20 '14 at 15:54
  • 2
    $\begingroup$ In your integration by parts, you incorrectly calculated the boundary term to be zero. It's actually infinite, and so your integral diverges. $\endgroup$ – David H Mar 20 '14 at 15:58
  • 1
    $\begingroup$ You definitely need to integrate $1-\exp(\frac {-1}{x^2})$ That one converges. It looks like you should be able to transform it to something involving $\exp(-x^2)$ because the answer is $2\sqrt \pi$ from Alpha $\endgroup$ – Ross Millikan Mar 20 '14 at 16:18

First integrate by part and then substitute $x$ by $1/y$. $$\begin{align} \int_0^\infty (1-e^{-1/x^2})dx &= \left[(1-e^{-1/x^2})x\right]_0^\infty - \int_0^\infty x \left(-\frac{2}{x^3}\right) e^{-1/x^2} dx\\ &= 2\int_0^\infty e^{-y^2} dy = \sqrt{\pi} \end{align} $$

  • $\begingroup$ That's it, just integration by parts. but limits are from $-\infty$ to $\infty$ then everything is ok. $\endgroup$ – derivative Mar 22 '14 at 19:43
  • $\begingroup$ @derivative The $-\infty$ to $\infty$ part is trivial because the integrand is an even function. To make this completely rigorous, you just need to justify why $\lim_{x\to\infty}(1-e^{-1/x^2})x = 0$ and that's it. $\endgroup$ – achille hui Mar 22 '14 at 19:50
  • $\begingroup$ yes, i mean only for the result, $\endgroup$ – derivative Mar 22 '14 at 19:54
  • $\begingroup$ This deserves +50. Of course. +1 upvote! $\endgroup$ – Sangchul Lee Mar 22 '14 at 21:17

Here is another technique of introducing a parameter. Indeed, let us consider the integral

$$ I(s) = \int_{-\infty}^{\infty} (1 - e^{-s/x^{2}}) \, dx $$

instead. We then want to find the value if $I(1)$. To this end, we calculate $I'(s)$ and appeal to the Fundamental Theorem of Calculus.

We first simplify $I(s)$ by using change of variable. Let $u = 1/x$. Then by symmetry,

$$ I(s) = 2\int_{0}^{\infty} (1 - e^{-s/x^{2}}) \, dx = 2\int_{0}^{\infty} \frac{1 - e^{-su^{2}}}{u^{2}} \, du. $$

Then we differentiate both sides with respect to $s$. Exploiting Leibniz's integral rule yields

$$ I'(s) = 2\int_{0}^{\infty} \frac{\partial}{\partial s} \frac{1 - e^{-su^{2}}}{u^{2}} \, du = 2\int_{0}^{\infty} e^{-su^{2}} \, du. $$

Now with the additional substitution $v = \sqrt{2s}u$ (where $s > 0$), we have

$$ I'(s) = \sqrt{\frac{2}{s}} \int_{0}^{\infty} e^{-v^{2}/2} \, dv = \frac{1}{\sqrt{2s}} \int_{-\infty}^{\infty} e^{-v^{2}/2} \, dv = \sqrt{\frac{\pi}{s}}. $$

But it is trivial that $I(0) = 0$ (since the integrand vanishes identically). Therefore by the Fundamental Theorem of Calculus,

$$ I(1) = I(0) + \int_{0}^{1} I'(s) \, ds = \int_{0}^{1} \sqrt{\frac{\pi}{s}} \, ds = \left. 2\sqrt{\pi s} \vphantom{\int} \right|_{0}^{1} = 2\sqrt{\pi}. $$

  • $\begingroup$ @achillehui, Thank you! Writing in $\TeX$ is always sort of multitasking, and it often leads me to make some typos. :( $\endgroup$ – Sangchul Lee Mar 22 '14 at 19:35
  • $\begingroup$ looks nice, but if $u=1/x$ then $du=-1/x^2dx=-u^2dx$ you forgot the sign, but this doesn't change anything. $\endgroup$ – derivative Mar 22 '14 at 19:37
  • $\begingroup$ @derivative when one substitute $u = 1/x$, the extra minus sign in $du$ is canceled when you flip the integration limits back from $\int_{\infty}^0$ to $\int_0^{\infty}$. $\endgroup$ – achille hui Mar 22 '14 at 19:40
  • $\begingroup$ @achillehui aha didn't noticed. Thanks $\endgroup$ – derivative Mar 22 '14 at 19:41

Hint: What is $\lim_{x\rightarrow \infty}e^{{-1}/{x^2}}$ ?

  • $\begingroup$ I really don't see how this helps in evaluating the integral. $\endgroup$ – Guy Mar 20 '14 at 15:58
  • $\begingroup$ @Sabyasachi i think he is telling about the boundary term which is infinite but in the question he made it zero $\endgroup$ – happymath Mar 20 '14 at 15:59
  • $\begingroup$ @happymath still the original integral remains unsolved. this points out a flaw in the current process. Doesn't show an alternative though. $\endgroup$ – Guy Mar 20 '14 at 16:03
  • $\begingroup$ Oh wait the integral diverges. I see. $\endgroup$ – Guy Mar 20 '14 at 16:05
  • $\begingroup$ @Sabyasachi you are right and also the integral diverges that is what i guess he wants to tell $\endgroup$ – happymath Mar 20 '14 at 16:05













$=4\int_0^\infty e^{-x^2}~dx$


$\therefore C=\dfrac{1}{2\sqrt\pi}$

  • $\begingroup$ Sorry, and thanks for your efforts, but i had to change the problem, it was a mistake of me. $\endgroup$ – derivative Mar 20 '14 at 17:09
  • $\begingroup$ So you edited it. I think you did everything correct, and came close to the result, but something is missing... $\endgroup$ – derivative Mar 21 '14 at 11:03

The integral $$\int_{-\infty}^\infty \exp(-1/x^2)dx$$diverges, because $\exp(-1/x^2)\ge \frac 1e$ whenever $|x|>1$ and hence $$\int_{-\infty}^\infty \exp(-1/x^2)dx> 2\int_1^\infty \frac{dx}{e}=+\infty. $$


$$\int_0^\infty\bigg(1-e^{^{-\tfrac1{x^2}}}\bigg)dx=\sqrt\pi.$$ This can relatively easily be proven by letting $t=e^{^{-\tfrac1{x^2}}}$, and then using Euler's initial logarithmic expression for the $\Gamma$ function. But you said that this is apparently not allowed and I'm afraid that I don't know any other approaches either. :-(

  • $\begingroup$ everything is allowed, but i don't think that i will understand it. $\endgroup$ – derivative Mar 20 '14 at 23:00
  • 1
    $\begingroup$ The first part of your sentence sounds kinda funny when taken out of context. :-) As for the second part, might this be of any help ? $\endgroup$ – Lucian Mar 20 '14 at 23:19
  • $\begingroup$ Interesting but i still can't see it. $\endgroup$ – derivative Mar 20 '14 at 23:38

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.