Let $X$ be a random variable with distribution $Normal(\mu, \sigma)$. Take the following integral:
$$ \int_X (a - X) 1 \{a > X \} dF(X). $$
where $a$ is a constant value, and $1$ is the indicator function. I encountered this problem while reading a paper, and in that paper the authors claim that this simply the expectation of a truncated normal random variable, and they derive the following expression:
$$ (a - \mu) \Phi (\frac{a - \mu}{\sigma}) + \sigma \phi(\frac{a - \mu}{\sigma}), $$
where $\Phi$ and $\phi$ are the CDF and PDF of a standard Normal. However, I have no idea how they got to this expression. The expected value of a truncated Normal, according to wikipedia is:
$$ E[X | X < a] = \mu - \sigma \frac{\phi (\frac{a - \mu}{\sigma})}{\Phi(\frac{a - \mu}{\sigma})}. $$
Therefore, the above integral should evaluate to:
$$ E[a-X | X < a] = a - \mu + \sigma \frac{\phi (\frac{a - \mu}{\sigma})}{\Phi(\frac{a - \mu}{\sigma})}. $$
Am I missing something?