Let $X,Y$~$N(0,1)$, and $S = X + Y$. X and Y are independent.
a). Find the conditional density $f(x|s)$ of $X$ given $S=s$. Also, what kind of distribution is this?
b). Find the conditional expectations $E(X^2|S=s)$ and $E(X^2|S)$.
If possible, please answer both parts; I have only attempted part a, because it is necessary for part b. Here is my attempt at part a:
$f(x,s)=f(x,s)/f_s(s)$. We know $S$~$N(0,2)$.
$f(x,s)dxds = P(X\in(x,x+dx), S\in(s,s+ds))$
$f(x,s)dxds=P(X\in(x,x+dx), X+Y\in(s,s+ds))$
$f(x,s)dxds=P(X\in(x,x+dx), Y\in(s-x,s-x+ds))$
$f(x,s)dxds=f_x(x)*f_y(s-x) = (\frac1{2\pi}) e^{(-x^2-sx+\frac{s^2}{2})}$
Then I got $f_s(s)=\frac{1}{2\sqrt\pi}e^{-s^2/4}$
So now, we can compute the conditional probability as the quotient.
I am having a hard time simplifying the quotient. In the event that this is correct, perhaps give a simplified $f(x|s)$ as well as an answer to part b. Much appreciated.
So far, your computations are mostly correct (but with some sign mistakes). One gets $$ f_{X\mid S}(x\mid s)=\frac{\frac1{2\pi}\exp\left(-x^2+sx-s^2/2\right)}{\frac1{2\sqrt\pi}\exp\left(-s^2/4\right)}=\frac1{\sqrt\pi}\exp\left(-x^2+sx+s^2/4\right), $$ that is, $$ f_{X\mid S}(x\mid s)=\frac1{\sqrt\pi}\exp\left(-(x-s/2)^2\right). $$ In words, conditionally on $S=s$, $X$ is normal with mean $s/2$ and variance $1/2$. Thus, $$ E[X\mid S]=S/2,\qquad E[X^2\mid S]=(S/2)^2+1/2. $$