Let the pdf of a random variable X be given by $f(x)=ae^{-x^2-bx}, -\infty<x<\infty$. If $E(X)=-\frac{1}{2}$, then
(A)$a=\frac{1}{\sqrt{\pi}}e^{-1/4},b=1$
(B)$a=\frac{1}{\sqrt{\pi}}e^{-1/4},b=-1$
(C)$a=\sqrt{\pi}e^{-1/4},b=1$
(D)$a=\sqrt{\pi}e^{-1/4},b=-1$
My Steps:
$\begin{aligned} E(X) & = \displaystyle\int\limits_{-\infty}^{\infty}xf(x)\;dx=-\frac{1}{2} \\ & = \displaystyle a \int\limits_{-\infty}^{\infty}xe^{-x^2-bx}\;dx \\ & = \displaystyle ae^{b/4} \int\limits_{-\infty}^{\infty}xe^{-(x+b/2)^2}\;dx \\ & = \displaystyle ae^{b/4} \int\limits_{-\infty}^{\infty}(x+b/2)e^{-(x+b/2)^2}\;dx - \displaystyle ae^{b/4}\frac{b}{2} \int\limits_{-\infty}^{\infty}e^{-(x+b/2)^2}\;dx \\ \end{aligned}$
I need hints to integrate the second part. Please advise.
Recall that a normally distributed random variable $X$ with mean $\mu$ and standard deviation $\sigma$ has the probability density function $$f_X(x) = \frac{1}{\sqrt{2\pi} \sigma} e^{-(x-\mu)^2/(2\sigma^2)}, \quad -\infty < x < \infty.$$ So if we set $\mu = -1/2$, then $\operatorname{E}[X] = \mu = -1/2$ as desired. Now write $$ae^{-x^2-bx} = ae^{b^2/4} e^{-x^2-bx-b^2/4} = ae^{b^2/4} e^{-(x+b/2)^2}.$$ So we now seek a choice of $\sigma > 0$ such that $$\frac{(x+1/2)^2}{2\sigma^2} = (x+b/2)^2,$$ and simultaneously, $$\frac{1}{\sqrt{2\pi} \sigma} = ae^{b^2/4}.$$ This suggests letting $b = 1$, $\sigma = 1/\sqrt{2}$, and solving for $a$ from these choices gives $$a = \pi^{-1/2} e^{-1/4},$$ which is answer choice A.