3

I came across this question: $$\int_0^\infty\frac{{\cos(x)}}{1+x^2}dx$$ I managed to solve and understand this question with the help of differential equations (Which was one of the solutions proposed). However, I had a doubt with the second method proposed in this solution.

In general \begin{align} \int_{x=0}^\infty e^{-(ax^2+bx)}\,dx&=\int_{x=0}^\infty \exp\left(-a\left(\left(x+\frac{b}{2a}\right)^2-\frac{b^2}{4a^2}\right)\right)\,dx\\ &=\exp\left(\frac{b^2}{4a}\right)\int_{x=0}^\infty \exp\left(-a\left(x+\frac{b}{2a}\right)^2\right)\,dx\\\end{align} Let $u=x+\frac{b}{2a}\;\rightarrow\;du=dx$, then \begin{align} \int_{x=0}^\infty e^{-(ax^2+bx)}\,dx&=\exp\left(\frac{b^2}{4a}\right)\int_{x=0}^\infty \exp\left(-a\left(x+\frac{b}{2a}\right)^2\right)\,dx\\ &=\exp\left(\frac{b^2}{4a}\right)\int_{u=0}^\infty e^{-au^2}\,du.\\ \end{align} The last form integral is the Gaussian integralthat equals to $\dfrac{1}{2}\sqrt{\dfrac{\pi}{a}}$ $$\int_{x=0}^\infty e^{-(ax^2+bx)}\,dx=\frac{1}{2}\sqrt{\frac{\pi}{a}}\exp\left(\frac{b^2}{4a}\right)$$

Clearly, they made the substitution $u=x+\frac{b}{2a}$, then the integral should become: $$\exp(\frac{b^2}{4a})\int_\frac{b}{2a}^\infty{e^{-au^2}}dx$$ Then how did it reduce to $$\exp(\frac{b^2}{4a})\int_0^\infty{e^{-au^2}}dx$$ Is this is a mistake or is there a proof for their equality which is not mentioned here? I believe so as the answer has a lot of upvotes. Assuming that this was a mistake, how did the user arrive at the right solution (which I presume to be $\frac{\pi}{2e}$) with the wrong method?

Quphine
  • 144
  • 6

1 Answers1

2

You are correct, there is a mistake in the solution. In particular, $$\int_0^\infty e^{-(ax^2+bx)}\,dx \neq \frac{1}{2}\sqrt{\frac{\pi}{a}}\exp\left(\frac{b^2}{4a}\right)$$ in general. The reason he still gets to the correct result in the end is that the real parts of $$\int_\frac{b}{2a}^{\frac{b}{2a} + \infty}{e^{-au^2}}\, \mathrm{d}u \quad \text{and} \quad \int_0^\infty{e^{-au^2}}\, \mathrm{d}u$$ are actually the same for $b = 2i$ and $a = y$. Note that I put $\frac{b}{2a} + \infty$ because $\frac{b}{2a}$ is imaginary, so you are not actually integrating over the real axis!

Now, the way to see this is to consider the contour integral over the rectangle with corners $0$, $R$, $R+\frac{i}{y}$ and $\frac{i}{y}$, i.e. consider $\gamma := \gamma_1 + \gamma_2 + \gamma_3 + \gamma_4$ with \begin{align} &\gamma_1 : [0,R] \to \mathbb{C}, \quad \gamma_1(t) := t,\\ &\gamma_2 : [0,\tfrac{1}{y}] \to \mathbb{C}, \quad \gamma_2(t) := R + it,\\ &\gamma_3 : [0,R] \to \mathbb{C}, \quad \gamma_3(t) := R-t+\tfrac{i}{y},\\ &\gamma_4 : [0,\tfrac{1}{y}] \to \mathbb{C}, \quad \gamma_4(t) := i(\tfrac{1}{y}-t).\\ \end{align} Then $$\int_{\gamma} e^{-yz^2} \, \mathrm{d}z = 0$$ by Cauchy's integral theorem. Moreover, $$\int_{\gamma_1} e^{-yz^2} \, \mathrm{d}z = \int_0^R {e^{-yt^2}}\, \mathrm{d}t$$ and $$\int_{\gamma_3} e^{-yz^2} \, \mathrm{d}z = -\int_0^R e^{-y(R - t + \frac{i}{y})^2} \, \mathrm{d}t = -\int_\frac{i}{y}^{\frac{i}{y} + R}{e^{-yu^2}}\, \mathrm{d}u.$$ We further note that the integral over $\gamma_4$ is purely imaginary: $$\int_{\gamma_4} e^{-yz^2} \, \mathrm{d}z = -i\int_0^{\frac{1}{y}} e^{y(\frac{1}{y}-t)^2} \, \mathrm{d}t.$$ Finally, $$\int_{\gamma_2} e^{-yz^2} \, \mathrm{d}z = i\int_0^{\frac{1}{y}} e^{-y(R+it)^2} \, \mathrm{d}t \to 0 \quad \text{(as $R \to \infty$).}$$ Combining this, we get \begin{align} 0 &= \lim\limits_{R \to \infty} \mathrm{Re}\left(\int_{\gamma_1} e^{-yz^2} \, \mathrm{d}z + \int_{\gamma_2} e^{-yz^2} \, \mathrm{d}z + \int_{\gamma_3} e^{-yz^2} \, \mathrm{d}z + \int_{\gamma_4} e^{-yz^2} \, \mathrm{d}z\right)\\ &= \int_0^{\infty} {e^{-yu^2}}\, \mathrm{d}u - \int_\frac{i}{y}^{\frac{i}{y} + \infty}{e^{-yu^2}}\, \mathrm{d}u \end{align} and this is why he gets the same result at the end.

Klaus
  • 11,316