Finding the median value on a probability density function Quick question here that I cannot find in my textbook or online. 
I have a probability density function as follows:
$\begin{cases}
0.04x & 0 \le x < 5 \\
0.4 - 0.04x & 5 \le x < 10 \\
0 & \text{otherwise}
\end{cases}$
Now I understand that for the median, the value of the integral must be $0.5$. We can set the integrals from negative infinity to m where m represents the median and solve. However, there are 2 functions here so how would i do that? In the answers that I was provided, the prof. simply takes the first function and applies what I said. 
How/why did he do that?
Help would be greatly appreciated! Thank you :)

I don't know, let's find out.  Maybe the median is in the $[0,5]$ part. Maybe it is in the other part. To get some insight, let's find the probability that our random variable lands between $0$ and $5$. This is
$$\int_0^5(0.04)x\,dx.$$
Integrate. We get $0.5$. What a lucky break! There is nothing more to do. The median is $5$.
Well, it wasn't entirely luck. Graph the density function. (We should have done that to begin with, geometric insight can never hurt.) We find that the density function is  symmetric about the line $x=5$. So the median must be $5$.
Remark: Suppose the integral had turned out to be $0.4$. Then to reach the median, we need $0.1$ more in area. Then the median $m$ would be the number such that $\int_5^m (0.4-0.04x)\,dx=0.1$. 
