Marginal distributions (limits of integration) If I have the joint pdf
$$f(x,y)=\cases{\frac{8}{3}xy & $0\leq x\leq 1, x\leq y \leq 2x$\\0 & otherwise}.$$
I want to calculate the marginal distribution of $Y$.

To find the limits of integration I take into account the conditions over $x$ given. In particular, if $x\leq y$ and $y\leq 2x\Rightarrow x\geq \dfrac{y}{2}$, then $\dfrac{y}{2}\leq x\leq y$.
Therefore by definition:
$$f_Y(y)=\int\limits^{y}_\frac{y}{2}f(x,y)\,dx= \int\limits^{y}_\frac{y}{2}\frac{8}{3}xy\,dx = \frac{4}{3}x^2y\Big|^y_{\frac{y}{2}} = \frac{4}{3}y^3-\frac{1}{3}y^3 = y^3.$$
If I want to know if $f_Y$ is a legitime pdf, I shall see if
$$\int_{-\infty}^\infty f_Y(y) \,dy=1.$$
I think that because $x\leq y \leq 2x$ and $x$ goes from $0$ to $1$, then $0\leq y\leq2$. But the integral
$$\int_{0}^2 y^3 \,dy\neq1.$$
Any thoughts on the problem? I appreciate your help.
 A: The bounds in the first integral you wrote are
$$
\max(0, \frac y2); \ \ \ \min(1,y)
$$
because of the constrain $0\le x\le 1$.
This explains why your final result is wrong.
A: The catch is that you have to beware the limits on x wrt y do not exceed the limits on x entire.
$\big(x\in[0,1], y\in [x,2x]\big) \not\equiv \big(y\in[0,2], x\in[y/2, y]\big)$ because when $y>1$ the upper limit on the $x$ range is greater than $1$.
A quick way to check is to sketch a graph.  In this case the support is a triangle with vertices: $\triangle (0,0)(1,1)(1,2)$, and drawing horizontal stripes indicates an increase in the length of support on $x$ from $y=0$ until $y=1$, then the length of support for $x$ decreases until it vanishes at $y=2$. 
Thus when you change the order of the variables, you'll need to express the support as a union.
$$\begin{align}
\big(x\in[0,1], y\in [x,2x]\big) & \equiv \big(y\in[0,1], x\in [\max(0,y/2), \min(1, y)]\big)
\\[1ex] 
 & \equiv \big(y\in[0,1], x\in[y/2,y]\big) \cup \big(y\in (1,2], x\in[y/2,1]\big)
\\[2ex]
\int_0^1 \int_x^{2x} \frac{8xy}{3}\;\mathrm d y\;\mathrm d x
 & = \int_0^2\int_{\max(0,y/2)}^{\min(1,y)}\frac{8xy}{3}\;\mathrm d y\,\mathrm d x
\\[1ex]
 & = \int_0^{1}\int_{y/2}^y \frac{8xy}{3}\;\mathrm d x \;\mathrm d y + \int_1^2 \int_{y/2}^1 \frac{8xy}{3}\;\mathrm d x\;\mathrm d y
\\[1ex] &= 1
\\[2ex] \text{Hence:}
\\[2ex]
f_Y(y) & = \begin{cases} \int_{y/2}^y 8xy/3 \;\mathrm d x & : y\in[0,1]
\\ \int_{y/2}^1 8xy/3 \; \mathrm d x & : y\in(1, 2]
\\ 0 & : y\not\in[0,2]
\end{cases}
\\[2ex] & = \begin{cases} y^3 & : y\in[0,1]
\\ (4y-y^3)/3 & : y\in(1, 2]
\\ 0 & : y\not\in[0,2]
\end{cases}
\end{align}$$
A: Taking into account what mookid pointed out:
$$f_Y(y)=\cases{\int\limits_{y/2}^y\frac{8}{3}xy\,dx & $0\leq y< 1$\\ \int\limits_{y/2}^1\frac{8}{3}xy\,dx & $1\leq y\leq2$ \\ 0 & otherwise}=\cases{y^3 & $0\leq y< 1$\\ \frac{4}{3}y-\frac{1}{3}y^3 & $1\leq y\leq2$ \\ 0 & otherwise}.$$
