# Expected value from a density function

1. Mar 19, 2008

### mind0nmath

Hey,
I know how to find the expected value from the density function when it is in the form:

(example)

| y^2 -1<y<1
|
fy =|
| 0 elsewhere

Ey = integral(upper limit 1, lower limit -1)[y*y^2 dy)

but, what if the density function looks like this:

| y^2 -1<y<0
|
fy =| y^2 - y 0<y<1
|
| 0 elsewhere

how do you approach here?

2. Mar 19, 2008

### maverick280857

The expectation value of Y is given by

[tex]E(Y) = \int_{-\infty}^{+\infty}yf(y)dy[/itex]

If I understood your question correctly, you just have to split the integral into disjoint intervals and apply the different definitions of $f(y)$ in each such interval. This is immediate from the linearity of the Riemann integral and the continuity of the integrand.

3. Mar 19, 2008

### tomyus

E(Y) = \int_{-\infty}^{+\infty}yf(y)dy