I’m a grad quant student and I’m struggling with this model
$$dX_t = k(\mu-Χ_t)dt+\sigma dW_t$$
I’m given this Vasicek model And after applying Itô's lemma with $$S_t = e^X$$
$$\frac{dS_t}{S_t}=[k(\mu-\ln(S_t))+\frac{1}{2}\sigma^2]d_t+\sigma dW_t $$
They get to this equation
$$ S_t = e^{\ln(S)e^{-k(t-s)}+ \mu \left(1-e^{-k(t-s)}\right)+\sigma\int_{s}^{t}e^{-k(t-u)}\,dW_u}$$
And I’ve got no clue how to derive this last equation after Itô's lemma, could anyone enlighten me? No intermediate steps are shown in my professor's slides.
As suggested in the comments, let $g(x,t) = e^{kt}x$. The relevant derivatives are: $$\begin{align*} g_t(x,t) &= ke^{kt}x \\ g_x(x,t) &= e^{kt} \\ g_{xx}(x,t) &= 0 \end{align*}$$ Applying Itô's lemma to $S_t = g(X_t, t)$, we get: $$\begin{align*} dS_t &= ke^{kt}X_t dt + e^{kt} dX_t \\ &= ke^{kt} X_t dt + e^{kt}[k (\mu - X_t)dt + \sigma dW_t] \\ &= k\mu e^{kt}dt + \sigma e^{kt} dW_t \end{align*}$$ Thus, $$S_t -S_0 = e^{kt} X_t - X_0 = \mu e^{kt} + \sigma \int_0^t e^{ks}dW_s$$ So that $$X_t = X_0 e^{-kt} + \mu + \sigma e^{-kt} \int_0^t e^{ks}dW_s$$