Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

The Maple code

int(exp(-z^2*sin(z)^2), z = 0 .. infinity, numeric, epsilon = 0.1e-1) 

outputs $2.835068335 $. However, I am not sure if the answer is correct.

$$ I = \int_0^{\infty}{e^{ - z^2 \sin^2(z)}} \text{d}z $$

PS. Does that integral converge at all?

share|improve this question
You'd expect someone with 170 answers and 53 other questions to know how to use LaTeX, but no. –  A little lime Apr 18 at 17:06
@alittle LaTeX isn't what is wanted here, since the displayed formula is actually a literal input to Maple. Formatting it with LaTeX would obscure the actual input string. –  MJD Apr 18 at 17:08
Suppose there were something syntactically or semantically wrong with the Maple code so that it was not in fact producing the desired value. Transforming it into LaTeX would prevent anyone familiar with Maple from seeing that. –  MJD Apr 18 at 17:11
@MJD I'm not saying delete the code, I'm saying he/she could at least have given a LaTeXed version of the integral so us non-Maple folk can actually read the question without deciphering code. –  A little lime Apr 18 at 17:13
Here is the one in the TEX form: $$\int\limits_0^\infty e^{-z^2\sin^2(z)}\,dz $$. –  user64494 Apr 18 at 17:25

2 Answers 2

up vote 8 down vote accepted

When integrating $$ \int_0^\infty e^{-z^2\sin^2(z)}\,\mathrm{d}z $$ the problem points are near $z=k\pi$ where $\sin^2(z)$ vanishes.

On $[(k-1/2)\pi,(k+1/2)\pi]$ $$ \begin{align} \int_{(k-1/2)\pi}^{(k+1/2)\pi} e^{-z^2\sin^2(z)}\,\mathrm{d}z &=\int_{-\pi/2}^{\pi/2}e^{-(z+k\pi)^2\sin^2(z)}\,\mathrm{d}z\tag{1}\\ &\ge\int_{-\pi/2}^{\pi/2}e^{-(k+1/2)^2\pi^2z^2}\,\mathrm{d}z\tag{2}\\ &=\frac1{(k+1/2)\pi}\int_{-(k+1/2)\pi^2/2}^{(k+1/2)\pi^2/2} e^{-z^2}\,\mathrm{d}z\tag{3}\\ &\sim\frac1{(k+1/2)\sqrt\pi}\tag{4} \end{align} $$ Explanation:
$(1)$: substitute $z\mapsto z+k\pi$
$(2)$: $(z+k\pi)^2\le(k+1/2)^2\pi^2$ and $\sin^2(z)\le z^2$
$(3)$: substitute $z\mapsto\frac{z}{(k+1/2)\pi}$
$(4)$: $\lim\limits_{k\to\infty}\int_{-(k+1/2)\pi^2/2}^{(k+1/2)\pi^2/2} e^{-z^2}\,\mathrm{d}z=\sqrt\pi$

Thus, adding these up in $k$ diverges like the harmonic series. Therefore, the integral diverges.

share|improve this answer
Excellent! I got the same result but numerically only at this stage... –  Raymond Manzoni Apr 18 at 17:56
@robjohn: Can you explain the inequality $$\int_{(k-1/2)\pi}^{(k+1/2)\pi} e^{-z^2\sin^2(z)}\,\mathrm{d}z \ge\int_{-\pi/2}^{\pi/2}e^{-(k+1/2)^2\pi^2z^2}\,\mathrm{d}z$$ in detail? –  user64494 Apr 18 at 18:01
@user64494: I have added a step and some explanation. –  robjohn Apr 18 at 18:13

This will only be an illustration of Robjohn's excellent answer.

There is large numerical instability while evaluating this integral (the numerical results returned by CAS will depend of the precision required and the method used : I got values ranging from $1.5$ to $5$).
The problem is that the exponent will take the value $0$ for $\,z=\pi n\;$ as illustrated : exponent

So let's rather evaluate : $$f_n=\int_{\pi n}^{\pi (n+1)} e^{- z^2\sin^2(z)} \,dz$$

I got : \begin{array} {c|c} n&n\,f_n\\ \hline 10&0.538590916089835479\\ 100&0.561397879233431915\\ 1000&0.563907784742113993\\ 10000&0.564161377032037476\\ \end{array}

confirming Robjohn's $\dfrac 1{\sqrt{\pi}}\,$ coefficient and the divergence of the integral.

share|improve this answer
Thanks for the confirmation :-) It's nice to know that I didn't make a silly mistake. –  robjohn Apr 18 at 18:19
@robjohn: I appreciated the repetition of the simple Gaussian integral in your answer (and missed the $\pi/2 \to \pi^2/2$ correction... Everything looks fine now including the asymptotic expression $\frac1{(k+1/2)\sqrt\pi}$ with the appropriate $+1/2$). Cheers, –  Raymond Manzoni Apr 18 at 19:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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