Where did I go wrong in my residue theorem? I'd like to do the integral $$\int_{-\infty}^{+\infty} dx\frac{e^{-x^2}}{1+e^{-x^2}}$$
So I thought using the residue theorem. I have 4 poles: $\pm \sqrt{\pi}e^{\pm i\frac{\pi}{4}}$, among which two are on the upper half-circle.
So I call $\alpha$ one of these poles, and my residue gives:
$\lim_{x\to\alpha} \left((x-\alpha)\frac{e^{-x^2}}{1+e^{-x^2}}\right)$
$=\lim_{y\to0}\left(y\frac{e^{-(y+\alpha)^2}}{1+e^{-(y+\alpha)^2}}\right)$
$=\lim_{y\to0}\left(y\frac{e^{-(y+\alpha)^2}}{1+e^{-\alpha^2}(1 - 2\alpha y)}\right)$
$=\lim_{y\to0}\left(y\frac{e^{-(y+\alpha)^2}}{-2y\alpha e^{-\alpha^2}}\right)$ because $1+e^{-\alpha ^2} = 0$ by definition
$=-\frac{1}{2\alpha}$
And in the end my integral gives: $2\pi i\left(-\frac{1}{2\alpha} -\frac{1}{2\alpha '}\right) = -\sqrt{\pi}i\left(e^{-i\frac{\pi}{4}} + e^{-i\frac{3\pi}{4}} \right) = -\sqrt{2\pi}$
So my question is the following: where did I go wrong ? My integral should be positive, and from another method I find something like $log2\sqrt{\pi}$ . I'm a little confused here.
 A: Assuming that you're after the integral$$\int_{-\infty}^{+\infty}\frac{e^{-x^2}}{1+e^{-x^2}}\,\mathrm dx,$$there's an error in your approach. You seem to assume that you can do it byt computing the integral of the function along a path that goes directly from $-R$ to $R$, followed by a semicircle located in the upper halfplane. But this only works if the limit, as $R$ goes to $+\infty$, of this last integral is $0$. Why should that be true?
A: Ok so indeed, the function does not necessarily goes to 0 when the modulus goes to infinity, so you can't use the residue theorem.
The only way to do it I found out was the following:
$$\int_{-\infty}^{+\infty} e^{-x^2} \frac{1}{1-(-e^{-x^2})}dx = \int_{-\infty}^{+\infty} e^{-x^2} \sum_{n=0}^{\infty}(-e^{-x^2})^n dx = \sum_{n=0}^{\infty}(-1)^n\int_{-\infty}^{+\infty}e^{-(1+n)x^2}dx = \sum_{n=0}^{\infty}(-1)^n\sqrt{\frac{\pi}{n+1}} = \sqrt{\pi}\left(\sum_{n=1}^{\infty}\frac{1}{\sqrt{n}} - 2\sum_{n=1}^{\infty}\frac{1}{\sqrt{2n}}\right) = \sqrt{\pi}\left(1-\sqrt{2}\right)\zeta\left(\frac{1}{2}\right)$$
