# 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

• I don't understand what is actually inside the integral... – Simply Beautiful Art Dec 26 '16 at 16:03
• What is your question? You didn't post anything of substance. Also, do you have any (valid) attempts at work? Saying you searched on the internet as much as you could is not a valid attempt at the problem – cool.coolcoolcool Dec 26 '16 at 16:04
• @mayam, lookup complementary error function. Pay attention to the limits of that definition. – Srini Dec 26 '16 at 19:42
• @cool, to be quite fair, the integral is not something usually taught to children and non-specialists, so at least the mention of the OP that a search was done is alright. On that note: completing the square should be useful here. – J. M. is a poor mathematician Dec 26 '16 at 19:50
• @J.M before the edit, the question contained no integral. It simply read something to the extent of "I cannot solve this integral" but did not have an integral written. This is why I said what I did. – cool.coolcoolcool Dec 26 '16 at 20:47

Complete the square in the exponential function, then let $y=\frac{x+2}{\sqrt{2}}$
Where $$\int \mathrm{e}^{-y^{2}} dy = \frac{\sqrt{\pi}}{2} \mathrm{erf}(y) + C$$ is the error function.