Let $ (X_1, X_2) $ be a bivariate RV whose conditional and marginal cdfs are $$ F_{X_1,X_2}(x_1|x_2) = \begin{cases} (x_1 - x_2)^2 & x_1 \in (x_2,x_2+1) \\ 0 & x_1 \leq x_2 \\ 1 & x_1 \geq x_2 + 1. \end{cases} $$ and $$ F_{X_2}(x_2) = \begin{cases} x_2^2 & x_2 \in (0,1) \\ 0 & x_2 \leq 0 \\ 1 & x_2 \geq 1. \end{cases} $$ Here I want to identify the marginal PDF of $ X_1 $.
We know that this is possible by finding the marginal CDF of $X_1$ using the following theorem: $$ F_{X_1}(x_1) = \int_{-\infty}^{+\infty} F_{X_1,X_2}(x_1|x_2) f_{X_2}(x_2) \quad dx_2. $$
It is clear that $ f_{X_2}(x_2) $ equals $ 2x_2 $ for $x_2 \in (0,1)$ and $ 0 $ otherwise. Hence
$$ F_{X_1}(x_1) = \int_{0}^{1} F_{X_1,X_2}(x_1|x_2) \cdot x_2^2 \quad dx_2. $$
The form of $F_{X_1,X_2}(x_1|x_2)$ depends on the value of $x_1$.
$$ F_{X_1}(x_1) = \begin{cases} \int_{0}^{1} (x_1-x_2)^2 \cdot 2x_2 \quad dx_2 & x_1 \in (x_2, x_{2}+1) \\ \int_{0}^{1} 0 \quad dx_2 & x_1 \leq x_2 \\ \int_{0}^{1} 2x_2 \quad dx_2 & x_1 \geq x_2+1. \end{cases} $$
It follows that $$ F_{X_1}(x_1) = \begin{cases} x_1^2 - \frac{4}{3}x_1 + \frac{1}{2} & x_1 \in (x_2, x_{2}+1) \\ 0 & x_1 \leq x_2 \\ 1 & x_1 \geq x_2+1. \end{cases} $$
However this is not what I expected -- the value of $x_2$ can be any number between zero and unity, and hence my construction of a marginal CDF of $ X_1 $ still depends on $ x_2$. Furthermore, if I (perhaps illegally) differentiate it, I get
$$ f_{X_1}(x_1) = 2x_1 - \frac{4}{3} $$ for $x_1 \in (x_2,x_2+1).$ Suppose my $x_2$ is a very small postivie number, then $ f_{X_1} $ is smaller than zero for some $x_1$ and hence violates the definiton of PDF.
What am I doing wrong? I would like a small hint rather than a full solution. Thank you for reading this! I really appreciate it.