# Expected value from a density function

## Main Question or Discussion Point

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?

## Answers and Replies

Related Set Theory, Logic, Probability, Statistics News on Phys.org
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.

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