# Second Moment of Stock Process

I have a stock process which I have decided to model as $$S_T=S_t\exp((r-q-\frac{1}{2}\sigma^2)(T-t)+\sigma(W_T-Wt))-D_T$$ where $D_T$ is a cash dividend at time $T$. This dividend is known. I then calculated its second moment as $$\mathbb{E}(S_T^2)=[S_t\exp((r-q)(T-t))]^2\exp(\sigma^2(T-t))-2D_TS_t\exp((r-q)(T-t))+D_T^2$$ My questions is, how would this expression change if there were say $n$ dividends (all different) between times 0 and T.

If $D_i$ is dividend paid at time $t_i \in [t, T]$ , then future value of all dividends payments (assuming payments are known in advance), $D$, is: $$D= \sum_{i=i}^{n} D_i e^{r(T-t_i)}$$
Since all payments are known in advance, $D$ is constant like $D_T$ ( in your example). So, just replace $D$ with $D_T$ in your expression of $\mathbb{E}(S_t^2)$, you will get desired result.