For a random variable $X$ with pdf $f(x)$, the loss function* is defined as $$n(x) = \mathbb{E}[(X-x)^+] = \int_{x}^\infty (y-x)f(y)dy,$$ where $a^+ = \max\{a,0\}$. Or, for a discrete distribution, $$n(x) = \mathbb{E}[(X-x)^+] = \sum_{y=x}^\infty (y-x)f(y).$$ Loss functions are used frequently in inventory theory and other fields.
*This is different from the "loss function" used in machine learning.
For some well known probability distributions, there are explicit forms for the loss function, typically using the pdf/pmf and cdf. For example, if $X$ has a standard normal distribution, then $$n(x) = \phi(x) - x(1-\Phi(x)),$$ where $\phi(\cdot)$ and $\Phi(\cdot)$ are the standard normal pdf and cdf. And if $X$ has a Poisson($\lambda$) distribution, then $$n(x) = -(x-\lambda)(1-F(x)) + \lambda f(x).$$ These explicit forms are nice because they can be calculated without performing numerical integration or computing long sums, using pdf/pmf and cdf functions that are built into nearly every programming language and mathematical software package.
I have seen explicit forms for loss functions for a handful of distributions, but typically somewhat scattershot in the appendix of an inventory-theory textbook (e.g., Zipkin 2000). I've never found them nicely collated anywhere.
Do you know of a resource to find explicit-form loss functions for more probability distributions?
Bonus points if the resource also has complementary loss functions ($\mathbb{E}[(X-x)^-]$) and second-order loss functions ($\frac12\mathbb{E}\left[\left([X-x]^+\right)^2\right]$)!