Given the CDF $F(x)=1-e^{-x^2};0≤x<∞$. Derive the moment generating function of $X$ I know you use $∫e^{tx}f(x)\,dx$ but I cant figure out the calculation. Any help would be appreciated
 A: To understand the following, take a look here.
$$\begin{aligned}M(2t)&=2\int_{\mathbb{R}^+}xe^{-x^2+2tx}dx=\\
&=2e^{t^2}\sqrt{\pi}\int_{\mathbb{R}^+}x\frac{e^{-(x-t)^2}}{\sqrt{\pi}}dx=\\
&=2e^{t^2}\sqrt{\pi}\int_{[-t,\infty)}(y+t)\frac{e^{-y^2}}{\sqrt{\pi}}dy=\\
&=2e^{t^2}\sqrt{\pi}\bigg(-\frac{1}{2}\int_{[-t,\infty)}-2y\frac{e^{-y^2}}{\sqrt{\pi}}dy+t(1-\Phi(-\sqrt{2}t))\bigg)=\\
&=2e^{t^2}\sqrt{\pi}\bigg(-\frac{1}{2}(0-\frac{e^{-t^2}}{\sqrt{\pi}})+t(1-\Phi(-\sqrt{2}t))\bigg)=\\
&=2e^{t^2}\sqrt{\pi}\bigg(\frac{1}{2}\frac{e^{-t^2}}{\sqrt{\pi}}+t\Phi(\sqrt{2}t)\bigg)=\\
&=\sqrt{\pi}\bigg(\frac{1}{\sqrt{\pi}}+2te^{t^2}\Phi(\sqrt{2}t)\bigg)=\\
&=1+2t\sqrt{\pi}e^{t^2}\Phi(\sqrt{2}t)\end{aligned}$$
where $\Phi$ is the standard normal cdf.
A: \begin{align}
\int_0^{\infty} e^{tx} f(x)\mathrm d x &= 2\int_0^{\infty} e^{tx} xe^{-x^2}\mathrm d x\\
&= 2\frac{\mathrm d}{\mathrm d t}\int_0^\infty e^{tx}e^{-x^2}\mathrm dx\\
&= 2\frac{\mathrm d}{\mathrm d t}e^{-\frac {t^2}4}\int_0^\infty e^{-\left(x-\frac t2\right)^2}\mathrm dx\\
&= 2\frac{\mathrm d}{\mathrm d t}\left[e^{-\frac {t^2}4}\mathbb P\left[\mathcal N\left(\frac t2, \frac12\right) \ge 0\right]\right]\\
&= 2\frac{\mathrm d}{\mathrm d t}\left[e^{-\frac {t^2}4}\mathbb P\left[\mathcal N\left(0, 1\right) \ge \frac{-\frac t2}{\frac 1{\sqrt 2}}\right]\right]\\
&= 2\frac{\mathrm d}{\mathrm d t}\left[e^{-\frac {t^2}4}\mathbb P\left[\mathcal N\left(0, 1\right) \le \frac{t}{\sqrt 2}\right]\right]\\
&= 2\frac{\mathrm d}{\mathrm d t}\left[e^{-\frac {t^2}4}\Phi\left(\frac{t}{\sqrt 2}\right)\right]\\
&= 2\left(-2\frac t4 \Phi\left(\frac{t}{\sqrt 2}\right) + \frac1{\sqrt 2}\Phi'\left(\frac t{\sqrt 2}\right)\right)e^{-\frac{t^2}4}
\end{align}
A: Let
\begin{eqnarray}
g(t) &=& 2 \int_0^\infty e^{tx} e^{-x^2} dx \\
&=& 2 e^{t^2\over 4} \int_0^\infty e^{-(x-{t \over 2})^2} dx \\
&=& 2 e^{t^2\over 4} \int_{-{t \over 2}}^\infty e^{-x^2} dx \\
&=& \sqrt{2} e^{t^2\over 4} \int_{-{t \over \sqrt{2}}}^\infty e^{-{x^2 \over 2}} dx \\
&=& \sqrt{2} e^{t^2\over 4} \int_{-\infty}^{t \over \sqrt{2}} e^{-{x^2 \over 2}} dx \\
&=& 2\sqrt{\pi} e^{t^2\over 4} \Phi({t \over \sqrt{2}}) \\
\end{eqnarray}
Then
\begin{eqnarray}
M_F(t) &=& 2 \int_0^\infty x e^{tx} e^{-x^2} dx \\
&=& g'(t) \\
&=& 1 + \sqrt{\pi}t e^{t^2\over 4} \Phi({t \over \sqrt{2}})
\end{eqnarray}
