TITLE: How to solve $\int_0^\infty \ln(x)\left(e^{-(x+c)^2}+e^{-(x-c)^2}\right)dx$?
QUESTION [6 upvotes]: Mathematica is telling me
$$\int_0^\infty \ln(x)\left(e^{-(x+c)^2}+e^{-(x-c)^2}\right)dx=-\frac{\sqrt\pi}2\left(\gamma+\ln4+f'(0)\right),$$
where
$$f(a)={}_1F_1(a;1/2;-c^2)$$
is the confluent hypergeometric function. I already know how to derive the special case $c=0$,
$$2\int_0^\infty \ln(x)\,e^{-x^2}dx=-\frac{\sqrt\pi}2\left(\gamma+\ln4\right)$$
so I am curious how to arrive at the extra $f'(0)$ for $c>0$. I'm not familiar with hypergeometric functions, so would appreciate an answer assuming minimal background knowledge of them.

An alternative way to write the solution to the integral would be
$$\int_0^\infty \ln(x)\left(e^{-(x+c)^2}+e^{-(x-c)^2}\right)dx=-\frac{\sqrt\pi}2\left(\gamma+\ln4+{{}_1F_1}^{(1,0,0)}(0;1/2;-c^2)\right),$$
where the superscripts denote that a derivative has been taken with respect to the first argument. Not sure if people prefer this notation to what I wrote above.

REPLY [2 votes]: A ridiculous approach compared to the simple and elegant solution given by @WillG.
Hoping to tecognize some patterns, I used a series expansion of
$$f(x)=e^{-(x+c)^2}+e^{-(x-c)^2}$$ around $c=0$ which gives
$$f(x)=e ^{-x^2}\, \sum_{n=0}^\infty \frac{P_n(x^2)}{n!}c^{2n}$$ and
$$\int_0^\infty x^{2k}\,e ^{-x^2}\,\log(x)\,dx=\frac{1}{4} \Gamma \left(n+\frac{1}{2}\right) \psi \left(n+\frac{1}{2}\right)$$
Summing from $n=0$ to $n=12$ the result is
$$I=-\frac{ \sqrt{\pi }}{2} \sqrt{\pi } (\gamma +\log (4))+\sqrt \pi \Big[c^2-\frac{c^4}{3}+\frac{4 c^6}{45}-\frac{2 c^8}{105}+\frac{16
   c^{10}}{4725}-\frac{16 c^{12}}{31185}\Big]$$ At this point, we recognize the pattern since the series expansion of Dawson's function is
$$F(c)=c-\frac{2 c^3}{3}+\frac{4 c^5}{15}-\frac{8 c^7}{105}+\frac{16 c^9}{945}-\frac{32
   c^{11}}{10395}+O\left(c^{13}\right)$$
$$\int_0^c F(t)\,dt=\frac12 \Bigg[c^2-\frac{c^4}{3}+\frac{4 c^6}{45}-\frac{2 c^8}{105}+\frac{16
   c^{10}}{4725}-\frac{16 c^{12}}{31185}\Bigg]+O\left(c^{14}\right)$$
In fact
$$\int_0^c F(t)\,dt=\frac{1}{2} c^2 \, _2F_2\left(1,1;\frac{3}{2},2;-c^2\right)$$
Edit
Notice that, if we write
$$\int_0^c F(t)\,dt=\sum_{n=0}^p (-1)^n\frac{\sqrt{\pi } \, c^{2 n+2}}{4 (n+1) \Gamma \left(n+\frac{3}{2}\right)}+\sum_{n=p+1}^\infty (-1)^n\frac{\sqrt{\pi } \, c^{2 n+2}}{4 (n+1) \Gamma \left(n+\frac{3}{2}\right)}$$ we know in advance $p$ such that
$$R_p=\frac{\sqrt{\pi }\, c^{2 p+4}}{4 (p+2) \Gamma \left(p+\frac{5}{2}\right)} \leq \epsilon$$.
It is given by
$$p \sim  \left\lceil c^2\, e^{1+W(t)} \right\rceil -3 \qquad \text{with} \qquad t=-\frac{\log \left(32 c^4 \epsilon ^2\right)}{2 e c^2}$$
Trying for $c=2$ and $\epsilon=10^{-20}$, this gives $p=33$. Checking
$$R_{32}=7.63\times 10^{-20} > 10^{-20}\qquad \text{while} \qquad R_{33}=8.59\times 10^{-21} < 10^{-20}$$