A probability density function (pdf) is a function over the sample space $S$, where $S \subseteq \mathbb{R}$, of a continuous random variable $X$ from which the probability that $X$ is within a certain interval can be obtained.
Let $X$ be a continuous random variable. A probability density function (pdf) $f(x)$ is an integrable function where \[\int\limits_a^b f(x) \mathrm{d} x = \mathrm{P}[a< X \leq b]\]
(where $a$ and $b$ are real numbers). The probability density function must satisfy the following conditions: \begin{align} \text{(i)}&\qquad f(x) \geq 0\text{ for all }x \in \mathbb{R}\text{,} \\ \text{(ii)}& \qquad \int\limits_{- \infty}^{\infty}f(x) \mathrm{d} x = 1\text{.} \end{align}
i.e. for all $x$ in the sample space, $f(x)$ is never negative and the integral of $f(x)$ over the entire sample space will always be $1$.
Let $S$ be the real numbers and $f(x)$ be defined as \[f(x) = \begin{cases} k(7x+3) & \text{if }1 \leq x \leq 3, \\[6pt] 0 & \text {otherwise.}\end{cases}\]
For what value of $k$ is $f$ a pdf?
To ensure (i) holds we need $f(x) \geq 0$ for all $x$. So we see $k$ cannot be negative. To satisfy (ii) we need \begin{align} 1 &=\displaystyle\int\limits_{- \infty}^{\infty}f(x) \mathrm{d} x \\ &=\int\limits_1^3 k(7x+3) \mathrm{d} x \\ &= \left[ \frac{7k}{2}x^2+ 3kx \right]_1^3 \\ &=\displaystyle \left[ \frac{7k}{2}\times 9+ 3k\times 3 \right] - \left[ \frac{7k}{2}+ 3k \right] \\ &=\left[ \frac{81k}{2}\right] - \left[ \frac{13k}{2} \right] \\ &=\frac{68k}{2}\\ &=34k \\ \therefore k &=\frac{1}{34}. \end{align}
Suppose that the random variable $X$ has the probability density function \[f(x)= \begin{cases} (\theta + 1)x^{\theta} & \text{if } 0 \leq x \leq 1, \\[6pt] 0 & \text{otherwise}\end{cases}\]
where $\theta \geq 0$.
Verify that $f(x)$ is a probability density function.
To verify that $f(x)$ is a pdf, it needs to satisfy the two conditions. We see $f(x) \geq 0$ for all $x$ as $\theta$ is positive so (i) is satisfied. To satisfy (ii) we see \begin{align} \int\limits_{-\infty}^{\infty}(\theta + 1)x^{\theta} \mathrm{d} x & = \int\limits_0^1 (\theta + 1)x^{\theta} \mathrm{d} x \\ & = (\theta + 1) \int\limits_0^1 x^{\theta} \mathrm{d} x \\ & = (\theta + 1) \left[\frac{x^{\theta+1} }{\theta+1}\right]_0^1 \\ & = (\theta + 1) \left( \frac{1^{\theta+1} }{\theta+1} - \frac{0^{\theta+1} }{\theta+1} \right) \\ & = (\theta + 1) \left(\frac{1}{\theta+1}\right)\\ & = 1 \end{align} which satisfies the second condition. Thus $f(x)$ is a pdf.
In this video, Daniel Organisciak verifies that a function is a probability density function.
This is a workbook on Probability Density Functions and Cumulative Distribution Functionsproduced by HELM.
Test yourself: Numbas test on probability density functions