Given is the function $f(x)=\left\{\begin{matrix} \frac{3}{4}(2x-x^2) \text{ if } x \in (0,2)\\ 0\;\;\;\text{ else } \end{matrix}\right.$
Show that $f(x)$ is a density.
I think we need show that
$\forall x \in \mathbb{R}: f(x) \geq 0$
$\int_{-\infty}^{\infty}f(x) dx=1$
Is satisfied because in interval $(0,2)$ we have that $2x$ grows at least as fast as $x^2$ so the product will be positive for sure and multiplied by $\frac{3}{4}$ it will still be positive.
$$\int_{-\infty}^{\infty}f(x) dx = \int_{0}^{2}\frac{3}{4}\left(2x-x^2\right)dx = \int_{0}^{2} \frac{3}{2}x - \frac{3}{4}x^2 dx = \left[\frac{3}{4}x^2 - \frac{1}{4}x^3\right]_{0}^{2} = 3-2-(0) = 1$$
Is it good like that? I have doubt in step 1. but I don't know how to do it more clear / better maybe you can tell me if all is good like that? Because I would do same in exam I write soon :s