Median for continuous distribution 
Consider a continuous random variable X with probability density function given by $f(x)=cx$ for $1 \le x \le 5$, zero otherwise.  Find the median.

First I calculate the CDF:  $F(x)=cx^2/2$ for $1 \le x \le 5$, zero otherwise.
Now we have to solve for constant c by using the definition of PDF, namely:
$$\int\limits_{-\infty}^{\infty}f(x)dx=1 \implies \frac{c}{2}x^2\Big{|}_1^5=1 \implies c=\frac{1}{12} $$
Then to calculate the median, we set the CDF = 0.5:
$$\frac{1}{2}=\frac{1}{12}\cdot \frac{1}{2} \cdot x^2 \implies x=\sqrt{12}$$
But the book solution is $\sqrt{13}$.  Can someone tell me what I am doing wrong?
Thank you.
 A: Recall that there is an integration constant when finding the CDF $F(x)$.
Also recall that the CDF should take on the value ZERO when $x$ is from minus infinity to $x=1$ and it must take on the value ONE from $x=5$ to plus infinity. (i.e. the CDF is a non-decreasing function on the support of the density $f(x)$).
If you counter verify, you will see that the above paragraph does not hold for the CDF you found above, in your question.
Reworking on the problem, you should find an appropriate CDF. Simply put: the CDF should be
$$
F(x) = \frac{x^2}{24} - \frac{1}{24}
$$
We see that $F(1) = 0$ and that $F(5) = 1$ indeed.
Finally, 
$$
0.5 = \frac{x^2}{24} - \frac{1}{24}
$$
Solving for $x$ yields that the median equals $\sqrt{13}$
A: You forgot the integration constant.
Calculating the CDF gives $F(x)=cx^2/2+d$ on $1\leq x\leq 5$, $F(x)=0$ for $x<1$ and $F(x)=1$ for $x>1$. Setting $F(1)=0$ and $F(5)=1$, we get $c=1/12$ and $d=-1/24$. The solution for $F(x)=1/2$ is then indeed $\sqrt{13}$.
A: For median $m$:
$$
\int\limits_{-\infty}^{m} f(x) dx = \int\limits_{m}^{+\infty} f(x) dx\\
\int\limits_{1}^{m} f(x) dx = \int\limits_{m}^{5} f(x) dx\\
c \frac{x^2}{2}\Biggr|_{1}^{m} = c \frac{x^2}{2}\Biggr|_{m}^{5}\\
x^2\Biggr|_{1}^{m} = x^2\Biggr|_{m}^{5}\\
m = \sqrt{\frac{1^2 + 5^2}{2}}=\sqrt{13}
$$
