Show $ \int_{-\infty}^{\infty} \frac{e^{-(x+1)^2}}{1+e^{-x}}\mathrm{d}x = \frac{\left(2\sqrt[4]{e} -1 \right)\sqrt{\pi}}{2e}$

calculusclosed-formdefinite integralsgaussian-integralintegration

I was recently looking at this post where the following formula is shown:
$$
\int_{-\infty}^{\infty} \frac{E(x)}{1+\mathcal{E}(x)^{O(x)}}\mathrm{d}x= \int_0^{\infty} E(x) \mathrm{d}x
$$

where $E(x), \mathcal{E}(x)$ are even functions and $O(x)$ is an odd function. One nice application of this formula would be the integral
$$
\int_{-\infty}^{\infty} \frac{e^{-x^2}}{1+e^{-x}}\mathrm{d}x = \frac{\sqrt{\pi}}{2}
$$

where the problem reduces to the evaluation of the Gaussian integral. I then wondered what would happen if I made slight alterations to the above integral, like changing $x^2\to (x+1)^2$. WA evaluates said integral as:

$$
\int_{-\infty}^{\infty} \frac{e^{-(x+1)^2}}{1+e^{-x}}\mathrm{d}x = \frac{\left(2\sqrt[4]{e} -1 \right)\sqrt{\pi}}{2e}
$$


The even/odd formula can't be applied since the $+1$ makes the function not even anymore. Recalling that $\int^\infty_{-\infty} e^{-(ax^2 + bx+c)}\mathrm{d}x=\sqrt{\frac{\pi}{a}}e^{\frac{b^2}{4a}-c}
$
I attempted to evaluate the integral using geometric series
$$
\int_{-\infty}^{\infty} \frac{e^{-(x+1)^2}}{1+e^{-x}}\mathrm{d}x = \sum_{n\ge 0}(-1)^n \int_{-\infty}^{\infty}e^{-(x^2+(n+2)x+1)}\, \mathrm{d}x = \frac{\sqrt{\pi}}{e} \sum_{n\ge 0}(-1)^n e^{\frac{(n+2)^2}{4}}
$$

but the resulting series is divergent, so this method won't work. Does anyone have any ideas on how to evaluate this integral? Thank you!

Best Answer

$$I=\int_{-\infty}^\infty \frac{e^{-(1+x)^2}}{1+e^{-x}}dx=\frac1e\int_{-\infty}^\infty\frac{\color{blue}{e^{-x^2-x}}}{1+e^{x}}dx\overset{x\to -x}=\frac1e\int_{-\infty}^\infty\frac{\color{red}{e^{-x^2+2x}}}{1+e^{x}}dx$$

$$\Rightarrow 2I=\frac1e\int_{-\infty}^\infty \frac{(\color{blue}{1}+\color{red}{e^{3x}})e^{-x^2-x}}{1+e^x}dx$$

$$\frac{1+x^3}{1+x}=1-x+x^2\Rightarrow I=\frac1{2e}\int_{-\infty}^\infty (1-e^x+e^{2x})e^{-x^2-x}dx$$


$$I=\frac{1}{2e}\int_{-\infty}^\infty \left(e^{-x^2-x}+\color{blue}{e^{-x^2+x}}\right)dx-\frac{1}{2e}\int_{-\infty}^\infty e^{-x^2}dx$$

$$\overset{\color{blue}{x\to -x}}=\frac{1}{e}\int_{-\infty}^\infty e^{-x^2-x}dx-\frac{\sqrt \pi}{2e}=\boxed{\frac{\sqrt[4]e\sqrt \pi}{e}-\frac{\sqrt\pi}{2e}}$$

Related Question