36
$\begingroup$

Evaluate

$$\int_{0}^{\infty} \frac{\cos x - e^{-x^2}}{x} \ dx$$

$\endgroup$
3
  • $\begingroup$ Maple says $-\gamma/2$. $\endgroup$ Commented Oct 13, 2012 at 12:30
  • 6
    $\begingroup$ @Chris'ssister: I like your question here. They are really like simple or difficult puzzles. Thanks for sharing them here. $\endgroup$
    – Mikasa
    Commented Oct 13, 2012 at 13:11
  • $\begingroup$ @Babak Sorouh: I'm really glad to read these words. Thank you! $\endgroup$ Commented Oct 13, 2012 at 13:14

4 Answers 4

25
$\begingroup$

Related problems: (I), (II). Recalling the Mellin transform of a function $f$

$$ F(s) = \int_{0}^{\infty} x^{s-1}f(x) \,dx .$$

Then we consider the more general integral

$$ F(s) = \int_{0}^{\infty} x^{s-1}\left(\cos x - e^{-x^2}\right) \, dx \,. $$

The value of the integral in our problem follows by taking the limit as $s\to 0 $ in the above integral. Evaluating the above integral gives

$$ F(s) = \Gamma \left( s \right) \cos \left( \frac{\pi \,s}{2} \right) - \frac{1}{2}\, \Gamma \left(\frac{s}{2} \right) \,.$$

Taking the limit as $s \to 0 \,,$ we get the desired result

$$ \int_{0}^{\infty} \frac{\cos x - e^{-x^2}}{x} \ dx = -\frac{\gamma}{2}\,. $$

$\endgroup$
4
  • $\begingroup$ your way seems so simple! Thanks! (+1) $\endgroup$ Commented Oct 13, 2012 at 19:30
  • $\begingroup$ @Chris'ssister: You are welcome. $\endgroup$ Commented Oct 13, 2012 at 19:43
  • $\begingroup$ @FelixMarin: Thanks for the comment. I really appreciate it. $\endgroup$ Commented Dec 26, 2014 at 19:16
  • $\begingroup$ @MhenniBenghorbal It would help if you indicate that the limit $s\to 0$ is explained in your link math.stackexchange.com/questions/713464/… $\endgroup$ Commented Jun 11, 2017 at 12:02
6
$\begingroup$

The result is

$$ \int_{0}^{\infty} \frac{\cos x - e^{-x^2}}{x} \, dx = -\frac{\gamma}{2},$$

where $\gamma$ is the Euler-Mascheroni constant.

Some direct calculations are available, but I prefer to consider it as a difference of some sort of log-singularities. you can find a slightly general method in this line of approach to calculate integrals of this form in my blog posting.

$\endgroup$
2
  • $\begingroup$ thanks for the answer (+1) $\endgroup$ Commented Oct 13, 2012 at 12:35
  • 1
    $\begingroup$ It would be nice to see more of the behind-the-scenes work here. Perhaps an application of the centers that are mentioned in your blog. $\endgroup$
    – robjohn
    Commented Oct 25, 2014 at 13:02
6
$\begingroup$

Contour integration along the contour $[0,R]\cup Re^{i\pi/2[0,1]}\cup i[R,0]$ says that $$ \int_0^\infty\frac{e^{ix}}{x^\alpha}\mathrm{d}x=e^{i\pi(1-\alpha)/2}\int_0^\infty\frac{e^{-x}}{x^\alpha}\mathrm{d}x\tag{1} $$ since the integral along the curve vanishes as $R\to\infty$. Thus, $$ \begin{align} \int_0^\infty\frac{e^{ix}-e^{-x^2}}{x^\alpha}\mathrm{d}x &=e^{i\pi(1-\alpha)/2}\Gamma(1-\alpha)-\frac12\Gamma\left(\frac{1-\alpha}2\right)\\ &=\frac{e^{i\pi(1-\alpha)/2}\Gamma(2-\alpha)-\Gamma\left(\frac{3-\alpha}2\right)}{1-\alpha}\tag{2} \end{align} $$ Take the limit of $(2)$ as $\alpha\to1^-$ using L'Hospital and the fact that $\Gamma'(1)=-\gamma$: $$ \begin{align} \int_0^\infty\frac{e^{ix}-e^{-x^2}}{x}\mathrm{d}x &=\frac{-\frac{i\pi}2+\gamma-\frac\gamma2}{-1}\\[4pt] &=-\frac\gamma2+\frac{i\pi}2\tag{3} \end{align} $$ Therefore, we have both $$ \boxed{\bbox[5pt]{\displaystyle\int_0^\infty\frac{\cos(x)-e^{-x^2}}{x}\mathrm{d}x=-\frac\gamma2}}\tag{4} $$ and $$ \int_0^\infty\frac{\sin(x)}{x}\mathrm{d}x=\frac\pi2\tag{5} $$ where $\gamma$ is the Euler-Mascheroni Constant.

$\endgroup$
1
$\begingroup$

I have evaluated the generalization of this integral .

$$I=\int_{0}^{\infty }\frac{e^{-ax^2}-cos(bx)}{x}dx\\ \\ =\frac{1}{2}\int_{0}^{\infty }\frac{e^{-ax^2}-e^{-ibx}+e^{-ax^2}-e^{-ibx}}{x}dx\\ \\ =\frac{1}{2}\int_{0}^{\infty }\frac{e^{-ax^2}-e^{-(i^3b)x}}{x}dx+\frac{1}{2}\int_{0}^{\infty }\frac{e^{-ax^2}-e^{-ibx}}{x}dx\\ \\ =\frac{1}{2}[\gamma (1-\frac{1}{2})+ln(i^3b)-\frac{ln(a)}{2}]+\frac{1}{2}[\gamma (1-\frac{1}{2})+ln(ib)-\frac{ln(a)}{2}]\\ \\ =\frac{\gamma }{2}+\frac{1}{2}[ln(i^3b.ib)-\frac{ln(a)}{2}-\frac{ln(a)}{2}]\\ \\ =(\frac{\gamma }{2}+ln(b)-\frac{ln(a)}{2})\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ for\ a,\ b>0$$

now to get to the integral

$$I=\int_{0}^{\infty }\frac{cos(x)-e^{-ax^2}}{x}dx$$

let put b=1 and a=1 then we have

$$I=\int_{0}^{\infty }\frac{cos(x)-e^{-ax^2}}{x}dx=-(\frac{\gamma }{2}+ln(1)-\frac{ln(1)}{2})=-\frac{\gamma }{2}$$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .