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.
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?