TITLE: Let $X \sim \text{Unif}(0,1)$, what is the density function of $X (1-X)$?
QUESTION [7 upvotes]: I tried answers from https://stats.stackexchange.com/questions/21549/how-to-add-two-dependent-random-variables, however cannot solve my problem. 
I guess it is 
$$f_{X, -X^2}(x, y) = \begin{cases} 
1, & 0 \leq x \leq 1, y = -x^2; \\
0, & \text{else}.
\end{cases}$$
Then, the integral 
$$f_{X-X^2}(z) = \int_{0}^1 f_{X, -X^2}(a, z-a) \ da$$ gives me trouble, since for a given $z$ the integrand becomes one exactly for two $a$, i.\,e. when $$z-a = -a^2 \Leftrightarrow a_{1,2} = \frac{1}{2} +- \sqrt{\frac{1}{4} - z}.$$
Further, I have seen that the product varies in $\left(0, \frac{1}{4}\right)$ and that there is symmetry between $x \in \left(0, \frac{1}{2}\right)$ and $x \in \left(\frac{1}{2}, 1\right)$. 

What am I doing wrong?
What is the proper way to arrive at the density?

REPLY [2 votes]: $\newcommand\P{\mathbb{P}}$Let $X\sim\text{Unif}(0,1)$. Then for $0<t<1/4$
$$
\P(X(1-X) < t) = \P(X < \tfrac{1}{2}(1 - \sqrt{1-4t})\text{ or }X > \tfrac{1}{2}(1+\sqrt{1-4t}))
$$
By symmetry this tells us
$$
\P(X(1-X) < t) = 2\P(X < \tfrac{1}{2}(1 - \sqrt{1-4t})) = 1 - \sqrt{1 - 4t}.
$$
To find the density we can then differentiate:
$$
f_{X(1-X)}(t) = \frac{d}{dt}\biggl[1 - \sqrt{1 - 4t}\biggr] = \frac{1}{2}\frac{4}{\sqrt{1-4t}} = \frac{2}{\sqrt{1-4t}}
$$
where $t\in[0,\tfrac{1}{4}]$. This concentrates as $t$ increases since the quadratic gets flatter.