Expected value of a marginal distribution is a function of $x$? 
Let $f$ be the joint PDF of the random vector $(X, Y)$.
$f(x, y) = \displaystyle\frac{x(x-y)}{8}$ for $0 < x < 2$ and $-x < y < x$, otherwise it's zero.
Calculate the correlation between $X$ and $Y$.

The problem I'm struggling with here is that to compute the correlation, I need $E(X)$, $E(Y)$, $E(XY)$, etc.
I already calculated the $E(X)$, but when trying to calculate $E(Y)$, I get:
$E(Y) = \displaystyle\int_{-x}^xyf_y(y)dy$
Where $f_y(y)$ is the marginal distribution of y, which I computed as:
$f_y(y) = \displaystyle\int_0^2\frac{x(x-y)}{8}dx = \frac{1}{3}-\frac{1}{4}y$
Because of the limits of integration when computing $E(Y)$, I assumed that the integral was going to be in terms of $x$, and in fact, I computed it and got $E(Y) = -\displaystyle\frac{x^3}{6}$.
Why is my expected value in terms of $x$? Is this the proper way to calculate this? Shouldn't be Y a random variable of it's own?

Note that we can calculate $E(Y)$ directly from the original joint density function, without the use of marginal density functions. 
$$\int_0^2 \int_{-x}^x y \cdot f(x,y) \text{ }dy \text{ } dx  $$
This will eliminate any $x$ terms in the final answer of $E(Y)$.
