As the title says, I'm trying to find the probability density function of $Y\sim \text{Unif}(0,X)$ where $X\sim \text{Unif}(0,a)$ and $a>0$.
Since both variable are uniformly distributed, I know $p_X(x) = \frac{1}{a}$ and that the conditional pdf of $Y$ given $X=x$ is $p_Y(y \mid X=x) = \frac{1}{x}$.
I'm computing \begin{equation} p_Y(y) = \int_{-\infty}^{\infty} p_X(x) \: p_Y(y \mid X=x) dx = \int_{0}^{a} \frac{1}{a} \frac{1}{x} dx = \frac{1}{a} \int_{0}^{a} \frac{1}{x} dx \end{equation}
but $\frac{1}{x} $ is not integrable in the interval $[0,a]$. What am I overlooking?
I'm asking this because for a side project I'm intuitively generating a skewed distribution in $[0,a]$ by doing random(0,random(0,2))
but was curious to prove what the resulting distribution would analytically be.
Thanks in advance!