# Solve Ornstein-Uhlenbeck SDE : $dX_t=(-\alpha +\beta X_t)dt+\sigma dB_t.$

I have an SDE that looks that Ornstein-Uhlenbeck SDE :

$$dX_t=(-\alpha +\beta X_t)dt+\sigma dB_t.$$

I know that $$d(X_te^{\beta t})=e^{-\beta t}dX_t-e^{\beta t}X_t\beta dt=e^{-\beta t}(-\alpha +\beta X_t)dt-e^{\beta t}\sigma dB_t+e^{\beta t}X_t\beta dt$$ $$=-\alpha e^{-\beta t} dt+\sigma e^{-\beta t}dB_t$$ does it work ?

• You made an error, the second term in the first equality should be $X_t \beta e^{\beta t} dt$. But you'll see that the terms involving $X_t dt$ don't cancel after fixing that error, which was the whole point of the substitution. That should suggest how to fix the substitution to allow that cancellation.
– Ian
Commented Jun 20, 2019 at 15:06
• Your error is still there after the second equals sign.
– Ian
Commented Jun 20, 2019 at 15:08
• @Ian: thanks I corrected the typo. But How can I do now ? I can see that nothing cancel, that's why I ask here :)
– John
Commented Jun 20, 2019 at 15:08
• Think about the ODE situation. If you have $y'=y$, does it really help to look at $u=e^t y$? No, because then $u'=e^t y + e^t y' = 2u$, which is just as complicated as before. But $u=e^{-t} y$ helps. The goal of making this substitution in the SDE is exactly the same, to remove the $X_t dt$ term.
– Ian
Commented Jun 20, 2019 at 15:09
• I see. I edited. Does it work now ? @Ian
– John
Commented Jun 20, 2019 at 15:12

Indeed using the integrating factor approach as here Solution to General Linear SDE for $$dX_t = \big( a(t) X_t + b(t) \big) dt + \big( g(t) X_t + h(t) \big) dB_t,$$ we get
\begin{align*} X_t = & X_0 e^{ \beta t}+ e^{ \beta t}\left( \int_0^t e^{ - \beta s}(-\alpha) \mathrm{d}s + \int_0^t e^{ - \beta s}\sigma \mathrm{d}B_s\right). \end{align*}