Consider $\zeta \sim U[-2; 2]$, $\eta \sim U[0; 1]$, $Z = \zeta + \eta\zeta$, $\zeta$ and $\eta$ are independent.
First of all, I need to find the conditional density of $Z \vert\zeta=x$. Let $\zeta = x$, then $Z = x(1+\eta) = $ \begin{cases} U[x; 2x], \hspace{0.2cm} x \ge 0, \\ U[2x; x], \hspace{0.2cm}x <0 \end{cases}
Writing this in one line, $$\rho_{Z\vert\zeta}(z\vert x) = \frac{1}{x}\mathbb{1}_{x\le z\le 2x}\mathbb{1}_{x\ge0}-\frac{1}{x}\mathbb{1}_{2x\le z\le x}\mathbb{1}_{x<0}.$$
My first concern is whether this density is correct? What happens at $x=0$? I mean, is $\rho$ finite at this point. I think should be, but I do not understand it properly
Secondly, I need to find conditional expectation $\mathbb{E}[Z\vert \eta =x]$
\begin{equation} \mathbb{E}[Z\vert \eta =x] = \int_\mathbb R z\cdot\rho_{Z\vert\zeta}(z\vert x)dz = \int_\mathbb Rz(\frac{1}{x}\mathbb{1}_{x\le z\le 2x}\mathbb{1}_{x\ge0}-\frac{1}{x}\mathbb{1}_{2x\le z\le x}\mathbb{1}_{x<0})dz =\\= \int_x^{2x}\frac{z}{x}\mathbb{1}_{x\ge0}dz-\int_{2x}^x \frac{z}{x}\mathbb{1}_{x<0}dz = \frac{3x}{2} \end{equation}
Finally, I need to compute marginal density $\rho_Z(z)$.
\begin{equation} \rho_Z(z) = \int_\mathbb R \rho_{(\zeta, Z)}(x, z)dx = \int_\mathbb R \rho_\zeta(x) \cdot \rho_{Z\vert\zeta}(z\vert x)dx = \\ = \int_\mathbb R \left(\frac{1}{4x}\mathbb{1}_{-2\le x\le2}\mathbb{1}_{x\le z\le 2x}\mathbb{1}_{x\ge0} - \frac{1}{4x}\mathbb{1}_{-2\le x\le2}\mathbb{1}_{2x\le z\le 2}\mathbb{1}_{x<0}\right)dx = \\ =\int_0^2\frac{1}{4x}\mathbb 1_{x\le z \le 2x}dx - \int_{-2}^0\frac{1}{4x}\mathbb 1_{2x\le z \le x}dx \end{equation}
In the last line I have troubles with integration of indicator function depending on the variable with respect to I have integrate.
Thanks for the help and for correcting me in case of mistakes.