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?