I am trying to derive the probability distribution of $Z=Z_1^2 + Z_2^2$. I am doing this in the following way,
$$ \begin{align}p(Z=x) = &\int_0^x p(Z_1^2 = p)\times p(Z_2^2 = x-p) dp\\ \Leftrightarrow ~ &\int_0^x p(Z_1 = \pm\sqrt{p})\times p(Z_2 = \pm\sqrt{x-p})dp \\ \Leftrightarrow &\int_0^x [2p(Z_1 = \pm\sqrt{p})]\times [2p(Z_2 = \pm\sqrt{x-p})]dp \\ \Leftrightarrow 4&\int_0^x (\frac{1}{\sqrt{2\pi}} e^{-0.5p}) \times (\frac{1}{\sqrt{2\pi}} e^{-0.5(x-p)})dp\\ \Leftrightarrow \frac{4}{2\pi}&\int_0^x e^{-0.5p} \times e^{-0.5(x-p)}dp \\ \Leftrightarrow \frac{4}{2\pi}&\int_0^x e^{-0.5x}dp \\ \Leftrightarrow \frac{4}{2\pi} &[p\times e^{-0.5x}]_0^x \\ \Leftrightarrow \frac{4}{2\pi}&\int_0^x e^{-0.5x}dp \\ \Leftrightarrow \frac{2}{\pi} &x\times e^{-0.5x}\end{align}$$
However, this should be the same as the gamma distribution, $\operatorname{Gamma}(1,\frac{1}{2})$, which has pdf
$$ \frac{1}{2}e^{-0.5t} $$
With the value $x=0.3 = t$, we get two different answers, so the pdfs cannot be the same. What am I doing wrong? The limits should be fine as any values of $p$ outside of the interval $[0,x]$ would give a negative inside the square roots.