Problem: let $X$ be normally distributed, $X \sim N(\mu, \sigma^2)$. Consider two constants $f < c$. Want to derive an analytic expression for the expectation of the random variable $Z := \max(\min(X,c),f)$.
I have started with a particular case, i.e. suppose we want to find $E[\min(X,c)]$. In this case it is easy: I write $\min(X,c) = X\cdot 1_{\{X<c\}} + c\cdot{1_{\{X>c\}}}$. Appy the expectation operator to both sides of this equation and by linearity find
$E[\min(X,c)] = E[X\cdot 1_{\{X<c\}}] + cP(X>c)$,
and an analytic expression follows easily since we know the density $f(x)$ of the normal distribution so we obtain
$E[\min(X,c)] =\int_{-\infty}^{c}xf(x)dx + c\int^{\infty}_{c}f(x)dx$.
Now the problem is, how do I proceed in the most general case? The problem is, if I follow the same line of thought as above, and I define $Y:= \min(X,c)$, I need to find $E[\max(Y,f)]$. Repeating the same argument, I find that
$E[\max(Y,f)] = E[Y\cdot 1_{\{Y>f\}}] + fP(Y<f)$.
However, now $Y$ is $\min(X,c)$, so I cannot anymore use the simple formula for the expectation of a normal random variable, so how do I go ahead from this point exactly?
Thanks for your answers.
Let $g$ denote the PDF of $X$.
Then:$$\mathbb E\max(\min(X,c),f)=\int\max(\min(x,c),f)g(x)dx=$$$$\int_{-\infty}^ffg(x)dx+\int_f^cxg(x)dx+\int_c^{\infty}cg(x)dx=$$$$fP(X\leq f)+\mathbb EX\mathbf1_{f<X<c}+cP(X\geq c)$$