# Tag Info

For the general solution in the case where $f$ is not a constant, note that, from the SDE \begin{align*} dx_t = \theta(f(t)-x_t)dt + \sigma dW_t, \end{align*} we obtain that \begin{align*} d\big(e^{\theta t} x_t \big) = \theta e^{\theta t} f(t)dt + \sigma e^{\theta t} dW_t. \end{align*} Then \begin{align*} e^{\theta t} x_t = x_0 + \int_0^t \theta e^{\theta ...
You can just take expectations on both sides of your SDE/corresponding integral equation and obtain an ODE on the expectation function $m_t = \Bbb E[x_t]$: $$\dot m = \theta(f - m)$$ which you can easily solve using ansatz $m_t = c_t \mathrm e^{-\theta t}$ which brings you to  m_t = x_0\mathrm e^{-\theta t} + \theta\cdot\int_0^tf(s)\mathrm ...