Sorry, this is a question that I couldn't answer yet.
Let $f(x) = \frac{x}{x+5} $
I would like to find the median for $f(x)$ over the interval [0,5].
One way to find the median is to take the middle value of x over [0,5]. In my case, it would be 2.5. Hence, the median of $f(x)$ would be simply
$\frac{2.5}{7.5}= 0.33333$
Another possible solution would be:
$\frac{\textrm{50 percent of the area}}{\textrm{total area}}= \frac{\int_{0}^{m}\frac{x}{x+5} dx}{\int_{0}^{5} \frac{x}{x+5 }dx}=0.5$
In other words, the median for the function is found with the value m that gives 50% of the area on the interval [0,5]. We can find it iteratively. Using R, I have got:
$\frac{\textrm{50 percent of the area}}{\textrm{total area}}=\frac{0.767132}{1.534264} =0.5$.
The value m that gives 50% of the area is 3.303068. Hence, the median for the function would be:
$ \frac{3.303068}{3.303068+5} =0.397813$
Should both approaches give similar results? If not, which one would be correct?
Cheers!
Tyler