# How to find mean of a stochastic differential equation

I have seen in many books and sites that to find the mean of a process $X_t$ defined by

$dX_t = \mu X_t dt + \sigma X_t dW_t$

where $\mu$ and $\sigma$ are constants and $W_t$ is a standard Wiener process (or Brownian motion) you can simply integrate both sides

$X_t = X_0 + \int_{0}^{t} \mu X_s ds + \int_{0}^{t} X_s dW_s$

and then apply the expected value operator $\mathbb{E}[\cdot]$ to both sides to get

$\mathbb{E}[X_t] = X_0 + \int_{0}^{t} \mu \mathbb{E}[X_s]ds + \mathbb{E}\left[\int_{0}^{t} \sigma X_s dW_s\right]$

And then simplify by setting $\mathbb{E}\left[\int_{0}^{t} \sigma X_s dW_s \right] = 0$, thus turning the SDE into an ODE in terms of the expectation of $X_t$. However, how do we know that $\mathbb{E}\left[\int_{0}^{t} \sigma X_s dW_s \right] = 0$ is true, and is this valid for an arbitrary term $\sigma(X_t,t) dW_t$? For instance, what would be the expected value for the SDE

$dX_t = \mu X_t dt + \sigma X_t^2 dW_t$?

I appreciate any help on this topic.

The expectation of the stochastic integral vanishes because the stochastic integral is a martingale. Recall the following well-known result:

Let $f=f(s,\omega)$ be a progressively measurable function. If $$\mathbb{E} \left( \int_0^T f(s)^2 \, ds \right)<\infty \tag{1}$$ for any $T>0$, then $$M_t := \int_0^t f(s) \, dW_s$$ is a martingale.

Martingales have constant expectation, and therefore we obtain in particular

$$\mathbb{E} \left( \int_0^t f(s) \, dW_s \right) \stackrel{\text{def}}{=} \mathbb{E}(M_t) = \mathbb{E}(M_0)=0.$$

Since the SDE

$$dX_t = b(X_t) \, dt + \sigma(X_t) \, dW_t$$

has a unique square-integrable (in the sense of $(1)$) solution for any Lipschitz continuous coefficients $b$, $\sigma$, we find by applying the above result that

$$\mathbb{E}(X_t) = \mathbb{E}(X_0) + \mathbb{E} \left( \int_0^t b(X_s) \, ds \right).$$