I want to use Ito's formula on the following SDE:
$$ dX_t= - \gamma (\log X_t - \theta) X_t d t + \sigma X_t d W_t $$
to obtain an expression for $ \log X_T $ where $T > t $ is some fixed time.
pretty new to this, I tried applying Ito's with $ f(t,X_t) = \log X_t $, but then is $f_t = 0$? My friend is also multiplying by an integrating factor of $e^{\gamma T}$, but I've honestly no idea why he's doing that. Any guidance would be much appreciated.
EDIT: I'm supposed to get:
I'm supposed to get $$\log X_T = e^{-\gamma (T - t)} \log X_t + \left( \theta - \frac{1}{2\gamma} \sigma^2 \right) ( 1 - e^{-\gamma (T - t)} )+ \sigma\int_t^{T} e^{-\gamma (T - s)} d W_s $$
and then make various claims about the mean and the variance as $t \to \infty $, though I think that part is straight forward enough
Using Ito's lemma for $log(X_t)$
$$dlog(X_t)=- \gamma (\log X_t - \theta) d t + \sigma d W_t-\frac{1}{2}\sigma^2dt=[- \gamma (\log X_t - \theta)-\frac{1}{2}\sigma^2]dt+\sigma d W_t.$$
Set $Z_t=log(X_t)$. You have
$$dZ_t=\gamma(c-Z_t)+\sigma d W_t$$
Here $c=\theta-\frac{1}{2\gamma}\sigma^2$. This is a standard OU-process for $Z_t$. It has the well-known solution (obtained using similar tricks you can find online)
$$Z_T=c+(Z_t-c)e^{-\gamma(T-t)}+\sigma \int_t^{T}e^{-\gamma(T-t)}dW_s$$.
Therefore
$$log(X_T)=\theta-\frac{1}{2\gamma}\sigma^2+(log(X_t)-\theta+\frac{1}{2\gamma}\sigma^2)e^{-\gamma(T-t)}+\sigma \int_t^{T}e^{-\gamma(T-t)}dW_s$$
$$=e^{-\gamma (T - t)} \log X_t + \left( \theta - \frac{1}{2\gamma} \sigma^2 \right) ( 1 - e^{-\gamma (T - t)} )+ \sigma\int_t^{T} e^{-\gamma (T - s)} d W_s ,$$
as was to be shown.