I recently started reading ''Lectures On Stochastic Programming'' by Alexander Shapiro, Darinka Dentcheva & Andrzej Ruszczyński. On the introduction they adress the News Vendor Problem:
Suppose that a company has to decide about order quantity $x$ of a certain product to satisfy a demand $d$. The cost of ordering is $c>0$ per unit. If the demand $d$ is larger than $x$, then the company makes an additional order for the unit price $b\geq 0$. The cost of this is equal to $b(d-x)$ if $d>x$ and 0 otherwise. On the other hand, if $d<x$, then a holding cost of $h(x-d) \geq 0$ is incurred.
The Objective Function is:
$$F(x,d) = max \big\{(c-b)x + bd, (c+h)x -hd\big\}$$
Say demand $D$ is a random variable, then the expectation of the objective function is:
$$\mathbf{E}[F(x,D)] = b\mathbf{E}[D] + (c-b)x+(b+h)\cdot \int_0^xH(z)dz$$
with $H(x):=Pr(D\leq x)$, cdf of D.
How do you get to $\mathbf{E}[F(x,D)]$?.