# 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!

• What functions did you try? – Graham Kemp Sep 8 '16 at 22:24
• Even though this post is slightly different, I’d like to link it to the current choice of mother post. Also see the meta post for (abstract) duplicates. – Lee David Chung Lin Apr 12 at 16:11

## 3 Answers

It is true, and it is well known. \begin{align} & \text{Continuous R.V.}&&\text{Discrete Integer-Valued R.V.} \\[2ex]\hline&a+\int_a^b (1-F_X(x))\operatorname d x && a+\sum_{k=a}^{b} (1-F_X(k)) \\[1ex]=~& a+\int_0^{b-a} (1-F_X(u+a))\operatorname d u &~=~& a+ \sum_{j=0}^{b-a} (1-F_X(j+a)) \\[1ex]=~& a+\int_0^{b-a} \int_{u+a}^b f_X(v)\operatorname d v\operatorname d u &~=~& a+\sum_{j=0}^{b-a}\;\sum_{i=1+j+a}^{b} p_X(i) \\[1ex]=~& a+\iint_{\{0\leq u\leq v-a\leq b-a\}} f_X(v)\operatorname d (u,v) &~=~& a+ \underset{0\leq j \color{navy}{~<~} i-a\leq b-a}{\sum\sum}p_X(i) \\[1ex]=~& a+\int_{a}^{b} f_X(v)\int_{0}^{v-a}\operatorname d u\operatorname d v &~=~& a + \sum_{i=a}^{b} p_X(i)\;\sum_{j=0}^{i-a-1} 1 \\[1ex]=~& a\int_{a}^{b}f_X(v)\operatorname d v+\int_{a}^{b} f_X(v)\,(v-a) \operatorname d v &~=~& a+ \sum_{i=a}^b p_X(i)(i-a) \\[1ex]=~& \int_{a}^{b} v f_X(v)\operatorname d v &~=~& \sum_{i=a}^b i~p_X(i) \\[2ex]=~& \mathsf E(X) &~=~& \mathsf E(X) \end{align} $\blacksquare$

Let $F(x)=\int_a^x f(x) dx$ where $f$ is probability density function of $X$. Then by integrating by parts

$$E[x]=\int_{a}^{b} xf(x) dx = \int_a^b xd(F(x)) = [xF(x)]_a^b -\int_a^bF(x)dx$$

$$= bF(b)-aF(a)- \int_a^b F(x)dx = b- \int_a^b F(x)dx$$ which is equal to the RHS of your formula because $$a + \int_{a}^{b}(1-F(x))dx=a + \int_{a}^{b}dx-\int_{a}^{b}F(x)dx =b-\int_a^bF(x)dx.$$

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]).