Integration Question Arising from Attempting to Compute a Marginal Distribution I have a question about the last step of a proof on page 37 of All of Statistics. The entire proof is here for sake of completeness, but I don't think grokking it in its entirety is necessary for answering the question:

Suppose that $X \sim \text{Uniform}(0,1)$. After obtaining a value of $X$ we generate $Y \mid X = x \sim \text{Uniform}(x,1)$. What is the marginal distribution of $Y$? First note that,
$$
f_X(x) =  
\begin{cases} 
      1 & \text{if } 0 \le x \le 1 \\
      0 & \text{otherwise}
\end{cases}
$$
and 
$$
f_{Y \mid X}(y \mid x) = 
\begin{cases} 
      \frac{1}{1-x} & \text{if } 0 < x < y < 1 \\
      0 & \text{otherwise}
\end{cases}
$$
So,
$$
f_{X,Y}(x,y) = f_{Y \mid X} (y \mid x) f_X(x) = 
\begin{cases} 
      \frac{1}{1-x} & \text{if } 0 < x < y < 1 \\
      0 & \text{otherwise}
\end{cases}
$$
The marginal for $Y$ is
$$
f_Y(y) = \int_0^y f_{X,Y}(x,y) dx = \int_0^y \frac{dx}{1 -x} = - \int_1^{1-y} \frac{du}{u} = - \log (1-y)
$$
for $0 < y < 1$.

Question: Why -- on the very last step -- do we integrate from $0$ to $y$? It makes sense to me that we would integrate from $0$ to $\infty$, or perhaps $0$ to $1$ (since there isn't anything beyond that to integrate). But why $0$ to $y$? Does іntegrating on $\int_0^\infty$, $\int_0^1$, and $\int_0^y$ yield the same answer?
 A: 
The marginal distribution of a subset of a collection of random variables is the probability distribution of the variables contained in the subset. It gives the probabilities of various values of the variables in the subset without reference to the values of the other variables. - Wikipedia

Thus, we want to integrate from $0$ to $y$ because it will give us the marginal probability density at any specific value of $y$. By integrating $f_Y(y)$ from the bounds of $y$, i.e. $(0,1)$, we have the total probability of the sample space $1$. In other words, $\int_0^1 f_Y(y)dy=1$
So, the marginal of $Y$ gives us essential information in that we can find the probability density at a specific $y$ value. For example, at $y=1/2$, we have $\log(2)$.
We lose this information when we take the integral from $0$ to $1$ and taking the integral from $0$ to $\infty$ is the same because from $1$ to $\infty$ the probability density is $0$, so we are integrating $0$.
A: The marginal distribution is indeed given by
$$ f_Y(y)=\int_{-\infty}^{\infty}f_{X,Y}(x,y)\;dx $$
and since $f_{X,Y}(x,y)=\frac{1}{1-x}$ if $0<x<y<1$ and $f_{X,Y}(x,y)=0$ otherwise, it follows that if $0<y<1$ then
$$ \int_{-\infty}^{\infty}f_{X,Y}(x,y)\;dx=\int_0^y\frac{1}{1-x}\;dx $$
since we must have $0<x<y$.
