I am trying to calculate the average degree of a complex network, which requires me to solve for the following integral:


$$\int \mathrm{d} x \frac{\exp{\left[-x -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2\right]}}{1 + a\exp{(-x)}},$$


where $\mu$, $\sigma$, and $a$ are known constants. Any advice on how to tackle this integral would be greatly appreciated.


So far, I have tried integration by parts, as well as substitutions of the type $s = \exp{(-x)}$ or identities in terms of the hyperbolic trig functions. Unfortunately, none of these got me far.



Integrals involving fractions of exponentials
We can obtain power series in $a$ by expanding in geometric series. Since the specific treatment depends on the integration region, let's introduce lower and upper limits, $y\_0 <y$,
$$
I = \int\_{y\_0 }^{y} dx\, \frac{\exp \left[ -x -\frac{1}{2} \left( \frac{x-\mu }{\sigma } \right)^{2} \right] }{1+a\exp (-x)}
$$
For $|a|<e^{y\_0 } $, we have $|a\exp (-x)| < 1$ and we can expand in a geometric series as
\begin{eqnarray\*}
I &=& \sum\_{n=0}^{\infty } (-a)^n \int\_{y\_0 }^{y} dx\, \exp \left[ -(n+1) x -\frac{1}{2} \left( \frac{x-\mu }{\sigma } \right)^{2} \right] \\
&=& \sum\_{n=0}^{\infty } (-a)^n \sqrt{\frac{\pi }{2} } \sigma \ e^{((n+1) \sigma^{2} -2\mu)(n+1)/2} \cdot \\
& & \hspace{2.5cm} \left[ \mbox{erf} \left( \frac{(n+1)\sigma^{2} -\mu +y}{\sqrt{2} \sigma }\right) - \mbox{erf} \left( \frac{(n+1)\sigma^{2} -\mu +y\_0 }{\sqrt{2} \sigma }\right) \right]
\end{eqnarray\*}
On the other hand, for $|a|>e^y $, we have $|\exp (x) /a| <1$, and we can alternatively write and expand
\begin{eqnarray\*}
I &=& \frac{1}{a} \int\_{y\_0 }^{y} dx\, \frac{\exp \left[-\frac{1}{2} \left( \frac{x-\mu }{\sigma } \right)^{2} \right] }{1+\exp (x)/a} \\
&=& \frac{1}{a} \sum\_{n=0}^{\infty } \left(-\frac{1}{a} \right)^{n} \int\_{y\_0 }^{y} dx\, \exp \left[ nx -\frac{1}{2} \left( \frac{x-\mu }{\sigma } \right)^{2} \right] \\
&=& \sum\_{n=0}^{\infty } \left(-\frac{1}{a} \right)^{n+1} \sqrt{\frac{\pi }{2} } \sigma \ e^{(n \sigma^{2} +2\mu)n/2} \cdot \\
& & \hspace{2.5cm} \left[ \mbox{erf} \left( \frac{n\sigma^{2} +\mu -y}{\sqrt{2} \sigma }\right) - \mbox{erf} \left( \frac{n\sigma^{2} +\mu -y\_0 }{\sqrt{2} \sigma }\right) \right]
\end{eqnarray\*}
Finally, for $|a|\in \ ]e^{y\_0 } ,e^y [$, we can separate into two integration intervals, $[y\_0,\ln |a|\, [$ and $]\, \ln |a|,y]$, and use the applicable expansion from above in each case to obtain the combined result. In the case of negative $a$, one will have to specify how the boundary at $\ln |a|$ is approached from either side, corresponding to the pole in the original integrand; for example, one might specify a principal value prescription.


