I have the following problem:
Let $U$ be a $\text{Unif}(−1,1)$ random variable on the interval $(−1,1)$.
Find the CDF and PDF of $U^2$. Is the distribution of $U^2$ Uniform on $(0, 1)$?
The solution is as follows:
Let $X = U^2$, for $0 < x < 1$, $P(X \le x) = P(−\sqrt{x} \le U \le \sqrt{x}) = P(U \le \sqrt{x}) - P(U \le -\sqrt{x}) = \dfrac{\sqrt{x} + 1}{2} - \dfrac{-\sqrt{x} + 1}{2} = \sqrt{x}$ (Note that $P(U \le u) = \dfrac{u + 1}{2}$ for $-1 \le u \le 1$. The density is then given by $f_X(x) = \dfrac{d}{dx} P(X \le x) = \dfrac{d}{dx}x^{1/2} = \dfrac{1}{2} x^{-1/2}$. The distribution of $X = U^2$ is not Unif$(0, 1)$ on the interval $(0, 1)$ as the PDF is not a constant on this interval.
The first fact that I am confused about is how the author got that the interval is now $0 < x < 1$ instead of $-1 < x < 1$.
The second fact that I am confused about, which it seems is related to the first, is how the author calculated that $P(U \le \sqrt{x}) - P(U \le -\sqrt{x}) = \dfrac{\sqrt{x} + 1}{2} - \dfrac{-\sqrt{x} + 1}{2}$. Did they just insert the values into the formula for the CDF (since the formula for the CDF is $\dfrac{x - a}{b - a}$), or did they otherwise somehow calculate the CDF? I ask because I'm unsure if it's just a matter of memorization, or whether there is some mathematical understanding here that I am missing.
I would greatly appreciate it if people could please take the time to clarify this.