Conditional mean and variance of normal random variables There are two independent normal random variables $N_1, N_2$ with means $\mu_1, \mu_2$ and variances $\sigma_1^2, \sigma_2^2$ respectively.
Is there a way to compute the two conditional expressions
$$ \mathbf{E}[ N_1 \mid N_1 > N_2 ] $$
$$ \mathbf{Var}[ N_1 \mid N_1 > N_2 ] $$
by rewriting them in the form of other common functions (i.e. those that may be already implemented in typical numerical libraries) without evaluating the entire double integral that would be the direct approach? Alternatively, is there a closed form expression for the integral?
 A: Let us start with some simple cases. 
First case: Assume that $Z$ is normal $(\mu,\sigma^2)$, then $Z=\mu+\sigma U$ where $U$ is standard normal hence $E[Z\mid Z\gt0]=\mu+\sigma E[U\mid U\gt-\mu/\sigma]$. Furthermore, since $U$ is standard normal, for every $u$, $P[U\gt-u]=P[U\lt u]=\Phi(u)$ and
$$
E[U;U\gt-u]=\int_{-u}^\infty s\varphi(s)\mathrm ds=\left.-\varphi(s)\right|_{-u}^\infty=\varphi(u),
$$
where $\varphi$ and $\Phi$ are the standard normal PDF and CDF, respectively. Hence
$$
E[Z\mid Z\gt0]=\mu+\sigma\varphi(\mu/\sigma)/\Phi(\mu/\sigma)=\sigma\psi(\mu/\sigma),
$$
where, for every $u$,
$$
\psi(u)=u+\varphi(u)/\Phi(u).
$$
Second case: Assume that $T$ is normal $(\nu,\tau^2)$ independent of $Z$, then
$$
E[T\mid Z\gt0]=E[T]=\nu.
$$
General case: Consider $Z=N_1-N_2$, then $(\mu,\sigma^2)=(\mu_1-\mu_2,\sigma_1^2+\sigma_2^2)$. Our task is to find some normal random variable $T$ independent of $Z$ such that $N_1$ is a linear combination of $Z$ and $T$. Note that $T=\sigma_2^2N_1+\sigma_1^2N_2$ is independent of $Z$ and normal $(\nu,\tau^2)=(\sigma_2^2\mu_1+\sigma_1^2\mu_2,2\sigma_1^2\sigma_2^2)$, and that $(\sigma_1^2+\sigma_2^2)N_1=\sigma_1^2Z+T$. Hence,
$$
(\sigma_1^2+\sigma_2^2)E[N_1\mid Z\gt0]=\sigma_1^2E[Z\mid Z\gt0]+E[T\mid Z\gt0],
$$
that is,
$$
(\sigma_1^2+\sigma_2^2)E[N_1\mid N_1-N_2\gt0]=\sigma_1^2\sigma\psi(\mu/\sigma)+\nu.
$$
And for the variances? The same decomposition proves useful, since
$$
E[(\sigma_1^2Z+T)^2\mid Z\gt0]=\sigma_1^4E[Z^2\mid Z\gt0]+2E[T] E[Z\mid Z\gt0]+E[T^2],
$$
that is,
$$
E[(\sigma_1^2Z+T)^2\mid Z\gt0]=\sigma_1^4E[Z^2\mid Z\gt0]+2\nu\sigma\psi(\mu/\sigma)+\tau^2+\nu^2,
$$
A new term to be computed is
$$
E[Z^2\mid Z\gt0]=\mu^2+2\mu\sigma E[U\mid U\gt-u]+\sigma^2E[U^2\mid U\gt-u],
$$
with $u=\mu/\sigma$, that is,
$$
E[Z^2\mid Z\gt0]=\sigma^2(u^2+2u\psi(u)+E[U^2\mid U\gt -u]).
$$
An integration by parts yields
$E[U^2\mid U\gt -u]=\Phi(u)-u\varphi(u)$, hence one can put everything together and conclude.
A: Use the independent decompostion: $N_1 = \frac{\sigma_1^2}{\sigma_1^2+\sigma_2^2}(N_1 - N_2) +\frac{\sigma_2^2}{\sigma1^2+\sigma_2^2}N_1 + \frac{\sigma_1^2}{\sigma1^2+\sigma_2^2}N_2$.
Note that $Cov(N_1 - N_2, \frac{\sigma_2^2}{\sigma1^2+\sigma_2^2}N_1 + \frac{\sigma_1^2}{\sigma1^2+\sigma_2^2}N_2) = 0$, since combined together they are a Gaussian vector, this means that they are independent.
So we have 
\begin{align}
&E[N_1 | N_1 - N_2 > 0]\\
 &= E[\frac{\sigma_1^2}{\sigma_1^2+\sigma_2^2}(N_1 - N_2) |N_1 - N_2 >0] + E[\frac{\sigma_2^2}{\sigma1^2+\sigma_2^2}N_1 + \frac{\sigma_1^2}{\sigma1^2+\sigma_2^2}N_2|N_1 - N_2) > 0] \\
& =  E[\frac{\sigma_1^2}{\sigma_1^2+\sigma_2^2}(N_1 - N_2) |N_1 - N_2 >0] + E[\frac{\sigma_2^2}{\sigma1^2+\sigma_2^2}N_1 + \frac{\sigma_1^2}{\sigma1^2+\sigma_2^2}N_2]\\
& = E[\frac{\sigma_1^2}{\sigma_1^2+\sigma_2^2}(N_1 - N_2) |N_1 - N_2 >0] + \frac{\sigma_2^2}{\sigma1^2+\sigma_2^2}\mu_1 + \frac{\sigma_1^2}{\sigma1^2+\sigma_2^2}\mu_2
\end{align}
Since $N_1 - N_2 \sim \mathcal{N}(\mu_1 -\mu_2, \sigma_1^2 + \sigma_2^2) $, we compute generally $E[G|G>0]$ for $G\sim \mathcal{N(\mu, \sigma^2)}$.
Firstly $P[G>0] = 1- \Phi(-\frac{\mu}{\sigma})$ where $\Phi$ is the cdf of standard normal distribution.
Secondly $E[G\mathbb{1}_{G>0}] = \mu P[G>0] + \sigma E[N\mathbb{1}_{N > -\frac{\mu}{\sigma}}]$ where $N$ is standard normal distribution.
when $a >0$, $E[N\mathbb{1}_{N>a}] = \frac{1}{\sqrt{2\pi}}e^{-\frac{a^2}{2}}$ and when $a \leq 0$, $E[N\mathbb{1}_{N>a}] = \frac{1}{\sqrt{2\pi}}  e^{-\frac{a^2}{2}}  $(the same)
So since now we can compute $E[G|G>0] = \frac{E[G\mathbb{1}_{G>0}]}{P[G>0]}$, we get the value of $E[N_1 | N_1 - N_2 > 0]$.
The conditional variance can be gotten by calculating $E[(N_1)^2 | N_1 - N_2 > 0]$ in a similar way.
