CDF of 2 variables diverges Suppose you have 2 i.i.d. drawn variables X,Y $\sim\mathcal{U}(0,1)$ , I'm trying to calculate the CDF of $Z = X + (1-X)Y\in[0,1]$. I get stuck around the CDF calculation.
$F_Z(z) = P(Z \leq z) = P(Y \leq \frac{z-X}{1-X})$
I'm trying to find this by integrating out $f_{XY}$. This, however, leads to divergence:
$$
\begin{align}
\int\limits_0^1\int\limits_0^\frac{z-x}{1-x} \frac{z-x}{1-x} \, \textrm{d}x \textrm{d}y 
&= \int\limits_0^1\min \left\{ \frac{z-x}{1-x}, 1\right\} \,\textrm{d}x \\
&= \int\limits_0^1 \frac{x-z}{x-1}\,\textrm{d}x
\end{align}
$$
How come this is divergent? Intuitively it seems like it should converge properly, but I think I am missing something ...
Update: a random simulation show a similar finding of divergence (as I decrease the bin size, the right bar goes up) so I guess my question changes to: what does it mean for a CDF to be divergent? Is it not proper then?

Update 2: despite the density keyword in the above code, the y-axis in the above plot is incorrect as described here.
 A: I am not encountering an issue with divergence. Here's how I proceeded; define random variables $U$ and $V$ by $U:=X$ and $V:=X+(1-X)Y$. It's easy to see that $(U,V)$ has joint density $f_{UV}$ where $\\f_{UV}(u,v)=f_{XY}(u,\frac{v-u}{1-u})\left\lvert\frac{\partial(x,y)}{\partial(u,v)}\right\lvert=\frac{1}{1-u}$ whenever $(u,v)\in\Omega$ and $f_{UV}(u,v)=0$ elsewhere. Here, $\Omega:=\{(u,v)\in(0,1)^2|u<v\}$. We can obtain the density for $f_V$ simply by "integrating away" the $u$ variable in the joint density. Doing so gives us $f_V(v)=\ln\big(\frac{1}{1-v}\big)$ for $v\in(0,1)$ and $f_V(v)=0$ elsewhere. From basic integration in Calculus we get that $F_V(v)=(1-v)\ln(1-v)+v$ for $v\in(0,1)$, $F_V(v)=0$ for $v\leq0$, and $F_V(v)=1$ for $v\geq1$. This is the CDF you're looking for.
A: You can actually proceed with your initial method to arrive at this answer as well. Notice for $z\in[0,1]$ fixed we have that
$P\big(Y\leq\frac{z-X}{1-X}\big)=\int_{ -\infty}^{\infty}P\big(Y\leq\frac{z-x}{1-x}\lvert X=x\big)f_X(x)\,dx=\int_{0}^{z}F_{Y|X}(\frac{z-x}{1-x}|x)f_X(x)\,dx$
Independence suggests that $F_{Y|X}(y|x)=F_Y(y)$ so the last integral simplifies to $\int_{0}^{z}\big(\frac{z-x}{1-x}\big)\,dx=(1-z)\ln(1-z)+z$. I was going to show you this method initially but I took the opportunity to show you how to find the density of a random variable using transformations because I think it's cool af :)
