[Math] Prove that $f(x)$ is a density function

analysiscalculusfunctional-analysisfunctionsprobability

$$\begin{equation*} f(x) = \begin{cases} \frac{x^2}{2}
& \text{ , if } 0 \leq x < 1\\
-x^2+3x-\frac{3}{2} & \text{ , if } 1 \leq x < 2\\ \frac{(3-x)^2}{2} & \text{ , if } 2 \leq x < 3\\ 0
& \text{ , else } \end{cases} \end{equation*}$$

Prove that $f(x)$ is a dense function.

I'm pretty sure there will be a similar task in our exam. But I'm not sure how you solve it correctly.

So a function is dense if it satisfies following properties:

  1. $\forall x \in \mathbb{R}: f(x) \geq 0$
  2. You have that $\int_{\mathbb{R}}{f(x) \space dx = 1}$

$f(x)$ is made up of $4$ functions separated by cases. This means I need to go through every case and check if the two properties are satisfied, right?

Then 1. is satisfied for every single function because if you draw the graphs you see that they are greater-equal to zero in their given intervals.

For 2. we need to show for every single function that $$\int_{-\infty}^{\infty}f(x) \space dx = 1$$

Here I tried this on the second function:

$$\int_{-\infty}^1 1 \space dx+ \int_1^{<2} \left(-x^2+3x-\frac{3}{2}\right) \space dx + \int_{<2}^{\infty} 1 \space dx$$

I don't think this is correct though : /

Best Answer

Yes, it is a density functions. It's easy to see that $(\forall x\in\mathbb{R}):f(x)\geqslant0$. Besides\begin{align}\int_{-\infty}^{+\infty}f(x)\,\mathrm dx&=\int_0^1\frac{x^2}2\,\mathrm dx+\int_1^2-x^2+3x-\frac32\,\mathrm dx+\int_2^3\frac{(3-x)^2}2\,\mathrm dx\\&=\frac16+\frac23+\frac16\\&=1.\end{align}

Related Question