I am struggling with an integral pretty similar to one already resolved in MO (link: [Integration of the product of pdf & cdf of normal distribution](https://mathoverflow.net/questions/101469/integration-of-the-product-of-pdf-cdf-of-normal-distribution) ). I will reproduce the calculus bellow for the sake of clarity, but I want to stress the fact that my computatons are essentially a reproduction of the discussion of the previous thread.


In essence, I need to solve:
$$\int\_{-\infty}^\infty\Phi\left(\frac{f-\mathbb{A}}{\mathbb{B}}\right)\phi(f)\,df,$$
where $\Phi$ is cdf of a standard normal, and $\phi$ its density. $\mathbb{B}$ is a negative constant.


As done in the aforementioned link, the idea here is to compute the derivative of the integral with respect to $\mathbb{A}$ (thanks to Dominated Convergence Theorem, integral and derivative can switch positions). With this, 
\begin{align\*}
\partial\_A\left[\int\_{-\infty}^\infty\Phi\left(\frac{f-A}{B}\right)\phi(f)\,df\right]&=\int\_{-\infty}^\infty\partial\_A\left[\Phi\left(\frac{f-A}{B}\right)\phi(f)\right]\,df=\int\_{-\infty}^\infty-\frac{1}{B}\phi\left(\frac{f-A}{B}\right)\phi(f)\,df
\end{align\*}
We note now that 


$$\phi\left(\frac{f-A}{B}\right)\phi(f)=\frac{1}{2\pi}\exp\left(-\frac{1}{2}\left[\frac{(f-A)^2}{B^2}+f^2\right]\right)=\exp\left(-\frac{1}{2B^2}\left[f^2(1+B^2)+A^2-2Af\right]\right)$$
$$=\frac{1}{2\pi}\exp\left(-\frac{1}{2B^2}\left[\left(f\sqrt{1+B^2}-\frac{A}{\sqrt{1+B^2}}\right)^2+\frac{B^2}{1+B^2}A^2\right]\right)$$


Finally, then,


$$\partial\_A\left[\int\_{-\infty}^\infty\Phi\left(\frac{f-A}{B}\right)\phi(f)\,df\right]$$


$$\ \ \ \ \ =-\frac{1}{\sqrt{2\pi}B}\exp\left(-\frac{A^2}{2(1+B^2)}\right)\frac{1}{2\pi}\int\_{-\infty}^\infty\exp\left(-\frac{1}{2B^2}\left[f\sqrt{1+B^2}-\frac{A}{\sqrt{1+B^2}}\right]^2\right)\,df$$


and with the change of variable 
\begin{align}
\left[y\longmapsto f\frac{\sqrt{1+B^2}}{B}-\frac{A}{B\sqrt{1+B^2}}\Longrightarrow df=\frac{B}{\sqrt{1+B^2}}\,dy\right]
\end{align}
we get 
\begin{align}
\frac{1}{\sqrt{2\pi}}\int\_{-\infty}^\infty\exp\left(-\frac{1}{2B^2}\left[f\sqrt{1+B^2}-\frac{A}{\sqrt{1+B^2}}\right]^2\right)\,df=\frac{B}{\sqrt{1+B^2}}\int\_{-\infty}^{\infty}\phi(y)\,dy=\frac{B}{\sqrt{1+B^2}}
\end{align}
This means that 
\begin{align}
\partial\_A\left[\int\_{-\infty}^\infty\Phi\left(\frac{f-A}{B}\right)\phi(f)\,df\right]&=-\frac{1}{\sqrt{2\pi}B}\exp\left(-\frac{A^2}{2(1+B^2)}\right)\frac{B}{\sqrt{1+B^2}}=-\frac{1}{\sqrt{1+B^2}}\phi\left(\frac{A}{\sqrt{1+B^2}}\right)
\end{align}
At this point, given that (as $\mathbb{B}$ is negative)
$$\Phi\left(\frac{f-A}{\mathbb{B}}\right)\phi(f)=0$$
when $\mathbb{A}\rightarrow-\infty$, the integral we are looking for is equal to
\begin{align}
\int\_{-\infty}^{\mathbb{A}}-\frac{1}{\sqrt{1+\mathbb{B}^2}}\phi\left(\frac{A}{\sqrt{1+\mathbb{B}^2}}\right)\,dA
\end{align}
Again with the obvious change of variables
$$\left[y\longmapsto\frac{A}{\sqrt{1+\mathbb{B}^2}}\Longrightarrow\sqrt{1+\mathbb{B}^2}\,dy=dA\right]$$
one gets
\begin{align}
\int\_{-\infty}^{\mathbb{A}}-\frac{1}{\sqrt{1+\mathbb{B}^2}}\phi\left(\frac{A}{\sqrt{1+\mathbb{B}^2}}\right)\,dA=-\frac{1}{\sqrt{1+\mathbb{B}^2}}\sqrt{1+\mathbb{B}^2}\int\_{-\infty}^{\mathbb{A}/\sqrt{1+\mathbb{B}^2}}\phi(y)\,dy=-\Phi({\mathbb{A}/\sqrt{1+\mathbb{B}^2}}).
\end{align}
The problem here is that this number should obviously be positive, so at some point I am missing a signal. As the computations seem sound to me, I would like to see if anyone could help me to find my mistake. 


Many thanks to you all.



Integral of the product of Normal density and cdf
[The horror, the horror](http://www.youtube.com/watch?v=aNUr__-VZeQ)... :-)


Recall that $\Phi(x)=P[X\leqslant x]$ for every $x$, where the random variable $X$ is standard normal, and that, for every suitable function $u$,
$$
\int\_{-\infty}^{+\infty}u(x)\phi(x)\mathrm dx=E[u(Y)],
$$
where the random variable $Y$ is standard normal. Using this for $u=\Phi$, one sees that the integral $I$ you are interested in is
$$
I=P[X\leqslant B^{-1}(Y-A))]=P[BX\geqslant Y-A]=P[Z\leqslant A],
$$
where $Z=Y-BX$, where $X$ and $Y$ are i.i.d. standard normal, and where we used the fact that $B\lt0$ to reverse the inequality sign. Now, the random variable $Z$ is centered gaussian with variance $\sigma^2=1+B^2$, hence $Z=\sigma U$ with $U$ standard normal, and
$$
I=P[U\leqslant A/\sigma]=\Phi(A/\sqrt{1+B^2}).
$$


