Finding $ E ( X Y \mid X + Y = w ) $ when $ X $ and $ Y $ are i.i.d $\mathcal N ( 0 , 1 ) $ variables $ X $ and $ Y $ are both independent and identically distributed random variables with normal distributions $ \mathcal N ( 0 , 1 ) $. What is $ E ( X Y \mid X + Y = w ) $?
I know this means that $ W=X+Y $ must be normally distributed as well with mean $ 0 $ and variance $ 2 $. I also know that $ E ( X Y ) = E ( X ) E ( Y ) $ because of independence. However, I am confused as to how we calculate the conditional expectation in this situation. Do we just take the integral of the normal pdf? What would the boundaries be?
 A: Consider the rotation $$(U,V) = \left(\frac{X+Y}{\sqrt{2}}, \frac{X-Y}{\sqrt{2}}\right),$$ which by the symmetry of the bivariate standard normal, gives $(U,V) \sim \operatorname{Normal}((0,0), I_{2x2})$.  Then $XY = \frac{1}{2}(U^2 - V^2)$, and under the condition $X+Y = w$, it follows that $$\operatorname{E}[XY \mid X+Y = w] = \operatorname{E}\left[\frac{U^2-V^2}{2} \biggl | \; U = \frac{w}{\sqrt{2}}\right] = \frac{w^2}{4} - \frac{\operatorname{E}[V^2]}{2} = \frac{w^2}{4} - \frac{1}{2}.$$
A: Letting $W = X + Y$ then you can write out the joint Gaussian as
\begin{align*}
\begin{bmatrix}
X \\ Y \\ W 
\end{bmatrix} \sim \mathcal{N} \left( 
\begin{bmatrix}
0 \\ 0 \\0
\end{bmatrix},
\begin{bmatrix}
1 & 0 & 1 \\
0 & 1 & 1 \\
1 & 1 & 2
\end{bmatrix}
\right) 
\end{align*}
without worrying too much that this covariance matrix is singular, therefore partitioning and conditioning we have
\begin{align*}
\begin{bmatrix} X \\ Y \end{bmatrix} \bigg| W = w \sim \mathcal{N}\left(
\begin{bmatrix}
\frac{w}{2} \\ \frac{w}{2} , 
\end{bmatrix}
\begin{bmatrix}
\frac{1}{2} & -\frac{1}{2} \\
-\frac{1}{2} & \frac{1}{2}
\end{bmatrix}
\right) 
\end{align*}
Still singular but that's ok because of course this Gaussian is supported on the one dimensional space $X + Y = w$. Anyway we get
\begin{align*}
\mathbb{E}\left[ X Y | X + Y = w \right] &= \mbox{Cov}_{X + Y = w}(X,Y) + (\mathbb{E}[X|X+Y=w])^2 \\
&= \frac{w^2}{4} - \frac{1}{2}.
\end{align*}
