I need to prove the variance of the geometric Brownian motion, but I'm stuck, since I managed to determine the expectation in this way
Let be $$G_t=G_0e^{\mu t+\sigma W(t)}$$ Then the mean is $$E[G_t]=E[G_0e^{\mu t+\sigma W(t)}]$$ $$=G_0e^{\mu t}E[e^{\sigma W(t)}]$$ Where $E[e^{\sigma W(t)}]$ $$E[e^{\sigma x}]=\int_{-\infty}^{\infty}e^{\sigma x}\frac{1}{\sqrt{2\pi t}}e^{-\frac{x^2}{2t}}dx$$ $$=\int_{-\infty}^{\infty}e^{\frac{\sigma^2}{2}t}e^{-\frac{(x-\sigma t)^2}{2t}}\frac{1}{\sqrt{2\pi t}}dx$$ $$=e^{\frac{\sigma^2}{2}t}$$ Therefore $$E[G_t]=G_0e^{(\mu+\frac{\sigma^2}{2})t}$$
But when I try $$Var(G_t)=E[G_t^2]-[E[G_t]]^2$$ I don't know how to compute $E[G_t^2]$
OK, I've tried this
$$E[G_t^2]=E[G_0^2e^{2X(t)}]=G_0^2E[e^{2(\mu t+\sigma W(t))}]=G_0^2e^{2\mu t}E[e^{2\sigma W(t)}]$$
Where $E[e^{2\sigma W(t)}]$ $$E[e^{2\sigma W(t)}]=\int_{-\infty}^{\infty}e^{2\sigma x}\frac{1}{\sqrt{2\pi t}}e^{-\frac{x^2}{2t}}dx$$ $$$$ $$=\int_{-\infty}^{\infty}e^{2\sigma^2t}e^{-\frac{(x-2\sigma t)^2}{2t}}\frac{1}{\sqrt{2\pi t}}dx$$ $$=e^{2\sigma^2t}$$
Then $$E[G_t^2]=G_0^2e^{2\mu t}e^{2\sigma^2 t}=G_0^2e^{2t(\mu +\sigma^2)}$$ $$\therefore Var[G_t]=G_0^2e^{2t(\mu +\sigma^2)}-G_0^2e^{2(\mu+\frac{\sigma^2}{2})t}$$