Q: Help! How to solve this integral? I've a problem with the following integral, can anybody help me? 
Thanks in advance.
$$
\int_{-\infty}^{+\infty} x\exp\left(\frac{x(2\rho\,y-x)}{2(1-\rho^{\,2}))}\right) dx
$$

A: Write 
$$x(2\rho y - x) = (\rho y)^2 - (\rho y - x)^2 = \rho^2 y^2 - (x - \rho y)^2$$
so that 
$$\exp\left(\frac{x(2\rho y - x)}{2(1 - \rho^2)}\right) = \exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)} - \frac{(x - \rho y)^2}{2(1 - \rho^2)}\right) = \exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right)\exp\left(-\frac{(x - \rho y)^2}{2(1 - \rho^2)}\right).$$
Then 
$$\int_{-\infty}^\infty x\exp\left(\frac{(x - \rho y)^2}{2(1 - \rho^2)}\right)\, dx = \exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right)\int_{-\infty}^\infty x\exp\left(-\frac{(x - \rho y)^2}{2(1 - \rho^2)}\right)\, dx.$$
By substitution $u = x - \rho y$, the last expression can be written
$$\exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right) \int_{-\infty}^\infty (u + \rho y)\exp\left(-\frac{u^2}{2(1 - \rho^2)}\right)\, du.$$
Either by direct computation or by a symmetry argument, we find that $\int_{-\infty}^\infty u \exp(-u^2/(2(1 - \rho^2))) = 0$. So our computation is reduced to 
\begin{align}&\exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right)\int_{-\infty}^\infty \rho y\exp\left(-\frac{u^2}{2(1 - \rho^2)}\right)\, du \\
&= \rho y \exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right)\int_{-\infty}^\infty \exp\left(-\frac{u^2}{2(1 - \rho^2)}\right)\, du\\
&= \rho y \exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right) \times \sqrt{2\pi(1 - \rho^2)}\\
&= \rho y \sqrt{2\pi(1 - \rho^2)}\exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right).
\end{align}
The second to the last line was obtained by recognizing the normal distribution with mean $0$ and variance $1 - \rho^2$. Thus
$$\int_{-\infty}^\infty \exp\left(\frac{x(2\rho y - x)}{2(1 - \rho^2)}\right)\, dx = \rho y \sqrt{2\pi(1 - \rho^2)}\exp\left(\frac{\rho^2 y^2}{2(1 - \rho^2)}\right).$$
