14

I have an integral that I'd like some advice on how to find. It is: $$\int_{-\infty}^{\infty} \frac{\exp(-x^2)}{1+x^4}dx$$

I have some experience with contour integrals so I tried using a contour integral where the contour is a semi-circle of radius R in the upper half of the complex plane. I think the integral along the arc vanishes as $R \to \infty$ so I used the residue theorem and am getting a value of $\tfrac{\pi}{\sqrt{8}}(\cos(1) - \sin(1))$. But this can't be right as the value is negative whereas the integrand is always positive! I can't work out what is going wrong.

Does anyone have an idea about how to evaluate this integral? Contour integration is the preferred method if possible but I am also open to other methods. Any suggestion is appreciated!

Zacky
  • 27,674
Craig
  • 223
  • 6
    Welcome to MSE. Nice first question! – José Carlos Santos Nov 07 '19 at 11:30
  • 3
    The problem with your semi-circle is that if $x=iy$ then $\exp(-x^2)/(1+x^4)=\exp(y^2)/(1+y^4)$, which goes to $+\infty$ as $y \to +\infty$. – Botond Nov 07 '19 at 11:37
  • 4
    Just a warning to anyone trying this. It looks like the Fresnel integrals are inevitable. WolframAlpha will give an exact answer in terms of the Fresnel $S$ and $C.$ Trying to use a method similar to this post is one option, but it leads to solving $y'' + y = \sqrt{\pi/x},$ which again leads to the Fresnel integrals. – Brian Moehring Nov 07 '19 at 12:22
  • 2
    Mathematica gives the answer $$\frac{\pi \left(\left(2 C\left(\sqrt{\frac{2}{\pi }}\right)-1\right) \sin (1)+\left(1-2 S\left(\sqrt{\frac{2}{\pi }}\right)\right) \cos (1)\right)}{\sqrt{2}}.$$ Here, $S$ and $C$ are the Fresnel integral functions mentioned above. – YiFan Tey Nov 07 '19 at 13:37
  • partial fractions breaks down integral into two parts $\frac{1}{2}\int \frac{exp(-x^2)}{1-ix^2}ds + \frac{1}{2}\int \frac{exp(-x^2)}{1+ix^2}ds$ – phdmba7of12 Nov 07 '19 at 13:43
  • 2
    Maple evaluates this in terms of the Anger function $J$ and the Weber function $E$. Another reason to think it is not "elementary". – GEdgar Nov 07 '19 at 14:07
  • Curiously it appears that $\int\limits_{-\infty}^{+\infty}\frac{\exp(-x^{k})}{1+x^4}dx$ does not converge whenever $k$ is odd. For what it is worth $\int\limits_{-\infty}^{+\infty}\frac{\exp(-x^{4})}{1+x^4}dx=2e\Gamma(\frac{5}{4})\Gamma(\frac{3}{4},1);$ where $\Gamma(x,y)$ is the incomplete gamma function. There are similar patterns for k>2 even. – Anthony Nov 07 '19 at 15:51
  • Thanks for adding that link Brian - I didn't think of using the differentiation under the integral sign. I do indeed get your second order ODE and hence see why the Fresnel integrals crop up! – Craig Nov 07 '19 at 16:33
  • Just out of curiosity then - since the upper semicircle contour is a bad idea, it would be interesting to know if there any contour that would permit evaluating such an integral. – Craig Nov 07 '19 at 16:35

2 Answers2

11

$$\int_{-\infty}^\infty \frac{e^{-x^2}}{\color{blue}{1+x^4}}dx=\int_{-\infty}^\infty e^{-x^2}\color{blue}{\int_0^\infty e^{-x^2 t} \sin t \,dt} dx=\int_0^\infty \sin t\color{red}{\int_{-\infty}^\infty e^{-(1+t)x^2}dx}dt$$ $$=\color{red}{\sqrt \pi} \int_0^\infty\frac{\sin t}{\color{red}{\sqrt{1+t}}}dt\overset{1+t=x^2}=2\sqrt{\pi}\int_1^\infty \sin(x^2-1)dx$$$$=2\sqrt{\pi} \cos 1 \int_1^\infty\sin(x^2)dx-2\sqrt{\pi} \sin 1 \int_1^\infty\cos(x^2)dx $$ $$=\boxed{\pi\cos 1\frac{1-2S\left(\sqrt{\frac{2}{\pi}}\right)}{\sqrt 2}-\pi\sin 1\frac{1-2C\left(\sqrt{\frac{2}{\pi}}\right)}{\sqrt 2}}$$ Where $S(x)$ and $C(x)$ are Fresnel Integrals.

Mårten W
  • 3,480
Zacky
  • 27,674
5

Brian's suggestion above deserves a mention as I was able to solve the integral that way too!

Let $$I(t) = \int_{-\infty}^{\infty} \frac{\exp(-tx^2)}{1+x^4}dx$$ for a parameter $t \geq 0$. Differentiating gives $$I'(t) = -\int_{-\infty}^{\infty} \frac{x^2 \exp(-tx^2)}{1+x^4}dx$$ and a second differentiation gives $$I''(t) = \int_{-\infty}^{\infty} \frac{x^4 \exp(-tx^2)}{1+x^4}dx.$$ Hence, $$I''(t) + I(t) = \int_{-\infty}^{\infty} \exp(-tx^2) = \sqrt{\frac{\pi}{t}}$$ as Brian pointed out.

Recalling my lecture notes, we now have a second order inhomogenous linear ODE with constant coefficients. The solution can be written $$I(t) = I_C(t) + I_P(t)$$ where $I_C(t)$ solves the homogenous ODE $$I_C''(t) + I_C(t) = 0.$$ Let $I_1(t) = \sin(t)$ and $I_2(t) = \cos(t)$ be the two solutions to the homogenous ODE. The particular solution $I_P(t)$ can now be found using the method described here http://tutorial.math.lamar.edu/Classes/DE/VariationofParameters.aspx

Noting that the Wronskian for I1 and I2 is -1, the particular solution is $$I_P(t) = \sin(t) \int_{0}^t \sqrt{\frac{\pi}{u}} \cos(u) du - \cos(t) \int_{0}^t \sqrt{\frac{\pi}{u}} \sin(u) du$$ or $$I_P(t) = 2\sqrt{\pi} \left( \sin(t) \int_{0}^{\sqrt{t}} \cos(u^2) du - \cos(t) \int_{0}^{\sqrt{t}} \sin(u^2) du \right).$$ Putting this all together gives $$I(t) = A \sin(t) + B \cos(t) + \pi \sqrt{2} \left\{ C\left( \sqrt{\frac{2t}{\pi}} \right) \sin(t) - S\left( \sqrt{\frac{2t}{\pi}} \right) \cos(t) \right\},$$ where $C(x)$ and $S(x)$ are the Fresnel cosine and sine integrals respectively.

The initial conditions are $$I(0) = \int_{-\infty}^{\infty} \frac{dx}{1+x^4}$$ and $$-I'(0) = \int_{-\infty}^{\infty} \frac{x^2}{1+x^4} dx.$$

Using a D shaped contour in the complex plane, these integrals can be shown to both equal $\frac{\pi}{\sqrt{2}}$. Hence $B = -A = \frac{\pi}{\sqrt{2}}$.

This finally gives $$I(1) = \pi\cos(1) \frac{1 - 2 S\left( \sqrt{\frac{2}{\pi}} \right)}{\sqrt{2}} - \pi\sin(1) \frac{1 - 2 C\left( \sqrt{\frac{2}{\pi}} \right)}{\sqrt{2}}.$$

Craig
  • 223