How to compute $E(\max(0, X))$, where $X \sim \mathcal{N}(\theta, 1/n)$? $X_1 ... X_n$  -  iid random variables, $X_i \sim \mathcal{N}(\theta, 1)$. It needs to compute $E(\max(0, \overline{X})$
I tried this:
$\overline{X} \sim \mathcal{N}(\theta, 1/n)$
$$E(\max(0, \overline{X})) = \int\limits_{0}^{+\infty}x \; p_{\overline{X}}(x)\; dx =  \sqrt{\frac{n}{2\pi}} \int\limits_{0}^{+\infty}x \; e^{-\frac{n(x - \theta)^2}{2}} dx$$
But I have no idea how to compute this integral. Is it possible to calculate it or are there any other ways to compute this expectation?
I came to conclusion using this post that $\max(0, X)$ is a kind of "rectified" normal random value. So we can evaluate:
$$E\max(0, X) = E(X I_{\{X > 0\}}) = E(X|X > 0) P(X > 0)$$
Where $X|X > 0$ is truncated gaussian distribution and there is a formula for its mean
Am I right about that?
 A: In general, if $X \sim \operatorname{Normal}(\mu, \sigma^2)$, then $$\begin{align}
\operatorname{E}[\max(0,X)] &= \int_{x=0}^\infty x \frac{1}{\sqrt{2\pi} \sigma} e^{-(x-\mu)^2/(2\sigma^2)} \, dx \\
&= \int_{x=0}^\infty (x-\mu) \frac{1}{\sqrt{2\pi} \sigma} e^{-(x-\mu)^2/(2\sigma^2)} \, dx + \int_{x=0}^\infty \mu \frac{1}{\sqrt{2\pi}\sigma} e^{-(x-\mu)^2/(2\sigma^2)} \, dx \\
&= \int_{x=0}^\infty \frac{x-\mu}{\sigma^2} \frac{\sigma}{\sqrt{2\pi}} e^{-(x-\mu)^2/(2\sigma^2)} \, dx + \mu \int_{x=0}^\infty \frac{1}{\sqrt{2\pi}\sigma} e^{-(x-\mu)^2/(2\sigma^2)} \, dx \\
&= \frac{\sigma}{\sqrt{2\pi}} \int_{y=-\mu^2/(2\sigma^2)}^\infty e^{-y} \, dy + \mu \Pr[X > 0] \\
&= \frac{\sigma}{\sqrt{2\pi}} e^{-\mu^2/(2\sigma^2)} + \mu (1 - \Phi(-\mu/\sigma)), \tag{1}
\end{align}$$
where $\Phi$ is the cumulative distribution function of a standard normal random variable.  Notice that $(1)$ may also be written $$\operatorname{E}[\max(0,X)] = \sigma^2 f_X(0) + \mu S_X(0) \tag{2}$$ where $f_X$ and $S_X$ are the density and survival functions of $X$, respectively.
Then your computation corresponds to $\mu = \theta$ and $\sigma = 1/\sqrt{n}$.
