Calculating $\int_{-\infty}^x\frac{1}{\sqrt{2\pi}} e^{-(\frac{x^2}{2}+2x+2)}\,dx$ I want to solve this integral from $-\infty$ to $x$ .
$$f_X(x)=\frac{1}{\sqrt{2\pi}} e^{-(\frac{x^2}{2}+2x+2)}, -\infty<x<\infty$$
I have searched as much as I could and I found a solution in wikipedia
$$\int_{-\infty}^{\infty} x e^{-a(x-b)^2} dx=b \sqrt{\frac{\pi}{a}}$$
In that solution there is a $x$ before $e$ but in my problem there is not any $x$ before $e$ and it is the only deference also the answer in that solution is a number but I need a function which contains $x$ .
I really need this answer as soon as possible

Complete the square in the exponential function, then let $y=\frac{x+2}{\sqrt{2}}$
\begin{align}
\frac{1}{\sqrt{2 \pi}} \int\limits_{-\infty}^{z} \mathrm{e}^{-(\frac{1}{2}x^{2}+2x+2)} dx &=
\frac{1}{\sqrt{2 \pi}} \int\limits_{-\infty}^{z} \mathrm{e}^{-\frac{1}{2}(x+2)^{2}} dx \\
&= \frac{1}{\sqrt{\pi}} \int\limits_{-\infty}^{(z+2)/\sqrt{2}} \mathrm{e}^{-y^{2}} dy \\
&= \frac{1}{\sqrt{\pi}} \frac{\sqrt{\pi}}{2} \mathrm{erf}(y) \Big|_{-\infty}^{(z+2)/\sqrt{2}} \\
&= \frac{1}{2} \mathrm{erf}\left(\frac{z+2}{\sqrt{2}} \right) + \frac{1}{2}
\end{align}
Where
$$\int \mathrm{e}^{-y^{2}} dy = \frac{\sqrt{\pi}}{2} \mathrm{erf}(y) + C$$
is the error function.
