Let $X$ be a random variable with support on $[0,\infty)$. The mean excess loss can be defined as:
$$E(X-d|X>d)$$
prove that the mean excess loss is equal to:
$$\frac{\int_d^\infty(x-d)f_X(x)dx}{1-F_X(d)}$$
I understand that the denominator since that's just $P(X>d)$. I don't understand the numerator. How is the numerator obtained? What is its interpretation? I don't understand how to prove this.
Lets start from the definition of conditional probability.
Let A and B be two random events with $Pr(A)>0$, than the probability that B happens given that A happened is defined as $$Pr(B\mid A)=\frac{Pr(A\bigcap B)}{Pr(A)}$$ whre $A\bigcap B$ is the event that A and B happen concomitantly. Now let $A=X>d$ and $B=X>d+y$. It is easy to see that $A\bigcap B=X>d+y$. From these we can write $Pr(A)=Pr(X>d)=1-F(d)=S(d)$, where $S(d)$ is the survival function, and $Pr(A\bigcap B)=Pr(B)=Pr(X>d+y)=S(d+y)$.
Putting all together we get
$$Pr(X>d+y\mid X>d)=\frac{S(d+y)}{S(d)}$$
The event $X>d+y\mid X>d$ can be rewritten as $X-d>y\mid X>d$, which gives us $$S(y\mid X>d)=\frac{S(d+y)}{S(d)}$$
From the last equation we derive the conditional distribution and the conditional pdf
$$F(y\mid X>d)=1-\frac{S(d+y)}{S(d)}$$
$$\boxed{f(y\mid X>d)= \frac{dF(y\mid X>d)}{dy}=\frac{f(d+y)}{S(d)}=\frac{f(d+y)}{1-F(d)}}$$ Finally from the last expression we can calculate the Mean Excess Loss given by $$E(Y\mid X>d)$$ where $Y= X-d$
$$E(Y\mid X>d)=\frac{1}{S(d)}\int_{0}^{\infty}yf(d+y)dy$$
making the change of variable $x=d+y$ in the last integral gives the final result
$$\boxed{E(X-d\mid X>d)=\frac{1}{S(d)}\int_{d}^{\infty}(x-d)f(x)dx}$$