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

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:

$\,\displaystyle\int\limits_{-\infty}^{\infty}\left(1-e^{-1/x^2}\right)dx=\int\limits_{-\infty}^{0}\left(1-e^{-1/x^2}\right)dx+\int\limits_{0}^{\infty}\left(1-e^{-1/x^2}\right)dx\overset{?}=2\int\limits_{0}^{\infty}\left(1-\frac{e^{-u^2}}{-u^2}\right)du$

$2\displaystyle\int\limits_{0}^{\infty}\left(1-\frac{e^{-u^2}}{-u^2}\right)du=?$

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}$)

• See this. – Git Gud Mar 20 '14 at 15:48
• @Git Gud No gamma function please. – derivative Mar 20 '14 at 15:52
• 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 )) – math student Mar 20 '14 at 15:54
• In your integration by parts, you incorrectly calculated the boundary term to be zero. It's actually infinite, and so your integral diverges. – David H Mar 20 '14 at 15:58
• 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 – 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}

• That's it, just integration by parts. but limits are from $-\infty$ to $\infty$ then everything is ok. – derivative Mar 22 '14 at 19:43
• @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. – achille hui Mar 22 '14 at 19:50
• yes, i mean only for the result, – derivative Mar 22 '14 at 19:54
• This deserves +50. Of course. +1 upvote! – 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}.$$

• @achillehui, Thank you! Writing in $\TeX$ is always sort of multitasking, and it often leads me to make some typos. :( – Sangchul Lee Mar 22 '14 at 19:35
• looks nice, but if $u=1/x$ then $du=-1/x^2dx=-u^2dx$ you forgot the sign, but this doesn't change anything. – derivative Mar 22 '14 at 19:37
• @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}$. – achille hui Mar 22 '14 at 19:40
• @achillehui aha didn't noticed. Thanks – derivative Mar 22 '14 at 19:41

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

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

$\int\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=\int\left(1-\sum\limits_{n=0}^\infty\dfrac{(-1)^nx^{-2n}}{n!}\right)dx$

$=\int-\sum\limits_{n=1}^\infty\dfrac{(-1)^nx^{-2n}}{n!}dx$

$=-\sum\limits_{n=1}^\infty\dfrac{(-1)^nx^{1-2n}}{n!(1-2n)}+c$

$=\sum\limits_{n=1}^\infty\dfrac{(-1)^n}{n!(2n-1)x^{2n-1}}+c$

$\because\int_{-\infty}^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=\int_{-\infty}^0\left(1-e^{-\frac{1}{x^2}}\right)dx+\int_0^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=\int_\infty^0\left(1-e^{-\frac{1}{(-x)^2}}\right)d(-x)+\int_0^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=\int_0^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx+\int_0^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=2\int_0^\infty\left(1-e^{-\frac{1}{x^2}}\right)dx$

$=2\int_\infty^0\left(1-e^{-x^2}\right)d\left(\dfrac{1}{x}\right)$

$=2\left[\dfrac{1-e^{-x^2}}{x}\right]_\infty^0-2\int_\infty^0\dfrac{1}{x}d\left(1-e^{-x^2}\right)$

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

$=2\sqrt\pi$

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

• Sorry, and thanks for your efforts, but i had to change the problem, it was a mistake of me. – derivative Mar 20 '14 at 17:09
• So you edited it. I think you did everything correct, and came close to the result, but something is missing... – 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. :-(

• everything is allowed, but i don't think that i will understand it. – derivative Mar 20 '14 at 23:00
• 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 ? – Lucian Mar 20 '14 at 23:19
• Interesting but i still can't see it. – derivative Mar 20 '14 at 23:38