The joint density of $X$ and $Y$ is given by
$$
f(x, y)= \begin{cases}x e^{-(x+y)} & x>0, y>0 \\ 0 & \text { otherwise }\end{cases}
$$
Are $X$ and $Y$ independent? What if $f(x, y)$ were given by
$$
f(x, y)= \begin{cases}2 & 0<x<y, 0<y<1 \\ 0 & \text { otherwise }\end{cases}
$$