Finding the probability distribution using transformations The question:
Suppose $X_1,X_2$ are iid with a common standard normal distribution. Find the
joint pdf of $Y_1=X_1^{2}+X_2^{2}$ and $Y_2=X_2$ and the marginal pdf of $Y_1$.
Hint:Note that the space of $Y_1$ and $Y_2$ is given by $-\sqrt{y_1}< y_2< \sqrt{y_1}$  ,  $0< y_1<\infty $.
My attempt:
$X_1^{2}\sim \chi ^{2}(1)$ and $X_2^{2}\sim \chi ^{2}(1)$, so $Y_1\sim \chi ^{2}(2)$. The pdf of $Y_1$ should be $\frac{1}{2}e^{\frac{-y}{2}}$. I tried to get the result by using the transformations of random variables.
If $0< y_2<\sqrt{y_1}$, then $x_1=\sqrt{y_1-y_2^{2}}$.
If $-\sqrt{y_1}< y_2<0$ , then $x_1=-\sqrt{y_1-y_2^{2}}$
In both cases, the absolute value of the jacobian is $\frac{1}{2\sqrt{y_1-y_2^{2}}}$.
So, $f_{Y_1 ,Y_2}(y_1,y_2)=f_{X_1,X_2}(x_1,x_2)\left | J \right |$ , where $\left | J \right |$ is $\frac{1}{2\sqrt{y_1-y_2^{2}}}$.
$f_{X_1,X_2}(x_1,x_2)=\frac{1}{2\pi }e^{\frac{-y_1}{2}}$  (multiplication of two standard normal pdf's)
$f_{Y_1 ,Y_2}(y_1,y_2)=f_{X_1,X_2}(x_1,x_2)\left | J \right |=\frac{1}{2\pi }e^{\frac{-y_1}{2}}\frac{1}{2\sqrt{y_1-y_2^{2}}}$
$f_{Y_1}(y_1)=\frac{e^{-y_1/2}}{4\pi }\int_{-\sqrt{y_1}}^{\sqrt{y_1}}\frac{1}{\sqrt{y_1-y_2^{2}}}dy_2$.
I used this integral: $\int_{-a}^{a}\frac{1}{\sqrt{a^2-x^2}}=\pi $ for $a>0$.
Then $f_{Y_1}(y_1)=\frac{e^{-y_1/2}}{4 }$, which is not same as $\frac{e^{-y_1/2}}{2 }$.
I cannot find out where it went wrong. I need some help.
 A: After a few minutes looking at your proof. I have finally found your mistake. It is made in the beginning. The important point is that the sign of $y_2$ does not influence the sign of $x_1$.
The most informal argument you can make would go as follows. By your line of reasoning, you miss half of the cases, hence, your answer should be multiplied by $2$. I'll get back if I can find a more rigorous way of doing this. In other words, I found your mistake, now I'll start looking for a (better) way to fix it.
Edit: So, the problem is that $x_1(y_1,y_2)$ has two values $\pm \sqrt{y_1-y_2^2}$ and thus you cannot apply that formula. Now, It think that the way to solve this is to split the problem up into two cases $X_1 > 0$ and $X_1\leq 0$. 
Edit2: A way of approaching the latter would be two define a variable $Z = |X_1|$. Then, note that the density of $Z$ is given by (check this for yourself)
$$ f_Z(z) = 2\cdot \frac{1}{\sqrt{2\pi}}\exp\left(-\frac{z^2}{2}\right)\cdot 1{\{z>0\}} $$
Then, following your argument, first note that $Z^2 \stackrel{\mathcal{D}}{=} X_1^2$ and we get
$$ f_{Z,X_2}(z,x_2) = 2\cdot\frac{1}{2\pi} \exp\left(-\frac{z^2 + x_2^2}{2}\right)\cdot 1\{z>0\} $$
Reparametrizing gives (note that these are the same formulas you had, i.e., $z(y_1,y_2)=\sqrt{y_1-y_2^2}$ and $x_2(y_1,y_2)=y_2$)
$$ f_{Z,X_2}(z(y_1,y_2),x_2(y_1,y_2)) = 2\cdot\frac{1}{2\pi} \exp\left(-\frac{\left(\sqrt{y_1-y_2^2}\right)^2 + y_2^2}{2}\right) \\ = \frac{\exp(-y_1/2)}{\pi} \cdot  1\{y_1>0,\ |y_2|<\sqrt{y_1}\} $$
and we get (note that the Jacobian you calculated is similar to the one you had)
$$ f_{Y_1,Y_2}(y_1,y_2) = f_{Z,X_2}(z(y_1,y_2),x_2(y_1,y_2))\cdot|J| = \frac{\exp(-y_1/2)}{2\pi\sqrt{y_1-y_2^2}}\cdot 1\{y_1>0,\ |y_2|<\sqrt{y_1}\} $$
and hence,
$$ f_{Y_1}(y_1) = \int_{\mathbb{R}} f_{Y_1,Y_2}(y_1,y_2)\,\mathrm{d} y_2 = \int_{\mathbb{R}}\frac{\exp(-y_1/2)}{2\pi\sqrt{y_1-y_2^2}}\cdot 1\{y_1>0,\ |y_2|<\sqrt{y_1}\}\,\mathrm{d} y_2 \\
= \frac{\exp(-y_1/2)}{2\pi}\int_{-\sqrt{y_1}}^{\sqrt{y_1}}\frac{1}{\sqrt{y_1-y_2^2}}\,\mathrm{d} y_2 \cdot 1\{y_1>0\} = \frac{\exp(-y_1/2)}{2}\cdot 1\{y_1>0\} $$
which is exactly what you were looking for.
