I'm trying to improve Euler-Maruyama discretisation by adding to it the analytical moments. To try it I made a very simple example on the stochastic process $X(t) = W(t)^2$, where $W(t)$ is a standard Wiener process. Using Ito’s formula, I found the SDE $dX(t) = dt + 2 \sqrt{X(t)} dW(t) $ satisfied by $X(t)$.
Using Euler-Maruyama’s method,I found the discretised version $$ \Delta X_i = \Delta t + 2 \sqrt{X_i \Delta t} N_i$$ with $N_i$ random number extracted from a standard Normal.
Now, I would like to change this equation plugging in the analytical moments. I am a bit confused though. It seems to me that the analytical mean of the process can be found observing that $\mu_X = \Delta t$, therefore $d \mu_X = dt$. I have been told that the additional step is $\mu_X = X_0 + t$ but I don't exactly get why.
Additionally, I would like to find the analytical variance, but since $\sigma_X = \mu_{X^2}-\mu_X^2$ I would also need to find $\mu_{X^2}$. I was thinking about squaring $X(t)$ and taking the mean but I'm a bit confused.
Thank to anyone who could provide some guidance.
Update
My professor's solution to find the variance is:
'By Ito's lemma $$dX^2 = (2X + 4\frac{X}{2}2)dt + 2\sqrt{X}2XdW = 6Xdt +4X^{3/2}dW $$
thus we must solve $$ d\mu_X^2 = 6\mu_X dt = 6 (X_0+t)dt $$
therefore
$$ \mu_X^2 = X_0^2 + 6 X_0 +3 t^2$$
then you find the variance with the above formula'
I have no idea what he's doing with Ito's lemma