Let $\frac{1}{2}(x+y)e^{-x-y};x,y>0$ the density of two random variables.
- Find the marginal density of $X$.
The answer is $f_X(x)=\frac{1}{2}e^{-x}(x+1)\mathbb{I}_{(x>0)}(x)$.
- Find the density of $Z=X+Y$.
Using the Jacobian with the transformation $\left\{\begin{matrix} x+y=u\\ x=2v\end{matrix}\right.$, the answer is $Z\sim \Gamma(3,1)$.
- Find the correlation between $X$ and $Y$.
Here the problem. Trivially $f_Y(y)=\frac{1}{2}e^{-y}(y+1)\mathbb{I}_{(y>0)}(y)$, so $f(x,y)\neq f_X(x)f_Y(y)$, so $X,Y$ are not independent. How can i find the covariance between two dependent variables so I can apply the Bravais-Pearson's coefficient $\rho=\frac{cov(X,Y)}{\sqrt{var(X)var(Y)}}$? Equally simply I know that $\mathbb{E}[X]=\mathbb{E}[Y]=\frac{3}{2}$, that $\mathbb{E}[X^2]=\mathbb{E}[Y^2]=6$ and that $Var[X]=Var[Y]=\frac{15}{4}$.
Thanks in advance for any help!
It looks all fine except the expected values of $X^2$ and $Y^2$ and consequently the variances.
$$\mathbb E(X^2)= \int\limits_0^{\infty} x^2\cdot \frac{1}{2}(x+1)\cdot e^{-x} \, dx=4$$
Therefore $Var(X)=Var(Y)=4-1.5^2=4-2.25=1.75$.
Now you can use that $Cov(X,Y)=\mathbb E(X\cdot Y)-\mathbb E(X)\cdot E(Y)$, where
$$ \mathbb E(X\cdot Y)=\int\limits_0^{\infty} \left( \int\limits_0^{\infty}x\cdot y\cdot \frac{1}{2}(x+y)e^{-x-y} \, dx \right)\, dy$$