$X \sim \mathrm{Unif}[0,1], Y|X \sim \mathrm{Unif}[0,X^2].$ Find PDF of $Y.$
Solution. $$f_{Y|X}(y|x) = \frac{1}{x^2}, \text{ $x \in (0,1]$, $y \in \mathbb{R}$.}$$ Thus $$f_{X,Y}(x,y) = f_{Y|X}(y|x) \cdot f_X(x) = \frac{1}{x^2}, \text{ $x \in (0,1]$, $y \in \mathbb{R}$}.$$ Then both $f_{Y|X},f_{X,Y}$ are zero otherwise than where stated.
Then $$f_Y(y) = \int_{-\infty}^{\infty}f_{X,Y}(x,y) dx = \int_{0}^{1} \frac{1}{x^2}dx = -x^{-1} |_{0}^{1}.$$
There is a problem. Can anyone give advice as to how to do this correctly or what is wrong with what I have here? Thanks very much.