Let $(X,Y)$ with joint density $$p(x,y)=\begin{cases} \pi^{-1}e^{-2x^{2}-y^{2}/2}, & xy \le 0 \\[2ex] \pi^{-1}e^{-x^{2}/2-2y^{2}}, & xy \ge 0 \end{cases}$$ Show that $X$ and $Y$ are uncorrelated but not independent.
I have already seen easier counterexamples for this und wanted to do a similar approach, thus showing $\Bbb{E}[XY]=\Bbb{E}[X]\Bbb{E}[Y]$ and than $\Bbb{E}[X^{2}Y^{2}]\neq\Bbb{E}[X^{2}]\Bbb{E}[Y^{2}]$ given the structure of the distribution. But I can't see how this should be possible and how I can derive $\Bbb{E}[X]$ in general from the given information. So I don't really know what I am supposed to show.
Any help is appreciated.
The direct way is to compute $E[XY]=\iint xyp(x,y) \mathop{dx} \mathop{dy}$ and $E[X]=\int x \int p(x,y) \mathop{dy} \mathop{dx}$, etc.
Perhaps a slicker way is the following. Draw $Z_1\sim N(0,1)$ and $Z_2 \sim N(0,1/4)$. Then, let $$(X,Y) := \begin{cases}(Z_1,Z_2) & \text{if } Z_1Z_2 \ge 0\\(Z_2,Z_1) & \text{if }Z_1Z_2 \le 0.\end{cases}$$ I think you can show that the density of $(X,Y)$ is exactly the one you specify in your problem.
So, $E[XY]=E[Z_1Z_2]=E[Z_1]E[Z_2]=0$. Also, with a lot of symmetry arguments, we have $$E[X] =\frac{1}{2} E[Z_1 \mid Z_1Z_2 \ge 0] + \frac{1}{2} E[Z_2 \mid Z_1 Z_2 \le 0] = 0,$$ and similarly $E[Y]=0$. So $X$ and $Y$ are uncorrelated.
However, I think repeating the above argument for the second moments will yield $E[X^2 Y^2] = \frac{1}{4} \ne \left(\frac{5}{8}\right)^2 = E[X^2]E[Y^2]$, but I am not sure.