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.
Define $Z-x \equiv h(Z)$. $x$ is treated as fixed here. Then you have
$$m(x)\equiv\frac{\int_{x}^{\infty}(z-x) f(z)dz}{1-F(x)}= \frac {E\Big(h(Z)\cdot \mathbf 1_{\{Z \ge x\}}\Big)}{1-F(x)} \qquad [1]$$
Now the expected value can be written $$E\Big(h(Z)\cdot \mathbf 1_{\{Z \ge x\}}\Big) = h(x) + \int_{x}^\infty h'(x)P(Z\ge z) dz $$ since $P(h(Z)\ge h(x)) =1$.
But $h(x) = x-x = 0$, $h'(x) = 1$ and $P(Z\ge z) = 1-F(z)$.
So $$E\Big(h(Z)\cdot \mathbf 1_{\{Z \ge x\}}\Big) = \int_{x}^\infty [1-F(z)] dz$$
which leads to the desired result.