Suppose that we have the following stochastic process and we want to find an expression for the expected value of this at time $t$ of the process at some future time $T$ of this process squared, $E[X^2_T]$.
$$dX_s=(\alpha X_s) ds + \sigma e^{-s} dW_s,\ X_t=x$$ In order to find an explicit solution for $E_{t,x}[X_T^2]$ I thought I should use Itô's lemma applied to the function $z(t,x)=x^2$. $$dz(t,X_s)=\left( (\alpha X_s)(2X_s) + \frac{1}{2}\sigma^2e^{-2s}(2)\right)ds+\sigma e^{-s}(2X_s)dW_s$$ Now we integrate and simplify a bit, plugging in the boundary condition $X_t=x$. $$z(T,X_T)= z(t,x) + \int_t^T \left( 2 \alpha X_s^2 + \sigma^2e^{-2s} \right)ds+ \int_t^T \sigma e^{-s}(2X_s)dW_s$$ We now take the expectation, which gives us the expression we are looking for, ie $E_{t,x}[z(T,X_T)] = E_{t,x}[X_T^2]$. $$E_{t,x}[z(T,X_T)]= z(t,x) + E_{t,x}\left[ \int_t^T \left( 2 \alpha X_s^2 + \sigma^2e^{-2s} \right)ds \right]+ E_{t,x}\left[ \int_t^T \sigma e^{-s}(2X_s)dW_s \right]$$ As usual we take the expectation of the stochastic term to be zero. $$E_{t,x}[z(T,X_T)]= z(t,x) + E_{t,x}\left[ \int_t^T \left( 2 \alpha X_s^2 + \sigma^2e^{-2s} \right)ds \right]$$
However, I am seeing that I have not really simplified anything since we sill have to take a expectation of $X^2_s$ in order to evaluate the integral. Am I missing something here or should I use a different technique besides Itô's lemma?
Assume we have proven that $\mathbb{E}_{t,x}[X_T^2] = x^2 + \mathbb{E}_{t,x}[\int_t^T 2\alpha X_s^2 + \sigma^2e^{-2s} ds]$.
(Note: this can be easily done using the fact that both the coefficients of the original SDE are lipschitz in $x$ uniformly wrt $t$, and thus $\mathbb{E}[\sup\limits_{0\leq s\leq T} X_s^2]$ is bounded)
Now, our equation can be rewritten as $\mathbb{E}_{t,x}[X_T^2] = x^2 + 2\alpha\mathbb{E}_{t,x}[\int_t^T X_s^2 ds] + \frac{1}{2}\sigma^2(e^{-2t}-e^{-2T})$. This means, since everything is positive, that $$ \mathbb{E}_{t,x}[X_T^2] = x^2 + 2\alpha\int_t^T\mathbb{E}_{t,x}[ X_s^2 ] ds + \frac{1}{2}\sigma^2(e^{-2t}-e^{-2T}). $$
We now pose $f(T) = \mathbb{E}_{t,x}[X_T^2]$ for every $T\geq t$. We have $f(t)=x^2$ and $f'(T) = 2\alpha f(T) + \sigma^2e^{-2T}$ for every $T\geq t$.
Can you finish now?