Expected value of sum of two gaussian random variables conditional on their difference Given two standard normally distributed random variables $x_1$ and $x_2$. $y = x_1 + x_2$
I would now like to calculate the following:
$$\mathop{\mathbb{E}}[y | x_1 -x_2 = 0]$$
My idea was to do it as follows:
$$\int y \frac{P(y=x_1 + x_2, x_1=x_2)}{P(x_1=x_2)}$$
But the probability that $x_1 = x_2$ should be $0$. Therefore, this does not seem to be the right approach. Where is the mistake in my thinking?
 A: If $X_1$ and $X_2$ are IID $\mathop{\mathcal{N}}\left(0,1\right)$, and $Y=X_1+X_2$, then
\begin{align}
\mathop{\mathbb{E}}\left[Y|X_1-X_2=0\right] &= \mathop{\mathbb{E}}\left[X_1+X_2|X_1-X_2=0\right]\\
&= 2\cdot\mathop{\mathbb{E}}\left[X_1\right]\\
&= 0\\
\end{align}
A: This is an interesting question in terms of approach. Two general advices: To untangle, it often helps to be rigorous in one's notation. You have an integral without proper notation: The limits are often omitted when they are defined by the variable, but you have also omitted with respect to what variable the integral is taken (the $dx$ or the $dy$). The other is to go back to the definitions, as I do below:
For your specific question:
Write $Y = X_1+X_2$ and $Z = X_1-X_2$. You now have the joint pdf $f_{Y,Z}(y,z)$ and the marginal pdfs $f_Y(y)$ and $f_Z(z)$. The conditional pdf of $Y$ given $Z$ is then
$$
  f_{Y|Z}(y|z) = \frac{f_{Y,Z}(y,z)}{f_Z(z)},
$$
for any $z$ such that $f_Z(z)> 0$.
As pointed out in the comment, the $P(X_1=x_2)$ in your question does not correspond to $f_Z(z)$, as the former relates to the CDF and the latter is the pdf.
