# Solving for constant in probability density function

A continuous random variable $X$ has the density $f_X$:

$$f_x(x) = \begin{cases}\frac{x}{a}, & 20 < x < 40,\\0, & \textrm{otherwise.}\end{cases}$$

Find $a$ so that $f_x(x)$ becomes a proper density function.

I'm aware that $f$'s total area under the curve has to be $1$, which is the core of the problem. E.g:

$$\int_{-\infty}^\infty f_xdx = \int_{21}^{39} f_xdx = 1$$

Solving this yields $a = 540$. However, my learning material's solution has different integral borders:

$$\int_{20}^{40} f_xdx = 1$$

Which gives another answer. Is this simply a typo, considering $f_x(20) = f_x(40) = 0$. Or why should $20$ and $40$ be included in the evaluation?

• The bounds on your first integral are wrong, $f_x(20.0001) \neq 0$. – fosho Jan 7 '16 at 21:36

$f(x)= \frac{x}{a}$ where $20\le x\le 40$