I have the problem following :
Let's say we have random variable with density function $f_x=\begin{cases} \frac{x+1}{2} &for \; x \in[-1,1] \newline 0 & for \; x \in(-\infty,1)\cup(1,+\infty) \end{cases}$
And we want to derive density function of $X^2$
My work so far
My first guees was to derive CDF of $X$ : $$F_X=\begin{cases} 0 & for \; x \in (-\infty,-1) \newline \frac{x^2}{4}+\frac{x}{2}+\frac{1}{4} & for \; x\in[-1,1] \newline 1&for\; x \in (1,+\infty)\end{cases}$$
After that I wanted to derive CDF of $X^2$ :
$P(X^2 \le t)=0$ for $t<0$, so we can now consider our formula only for $t>0$
$P(X^2 \le t)=P(X \le \sqrt{t})=\frac{t}{4}+\frac{\sqrt{t}}{2}+\frac{1}{4}$ for $t \in [0,1]$
And $P(X^2 \le t)=1$ for $t>1$.
And finally I calculated PDF of X^2 $$f_{X^2}=\begin{cases} 0 & for \; x \notin [0,1] \newline \frac{1}{4}+\frac{1}{4\sqrt{x}} & for \; x \in [0,1] \end{cases}$$
And my problem is that $\int_{R}f_{X^2}=\frac{3}{4} \neq 1$
Can you please help me spot the mistake ?
Thank you in advance!
Hint: Note that $P(X^2\le t) = P\left(-\sqrt{t}\le X \le \sqrt{t}\right)$ (you forgot to consider negative values of $X$ here).