Let a random variable $X$ be distributed with p.d.f $f(\cdot)$.
I want to derive the following equality for the mean residual life: $$m(x)\equiv\frac{\int_{x}^{\infty}(z-x) f(z)dz}{1-F(x)}=\frac{\int_{x}^{\infty}1-F(z)dz}{1-F(x)}$$
Clearly, I can start by splitting the left-hand-side to get $\frac{\int_{x}^{\infty}z f(z)dz-x\int_{x}^{\infty} f(z)dz}{1-F(x)}=\frac{\left(\int_{x}^{\infty}z f(z)dz\right)-x(1-F(x))}{1-F(x)}$. From this it looks like all I need to do is integration by parts for $\int_{x}^{\infty}z f(z)dz$ with $u(z)=z$ and $v(z)=dF(z)$, but I don't see how this converges to the desired result.