Conditional expectation of $X$ given $Z = X + Y$ Suppose I have two independent normal variables $X$ and $Y$ with known mean and variance. Defining $Z = X+Y$, what is the most straightforward way to compute $\mathbb{E}\left[X|Z\right]$?
I am writing 
\begin{align}
\mathbb{E}\left[X|Z\right] & = \int_x x f_{X}(x|Z=z) \mathrm{d}x \\
& = \int_x x \frac{f_{XZ}(x,z)}{f_Z(z)} \mathrm{d}x \\
& = \int_x x \frac{f_{Y}(z-x)f_X(x)}{f_Z(z)} \mathrm{d}x, \\
\end{align}
but I am not sure if the best (and only?) way is to compute this expression using our knowledge of the pdf's. Thanks.
 A: As @StéphaneLaurent points out, $(X,Z)$ have a bivariate normal distribution and $E[X\mid Z] = aZ+b$. But even more can be said in this case because it is known
that
$$a = \frac{\operatorname{cov}(X,Z)}{\sigma_Z^2}, 
\quad b = \mu_X - a\mu_Z 
= \mu_X - \frac{\operatorname{cov}(X,Z)}{\sigma_Z^2}\mu_Z,$$
and we can use the independence of $X$ and $Y$ (which
implies $\operatorname{cov}(X,Y) = 0$) to deduce that
$$\begin{align}
\operatorname{cov}(X,Z) &= \operatorname{cov}(X,X+Y)\\
&= \operatorname{cov}(X,X) + \operatorname{cov}(X,Y)\\
&= \sigma_X^2\\
\sigma_Z^2 &= \operatorname{var}(X+Y)\\
&= \operatorname{var}(X)+\operatorname{var}(Y) + 2\operatorname{cov}(X, Y)\\
&= \sigma_X^2+\sigma_Y^2\\
\mu_Z &=  \mu_X+\mu_Y.
\end{align}$$
Note that the method used above can also be applied 
in the more general case when $X$ and $Y$ are correlated
jointly normal random variables instead of independent normal random
variables.
Continuing with the calculations, we see that
$$E[X\mid Z] = \frac{\sigma_X^2}{\sigma_X^2+\sigma_Y^2}(Z-\mu_Z)
+ \mu_x \tag{1}$$
which I find comforting because we can interchange the roles
of $X$ and $Y$ to immediately write down
$$E[Y\mid Z] = \frac{\sigma_Y^2}{\sigma_X^2+\sigma_Y^2}(Z-\mu_Z)
+ \mu_Y\tag{2}$$
and the sum of $(1)$ and $(2)$ gives $E[X\mid Z] + E[Y\mid Z] = Z$ 
as noted in Stéphane Laurent's answer.
A: Each of the pairs $(X,Z)$ and $(Y,Z)$ has a bivariate normal distribution. Then we know that $$E(X\mid Z) = a Z+b \quad\textrm{ and } \quad E(Y \mid Z)=\alpha Z + \beta.$$ Taking the expectation yields $E(X)=aE(Z)+b$ and $E(Y)=\alpha E(Z) + \beta$. But we also have $E(X\mid Z) + E(Y \mid Z) = Z$, therefore $a+\alpha=1$ and $b+\beta=0$. Finally we have to solve a linear system of two equations and two unknown variables.
