The joint density of $X$ and $Y$ is given by : $f(x,y)=\frac{1}{\sqrt{2 \pi}}e^{-y}e^{-\frac{(x-y)^2}{2}}$. 
The joint density of $X$ and $Y$ is given by
  $$f\left(x,y\right)=\frac{1}{\sqrt{2\pi}}e^{-y}e^{-\frac{\left(x-y
\right)^{2}}{2}}$$
  Here $0<y<\infty$ and $-\infty<x<\infty$. Compute the individual MGFs of $X$ and $Y$.

I could find the marginal distribution of $Y$ which is ${\rm Exp}\left(1\right)$, so I can find its MGF. But I cannot find the marginal distribution of $X$. Please help!
 A: Assuming "MGF" means "moment generating function":
In this set-up, $Y$ is exponential and conditional on $Y$, the rv. $X$ is $N(Y,1)$.  That is, $X$ can be represented as $Y+Z$, where $Z\sim N(0,1)$ is independent of $Y$.  So the MGF of $X$ is $E\exp (uX) = E\exp(uY+uZ) = E\exp(uY)\exp(uZ)=\frac 1{1-u}\exp(u^2/2)$.  The MGF of $Y$ is $E\exp(vY)=1/(1-v)$.
A: Lets try to find the marginal distribution of $X$. You have
$$f_{X}\left(x\right)=\int_{0}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-y}e^{-\frac{\left(x-y\right)^{2}}{2}}{\rm d}y=\frac{1}{\sqrt{2\pi}}e^{-\frac{x^{2}}{2}}\int_{0}^{\infty}e^{-y}e^{-\frac{y^2-2xy}{2}}{\rm d}y=$$
$$=\frac{1}{\sqrt{2\pi}}e^{-\frac{x^{2}}{2}}\int_{0}^{\infty}e^{-\frac{1}{2}y^2+\left(x-1\right)y}{\rm d}y=\frac{1}{\sqrt{2\pi}}e^{-\frac{x^{2}}{2}}e^{\frac{\left(x-1\right)^{2}}{2}}\int_{0}^{\infty}e^{-\frac{\left(y-\left(x-1\right)\right)^{2}}{2}}{\rm d}y=$$
$$=\frac{1}{\sqrt{\pi}}e^{\frac{1}{2}-x}\int_{-\frac{x-1}{\sqrt{2}}}^{\infty}e^{-u^{2}}{\rm d}u=$$
Now using the definition of the error function ${\rm erf}\left(x\right)\equiv\frac{2}{\sqrt{\pi}}\int_{0}^{x}e^{-u^{2}}{\rm d}u$, we get
$$=\frac{1}{\sqrt{\pi}}e^{\frac{1}{2}-x}\frac{\sqrt{\pi}}{2}\left[{\rm erf}\left(u\right)\right]_{-\frac{x-1}{\sqrt{2}}}^{\infty}=\frac{1}{2}e^{\frac{1}{2}-x}\left(1+{\rm erf}\left(\frac{x-1}{\sqrt{2}}\right)\right)$$
where I've used the fact that ${\rm erf}\left(x\right)$ odd. 
A: You don't need to find the distribution of $X$ to derive its MGF.
As @kimchilover has already mentioned, from the joint pdf of $(X,Y)$ it is clear that $X$ conditioned on $Y=y$ has a $\mathcal{N}(y,1)$ distribution, where $Y$ itself is distributed as $\text{Exp}(1)$. 
MGF of $X$ is
$$M_X(t)=E\,[e^{tX}]=E\,E\,[e^{tX}\mid Y]=E\,[e^{Yt+t^2/2}]=e^{t^2/2}E\,[e^{tY}]$$
The only fact used above is the MGF of a univariate Normal distribution.
Now MGF of $Y$ is $E\,[e^{tY}]=\frac{1}{1-t}$ for $t<1$.
Therefore the required MGF is $$M_X(t)=\frac{e^{t^2/2}}{1-t}\quad,\,t<1$$
