# Calculating probability given a Probability Density Function

Let a probability density function of a random variable $X$ be given by

$$f(x)=\begin{cases} x^3 & \text {if } -1 \le x \le 1 \\ \\ 0 & \text{otherwise} \end{cases}$$

and I need to find the probability $P(-0.5 \le x \le 0.5)$.

So, I simply applied the integration for $f(x)$ with lower limit $= -0.5$ and upper limit $= 0.5$.

Since, $f(x)$ is an odd function (it is symmetric about the origin), the integration gives the value $0.$ However, the probability of course can't be 0 here. So, do I need to take absolute value of the integration for negative values of $x$ in special case of odd functions like this? Or am I missing something, because I never had to take care of any special cases like this while calculating probability of continuous functions until now!

• probability density can't be negative. – kludg Jan 19 '18 at 16:40
• Are you sure you've transcribed the PDF properly here? I mean, it clearly isn't valid; what I'm wondering is whether the error is in the problem's construction, or your transcription of it. – Brian Tung Jan 19 '18 at 17:54
• The question is incorrect, as Cettt has pointed out in his answer. – vishalgoel Jan 19 '18 at 19:28

Your function $f$ cannot be probability density function (pdf): pdfs are always non-negative and integrate to $1$, i.e $\int_{\Bbb R} f(x) \; dx = 1$. Your funtion $f$ satisfies neither of these conditions.