I have been ask to price a European option with payoff $H(X_T,T) = X_T^2$ using the equivalent martingale measure (EMM).
For this I used the process:
\begin{equation} dX_t = r X_t dt + \sigma X_t d\tilde{B}_t \end{equation}
which is a geometric brownian motion in the EMM.
For the pricing we have:
\begin{equation} E[e^{-r(T-t)}f(X_T)|\mathfrak{F}_s] = e^{-r(T-t)}E\left[\left(X_t e^{(r - \frac{1}{2}\sigma^2)(T-t) + \sigma \omega \sqrt{T-t}}\right)^2|\mathfrak{F}_t\right] \end{equation}
where $\tilde{B}_{T-t}$ was replace by $\omega \sqrt{T-t}$ as $\tilde{B}_{T-t} \sim \mathcal{N}(0,T-t)$.
The condition of the expected value can be taken of as the process is a martingale under measure $Q$ and there fore the expected value can be computed, and this is where I get stuck. I have the following.
\begin{equation} \begin{aligned} e^{-r(T-t)}E\left[\left(X_t e^{(r - \frac{1}{2}\sigma^2)(T-t) + \sigma \omega \sqrt{T-t}}\right)^2|\mathfrak{F}_t\right] = e^{-r(T-t)}E\left[\left(X_t e^{(r - \frac{1}{2}\sigma^2)(T-t) + \sigma \omega \sqrt{T-t}}\right)^2\right] \\ = e^{-r(T-t)} \frac{1}{\sqrt{2\pi}}\int_{R} \left(X_t e^{(r - \frac{1}{2}\sigma^2)(T-t) + \sigma \omega \sqrt{T-t}}\right)^2 e^{-\frac{1}{2} \omega^2}d\omega \\ = e^{-r(T-t)} \frac{1}{\sqrt{2\pi}}\int_{R} X_t^2 e^{(2r - \sigma^2)(T-t) + 2\sigma \omega\sqrt{T-t}-\frac{1}{2}\omega^2}d\omega \\ = e^{r(T-t)}X_t^2 \frac{1}{\sqrt{2\pi}}\int_R e^{-\sigma^2(T-t) + 2\sigma\omega\sqrt{T-t} - \frac{1}{2}\omega^2} d\omega \end{aligned} \end{equation}
In a normal payoff like $(X_T - K)^+$ we would the $\omega$ for which the integral is positive and then factor everything in the exponent. But in this case I'm not sure how to continue as I'm not seeing an easy solution to the integral.