Correlation between $(X+Y)^2$ and $X$ Good evening everybody!
I am totally puzzled about how to solve this problem. We are given the random variables $X$ and $Y$, both of which are independent and uniformly distributed on $[0,1]$. Then we are asked to compute the correlation between $X$ and $Z = (X+Y)^2$. I have been looking for similar problems in a couple of books, but to no avail. I could solve the problem by the properties of the variance and covariance, if $Z = X^2 + Y^2$. Any input would be greatly appreciated.
 A: Note that $$\mathbb{E}[X] = \mu_X = 1/2 \text{ and } \mathbb{E}[Z] = \mathbb{E}[X^2] + \mathbb{E}[Y^2] + 2 \mu_X \mu_Y = 2\mathbb{E}[X^2] + 2 \mu_X^2$$
and then the covariance is
$$
\mathbb{E}[(X-\mu_X)(Z-\mu_Z)]
$$
Can you expand $Z$ in terms of $X,Y$ and complete the calculation?
A: Let's calculate the covariance between $Z$ and $X$:
$$\text{Cov}(Z,X) = \text{Cov}((X+Y)^2,X)=\text{Cov}(X^2+Y^2+2XY,X)$$
$$=\text{Cov}(X^2,X)+\text{Cov}(Y^2,X)+\text{Cov}(2XY,X).$$
What is $\text{Cov}(X^2,X)$? You may recall the formula $\text{Cov}(A,B) = \Bbb{E}[AB]-\Bbb{E}[A]\Bbb{E}[B]$, and if not, we have
$$\text{Cov}(X^2,X) = \mathbb{E}[(X^2-\mathbb{E}[X^2])(X-\Bbb{E}[X])]=\Bbb{E}[X^3-X^2\Bbb{E}[X]-X\Bbb{E}[X^2]+\Bbb{E}[X^2]\Bbb{E}[X]]$$
$$=\Bbb{E}[X^3]-\Bbb{E}[X^2]\Bbb{E}[X] - \Bbb{E}[X]\Bbb{E}[X^2]+\Bbb{E}[X^2]\Bbb{E}[X]$$
$$\Bbb{E}[X^3]-\Bbb{E}[X^2]\Bbb{E}[X].$$
So to find this covariance, you just need the mean values of $X$, $X^2$ and $X^3$.
I can do $\text{Cov}(Y^2,X)$ similarly to get:
$$\text{Cov}(Y^2,X) = \mathbb{E}[Y^2X]-\Bbb{E}[Y^2]\Bbb{E}[X].$$
The only real problem here is $\Bbb{E}[Y^2X]$. You can find this by integrating with respect to the joint density $f(x,y)$ of $(X,Y)$:
$$\Bbb{E}[Y^2X] = \int_0^1\int_0^1 y^2xf(x,y)\ dx\ dy = \int_0^1\int_0^1 y^2x\ dx\ dy,$$
since the joint density of the independent uniform variables $(X,Y)$ is just $1$ on all of the unit square.
As for the final term, which is $\text{Cov}(2XY,X)$, you can apply the same trick again.
A: This might make the problem a bit easier:
$Z=(X+Y)^2 = X^2 + Y^2 +2XY$
$\rho(X,Z)=\frac{Cov(X,Z)}{\sigma_X \sigma_Z}$ 
$Cov(X,Z)=E(XZ)-E(X)E(Z)$
$Cov(X,Z)=Cov(X,X^2+Y^2+2XY)$
Covariance is bilinear:
$Cov(X,X^2+Y^2+2XY)=Cov(X,X^2)+Cov(X,Y^2)+Cov(X,2XY)$
For independent variables $E(X^a Y^b)=E(X^a)E(Y^b)$. A bit of work with this and the identity for covaraince shown above provides:
$Cov(X,Y^2)=0$
$Cov(X,2XY)=2E(Y)Var(X)$
You have:
$Cov(X,X^2+Y^2+2XY)=Cov(X,X^2)+2E(Y)Var(X)$
$=E(X^3)-E(X^2)E(X)+2E(Y)Var(X)$
To get the correlation you will also need the standard deviation of $X$ and $Z$. You can use a nice property about variance of sums of random variables. The variance of a sum is the sum of the covariance of every combination in the sum. 
$Var(Z)=Var(X^2 + Y^2 +2XY)= Cov(X^2,X^2) + Cov(X^2,Y^2) +Cov(X^2,2XY) + Cov(Y^2,X^2) + Cov(Y^2,Y^2) + Cov(Y^2,2XY)+ Cov(2XY,X^2) + Cov(2XY,Y^2) + Cov(2XY,2XY)$
Using some results above:
$=Var(X^2)+ Var(Y^2) + Var(2XY) + 2E(Y)Cov(X^2,X) + 2E(X)Cov(Y^2,Y)$
The only thing funny in here is $Var(2XY)=4(E(X^2)E(Y^2)-E(X)^2E(Y)^2)$
