Find the expectation and variance of X A pdf is defined as
\begin{equation}
f(x)=
\begin{cases}
C(x+\frac{3}{2}),\quad0<x<2\\
0,\quad\quad\quad\quad\text{otherwise}
\end{cases}
\end{equation}

*

*Find the value of C.

*Find the expectation and variance of X.

*Find the expectation of random variable $Z=\frac{X}{2X+3}$
What I tried:

*

*Finding C is straightforward as we just need to make sure that $\int^\infty_{-\infty}f(x)dx=1$.
\begin{align*}
                1&=\int^2_0C(x+\frac{3}{2})dx\\
                &=\left[\frac{C}{2}x^2+\frac{3}{2}Cx\right]^2_0\\
                &=\left[\frac{C}{2}(2)^2+\frac{3}{2}C(2)\right]-0\\
                &=5C\\
                &C=\frac{1}{5}
            \end{align*}


*Using $\mathbb{E}[X]=\int^\infty_{-\infty}xf(x)dx$,
\begin{align*}
                \mathbb{E}[X]&=\int^2_0x\left(\frac{1}{5}\left(x+\frac{3}{2}\right)\right)dx\\
                &=\left[\frac{1}{15}x^3+\frac{3}{20}x^2\right]^2_0\\
                &=\left[\frac{1}{15}(2)^3+\frac{3}{20}(2)^2\right]^2_0-0\\
                &=\frac{17}{15}
            \end{align*}
Variance is $$\text{Var}[x]=\mathbb{E}[X^2]-\mathbb{E}[X]^2=\mathbb{E}[X(X-1)]-\mathbb{E}[X]-\mathbb{E}[x]^2$$
$$\mathbb{E}[X(X-1)]=\int^2_0x(x-1)(\frac{x}{5}+\frac{3}{10})dx=\frac{7}{15}$$
Then, Var$[X]=\frac{7}{15}-\frac{17}{15}-(\frac{17}{15})^2=-\frac{439}{225}$
My concern is that the variance is negative, which should not be the case. Can I get some pointers on where I went wrong? Thank you.


*This one is simple. I just need to find $\int^2_0\frac{x}{2x+3}f(x)dx$

points 1 is ok
the expectation is ok
As variance is concerned
$$E[X^2]=\int_0^2 x^2f(x)dx=\frac{8}{5}$$
thus
$$V[X]=\frac{8}{5}-\left(\frac{17}{15}\right)^2=\frac{71}{225}$$
point 3, easy but incorrect
$$E[Z]=\int_0^2 \frac{x}{2x+3}f(x)dx$$
