# Solve the following SDE: $\mathrm{d}X_t = a(b-X_t) \,\mathrm{d}t + c X_t \, \mathrm{d}W_t$

Let $$\mathrm{d}X_t = a(b-X_t) \,\mathrm{d}t + c X_t \, \mathrm{d}W_t$$ be a stochastic differential equation where $$a$$, $$b$$, and $$c$$ are positive constants, so I tried to solve it but I got stuck in the process, here is my attempt:

$$\mathrm{d}X_t = a(b-X_t) \, \mathrm{d}t + c X_t \, \mathrm{d}W_t$$ $$\mathrm{d}X_t = ab \, \mathrm{d}t - aX_t \, \mathrm{d}t + c X_t \, \mathrm{d}W_t$$ $$\mathrm{d}X_t + aX_t \, \mathrm{d}t - c X_t \mathrm{d}W_t = ab \, \mathrm{d}t$$ $$\int_0^t \mathrm{d}X_t + \int_0^t aX_t \, \mathrm{d}t - \int_0^t c X_t \, \mathrm{d}W_t = \int_0^t ab \, \mathrm{d}t$$

What should I do from here?

Let \begin{align*} Y_t = e^{(a+\frac{c^2}{2})t-cW_t}. \end{align*} Then \begin{align*} dY_t = Y_t\left[\big(a+c^2\big)dt -c dW_t \right]. \end{align*} Moreover, \begin{align*} d(X_tY_t) &= Y_t dX_t + X_t dY_t + d\langle X, Y\rangle_t\\ &=abY_tdt. \end{align*} That is, \begin{align*} X_t = Y_t^{-1}\left(X_0 + ab\int_0^t Y_sds\right). \end{align*}

I've seen that Gordon answer is more concise and to the point. Take this as a complementary answer.

This is a general approach that will work for all this type of linear SDEs, not just this one. Assume we have the following linear SDE

$$dX_t = (F_t X_t +f_t)dt + (G_t X_t +g_t)dB_t \tag*{(1)}$$

where $$F, G, f$$ and $$g$$ are Borel measurable bounded functions.

The corresponding homogeneous equation of Eq (1) is $$dX_t = F_t X_tdt + G_t X_tdB_t, \tag*{(2)}$$ Equation (2) has a unique solution (this can be proved by checking that $$F$$ and $$G$$ satisfies the Lipschitz and linear growth conditions). So if one finds a solution, we know is THE solution. The solution is $$\Phi_t = \Phi_0 \exp \left(\int_{t_0}^t (F_s -\frac{1}{2}G^2_s)ds + \int_{t_0}^t G_s dB_s \right). \tag*{(3)}$$ This is a well known result (you can check that (3) is the solution to equation Eq (2) by using Ito's formula). Then the solution to Eq(1) is given by the variation-of-constants formula $$X_t = \Phi_t \left( X_0 + \int_{t_0}^t \Phi^{-1}_s[f_s - G_sg_s]ds + \int_{t_0}^t \Phi^{-1}_s g_s dB_s \right). \tag*{(4)}$$ In your case, Eq (1) simplifies a lot because we have $$f(t)= ab ; \quad F(t) = -a; \quad G(t) = c; \quad g(t) = 0. \tag*{(*)}$$ so your homogeneous equation is the classical Black-Scholes equation (but with the parameter 'a' negative instead of positive). We can get the solution by substituting (*) in Equation (3) or (if you prefer) by applying Ito's formula to Eq (2) with the function $$f(x)= \ln x$$. In any case, the solution to the homogeneous equation is $$\Phi_t = \Phi_0 e^{-(a + \frac{1}{2} c^2)t + c B_t}. \tag*{(5)}$$

Finally, input (5) into (4) to get the solution to your equation $$X_t = \Phi_t \left( X_0 + ab \int_0^t \Phi_s^{-1} ds \right ).$$

For a proof of these results you can see, for example, Oksendal or Mao Xuerong books.