Finding $E(XY)$ from a uniform distribution I have this question where I got $E(X)$ already but I'm struggling with $E(XY)$:
Let $U$ be a random variable uniformly distributed over $[ 0,2π ]$ . Deﬁne $X = \cos U$ and $Y = \sin U$. Show that $X$ and $Y$ are dependent but that $\mathrm{Cov}(X,Y) = 0$.
Given that $E(X)=0$, I skipped $E(Y)$ and I'm now finding $E(XY)$.
What I did was
$$\int^{2/π}_{0}\int^{2/π}_{0} xy \cdot \cos(x) \sin(y) \, \mathrm{d}x \, \mathrm{d}y$$
But the answer was different
$$E(XY )= \frac{1}{2π}∫_0^{2 π} \cos(u ) \sin(u ) \, \mathrm{d}u = 0$$
which I don't understand the reasoning behind. I tried solving mine after following this equation:
$$E(XY) = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} xy f_{X,Y} (x,y) \, \mathrm{d}x \, \mathrm{d}y.$$
Can someone please explain why it's not right? Also how are my bounds? I'm kind of concerned about whether the outer one is correct or not.

Your mistake is to think of $X$ and $Y$ as though they could have taken values independently, but they are both determined by $U$. The expectation of $XY$ is hence
$$E(XY) = \int_{\mathbb{R}} \frac{1}{2\pi} \cos(u) \sin(u) \, \mathrm{d}u = \frac{1}{2\pi} \int_0^{2 \pi} \cos(u) \sin(u) \, \mathrm{d}u.$$
This is the so-called "Law of the Unconscious Statistician": If $X$ is distributed according to some PDF $p$ and $f$ is continuous (more lenient assumptions also work, but let's just go with continuous so as not to overcomplicate). Then the expectation of $f(X)$ is given by
$$\int_{\mathbb{R}} p(x) f(x) \, \mathrm{d}x.$$
In our case $p \equiv \frac{1}{2 \pi}$ since $U$ is uniform on the given interval and $f(x) = \cos(x) \sin(x).$
