Is it possible to solve this integral? I can't manage to solve this integral. Does it have an analytical solution?
$$\int\left(\frac{e^{x}(a-1)-1+\frac{1}{a}}{e^{x}(1-b)+1-\frac{1}{a}}\right)e^{-\frac{(x-(\mu-\frac{\sigma^{2}}{2})t)^{2}}{2t\sigma^{2}}}dx$$
 A: $$\int\left(\frac{e^{x}(a-1)-1+\frac{1}{a}}{e^{x}(1-b)+1-\frac{1}{a}}\right)e^{-\frac{(x-c)^2}{d^2}}\,dx$$
If $b=1$, the integral is
$$-\frac{ \sqrt{\pi }}{2} \, d \left(a e^{c+\frac{d^2}{4}} \text{erf}\left(\frac{2
   c+d^2-2 x}{2 d}\right)+\text{erf}\left(\frac{x-c}{d}\right)\right)$$
If $b$ is "close" to $1$
$$\frac{e^{x}(a-1)-1+\frac{1}{a}}{e^{x}(1-b)+1-\frac{1}{a}}=\sum_{n=0}^\infty \left(\frac{a}{a-1}\right)^n\, e^{nx}\,(a e^x-1)\,(b-1)^n$$
$$I_n=\int e^{nx}\,(a e^x-1)\,e^{-\frac{(x-c)^2}{d^2}}\,dx$$
$$I_n=\frac{\sqrt{\pi }}{2} \, d \,e^{c n+\frac{d^2 n^2}{4}}\left(\text{erf}\left(\frac{2 c+d^2 n-2 x}{2 d}\right)-a e^{c+\frac{1}{4} d^2
   (2 n+1)} \text{erf}\left(\frac{2 c+d^2 (n+1)-2 x}{2 d}\right)\right)$$
A: A consequent "noise reduction" (see comments) is, what physicists call "rewrite in natural variables": Using the substitution
$$
a \mapsto 1+d,\quad
b \mapsto 1+\frac d c,\quad
x \mapsto y-\log\left(\frac{1+d}{c}\right),\\
t \mapsto \frac{\tilde\sigma^2}{\sigma^2},\quad
\mu\mapsto \frac{\tilde\mu+\frac 1 2\tilde\sigma^2+x-y}{t},\tag{1}
$$
the integral becomes
$$
I = - c I_0 - (1-c) I_1\tag{2}
$$
with
\begin{align}
I_0 &= \sqrt{\frac\pi 2}\tilde\sigma\operatorname{erf}\left(\frac{y-\tilde\mu}{\sqrt 2\,\tilde\sigma}\right),\tag{3a}\\
I_1 &= \int \mathrm dy \,\frac{1}{1-e^y} \,\exp\left(-\frac{(y-\tilde\mu)^2}{2\tilde\sigma^2}\right).\tag{3b}
\end{align}
Using the geometric series
$$
\frac{1}{1-e^y} = \sum_{k=0}^\infty e^{k y},\quad y<0,\tag{4}
$$
we get (for $y<0$)
\begin{align}
I_1 &=\sum_{k=0}^\infty \int \mathrm dy \,\exp\left(k y-\frac{(y-\tilde\mu)^2}{2\tilde\sigma^2}\right)\tag{5a}\\
&=\sqrt{\frac\pi 2}\tilde\sigma
\sum_{k=0}^\infty 
\exp\left(k \tilde\mu+\frac{k^2\tilde\sigma^2}{2}\right)
\operatorname{erf}\left(\frac{y-\tilde\mu-k \tilde\sigma^2}{\sqrt 2\,\tilde\sigma}\right).\tag{5b}
\end{align}
$I_1$ has a simple pole at $y=0$.
If $y>0$, use
$$
\frac{1}{1-e^{-y}} = -\sum_{k=1}^\infty e^{-k y},\quad y>0,\tag{6}
$$
and corresponding (5) instead.
Note that the result is similar to @Claude's, I merely posted it for pedagogical reasons.
