# Expectation of Continuous Random Variable [word problem]

1. Nov 17, 2014

### izelkay

1. The problem statement, all variables and given/known data
Here's the problem with the solution provided:

2. Relevant equations
Fundamental Theorem of Calculus (FToC)

3. The attempt at a solution
So I understand everything up to where I need to take the derivative of the integral(s).
Couple of things I know is that the derivative of the CDF, F(T) is the PDF, f(t). So naturally the integral of the PDF would be the CDF, right?

So for the first integral, ct∫f(x)dx [0,t]
I would need to use the product rule for this I think, so I'd have:

c∫f(x)dx [0,t] + ctf(t)

And since the integral of the PDF is the CDF, this would be:

cF(t) + ctf(t) right? That's what they have so far

For the second integral, -c∫xf(x)dx[0,t]

The derivative of this would just be
-ctf(t)

by the Fundamental Theorem of Calculus.

The third integral, k∫xf(x)dx [t,∞]

I believe I would need to switch the limits of integration for this to be able to differentiate using the FToC:

-k∫xf(x)dx [∞,t]

Then, differentiating this:

-ktf(t)

For the fourth integral I'm not sure what they did. I thought we just needed to switch the limits of integration again to get

kt∫f(x)dx [∞,t]

And then differentiate this to get

k∫f(x)dx [∞,t] + ktf(t)
=
kF(t) + ktf(t)

so in total, I'd have:

cF(t) + ctf(t) - ctf(t) - ktf(t) + kF(t) + ktf(t)

which matches what they have except for the last two terms. I'm not sure what's going on there, can someone explain?

2. Nov 17, 2014

### izelkay

Hm I'm looking at where I switched the limits of integration, and it doesn't really make sense to integrate something from infinity to t does it? Could that be the problem?

3. Nov 17, 2014

### Ray Vickson

The exerpt you quote has a very weird way of doing the derivative, and you are over-thinking the problem. In fact, using the general result
$$\frac{d}{dt} \int_{a(t)}^{b(t)} h(x,t) \, dx = h(b(t),t) b'(t) - h(a(t),t) a'(t) + \int_{a(t)}^{b(t)} \frac{\partial}{\partial t} h(x,t) \, dt$$
we have
$$\frac{d}{dt} \int_0^t c(t-x) f(x)\, dx = c(t-x) f(x)|_{x=t} + \int_0^t \frac{\partial}{\partial t} c(t-x) f(x) \, dx\\ = c \:0 \:f(t) + c \int_0^t f(x) \, dx = c F(t)$$
and
$$\frac{d}{dt} \int_t^{\infty} k(x-t) f(x) \, dx = -k(x-t) f(x)|_{x=t} + \int_t^{\infty} \frac{\partial}{\partial t} k(x-t) f(x) \, dx \\ = - k \: 0 \: f(t) - k \int_t^{\infty} f(t) \, dt.$$
Since $\int_t^{\infty} f(x) \, dx = 1 - F(t)$, we have
$$\frac{d}{dt} E C_t(X) = c F(t) - k[1-F(t)]= (c+k) F(t) - k$$

4. Nov 17, 2014

### izelkay

Mm okay it makes sense with the formula you used, though I've never seen that formula before.

5. Nov 18, 2014

### Ray Vickson

6. Nov 18, 2014

### izelkay

Okay, thank you very much.