Supposed to be Chi Squared $X_1$ and $X_2$ are $N(0,1)$. Define $Y = X_1^2 + X_2^2$ and $Z = X_2$.
We want to find the joint pdf of $Y$ and $Z$.
My attempt:
$P(Y=y,Z=z) \\= P(X_1^2 + X_2^2 = y, X_2 = z) \\ 
= P(X_1^2 + X_2^2 = y | X_2 = z)P(X_2 = z) \\
= P(X_1^2 = y - z^2)P(X_2 = z) \\
= \left[P(X_1 = -\sqrt{y-z^2}) + P(X_1 = \sqrt{y-z^2})\right]P(X_2 = z) \\
= \frac{1}{\pi}e^{-\frac{y}{2}}$
But when I try to get the marginal for $f_Y(y)$, I don't get the chi squared distribution, so I believe there's something wrong with my calculations.

You cannot write $\mathbb{P}[Y=y,Z=z]$, since this will be $0$. But still you can write exactly what you did with the pdf but then conclude using the fact that $X_1^2$ is a $\chi_1^2$ :
\begin{align*}
f_{Y,Z}(y,z) &= f_{X_1^2}(y-z^2) f_{X_2}(z)\\
&=\frac{1}{2\pi\sqrt{y-z^2}} e^{-\frac{y-z^2+z^2}{2}}\\
&=\frac{1}{2\pi\sqrt{y-z^2}} e^{-\frac{y}{2}}
\end{align*}
The marginal distribution of $Y$ is indeed a $\chi_2^2$ since the integral over $z$ of this converges to the right value
The other marginal also checks to be a gaussian.
