I am working on a problem, where I'm interested in computing the variance of the stock price in the next two years.
Using the GBM notation for the stock price,
I can write St as
$ S_t = S_0e^{(\mu - \frac{\sigma^2}{2})t + \sigma W_t} $
I have already calculated $E[St] = S_0e^{\mu t}$
Taking Variance as
$ Var[S_t] = E[S_T^2] - E[S_T]^2 $, I am having difficulties with $E[S_T^2]$
Currently, I have written it as:
$ E[S_T^2] = E[S_0^2e^{2(\mu - \frac {\sigma^2}{2})t + 2\sigma W_t}] $
Taking the constant variables out, I would have:
$ E[S_T^2] = S_0e^{2 \mu - \sigma^2T}E[e^{2 \sigma W_t}] $,
however this is not the same as what the results are suggesting, which show
$ E[S_T^2] = S_0e^{2\mu T + \sigma T}E[e^{\frac{-2 \sigma}{2T}+ 2\sigma Wt}]$.
I am not sure how I could reach the value that is in the solutions and any pointers would be appreciated. I am also not sure why the $\frac{-2 \sigma}{2T}$ is still in the expectations in the solutions, as I think it would make sense to have it outside, given that it is a constant.