Verify Alternative Formula for Expected Value I am studying for the first actuarial exam (Exam P) and came across a formula in my ACTEX prep manual that I had never seen before:
$$E[X] = a + \int_{a}^{b}{[1-F(x)]dx}$$
And the text said this was true as long as $x$ was continuously defined on the interval, and as long as $b\lt \infty$. True for continuous and discrete! I tried it out with a few different, very straightforward functions and could not get it to equal an expected value answer I found in the typical manner. Am I missing something in the application? Has anyone seen this before?
Any help is appreciated!

For a continuous random variable
$$
E[X]=\int_a^b dx\ x\ f_X(x)\ ,
$$
where $f_X(x)$ is the probability density function. But
$$
f_X(x)=F'(x)\ ,
$$
where $F$ is the cumulative distribution function. 
Substituting in the integral above, and integrating by parts we have
$$
E[X]=\int_a^b dx\ x\ F'(x)=x F(x)\Big|_a^b -\underbrace{\int_a^b F(x)dx}_{\star}\ .
$$
Now, note that
$$
\int_a^b [1-F(x)]dx=(b-a)-\underbrace{\int_a^b F(x)dx}_{\star}\ .
$$
Hence
$$
E[X]=x F(x)\Big|_a^b -\int_a^b dx\ F(x)=b F(b)-a F(a)+\int_a^b [1-F(x)]dx-(b-a)
$$
$$
=a+\int_a^b [1-F(x)]dx\ ,
$$
using the fact that $F(a)=0$ and $F(b)=1$ (by definition of cumulative distribution function for a density supported on [a,b]).
