Solution of an SDE Can someone guide me on how to solve the SDE
\begin{equation}
dX_{t} = \gamma(a-\beta X_{t})dt + \delta X_{t}dW_{t} 
\end{equation}
where $a,\beta,\gamma,\delta$ are all positive constants? I tried to approach like an Ornstein-Uhlenbeck SDE but I don't think it is the right way.
 A: In interest rate modeling, this is known as the Brennan and Schwartz model. My understanding is that, there is no close form solution, and numerical methods are used in practice.
A: Since it seems like what you wrote is a linear SDE of the form $dX_t=(a+b.X_t)dt+(c+d.X_t)dW_t$, I think a solution is available (no ?)
Define $$\epsilon _t := \exp\left[\int_0^t b-\frac{d^2}{2} ds + \int_0^td. dW_s\right]$$, then $$X_t=\epsilon _t.\left[X_0+\int_0^t\frac{a-c.d}{\epsilon _s}ds + \int_0^t\frac{c}{\epsilon _s}dW_s \right]$$ Also since in that case the coefficients are constant then I think you can work out the integrals.
In your case the substitutions are :
$$ a \Rightarrow a\gamma \\
b \Rightarrow  -\gamma\beta \\
c \Rightarrow  0 \\
d \Rightarrow  \delta $$
Correct me if I am wrong though 
A: This linear SDE can be solve by an integrating factor, treating it formally just like an ODE. Firstly, $\gamma$ is unnecessary and can be absorbed into $\alpha$ and $\beta$. We thus need to solve (I use physics notation):
$$ \frac{dX}{dt} = (\alpha - \beta X) + c X f(t), $$
with $\left\langle f(t) \right \rangle = 0$ and $\left\langle f(t) f(t') \right \rangle = \delta(t-t')$. This may be rearranged to get
$$\frac{dX}{dt} +  [\beta-c f(t)]X = \alpha $$
This equation permits the simple integrating factor
$$ \exp\left(\beta t-c \int^t f(t')dt'  \right),$$
giving
$$ \frac{d}{dt}\left[ X \exp\left(\beta t-c \int^t_0 f(t')dt'  \right) \right] = \alpha \exp\left(\beta t-c \int^t_0 f(t')dt'  \right) $$
Integrate from $0$ to $t$ to find
$$X(t) =  \left[ X_0 \exp\left(-\beta t+c \int_0^t f(t')dt'  \right) + \int_0^t \alpha \exp\left(-\beta (t-t')+c \int^{t}_{t'} f(t'')dt''  \right) dt' \right]. $$
This is the formal solution of your equation.
A: Another Idea can be:
Take $g(x,t)=e^{\gamma\beta t}\times X$,apply It$\hat o$ dif. rule.
$$dg=\frac{\partial g}{\partial t}dt+\frac{\partial g}{\partial x}dX+\frac 12\frac{\partial^2 g}{\partial X^2}(dX)^2\\
dg=\gamma\beta e^{\gamma\beta t}Xdt+e^{\gamma\beta t}dX+\frac12(0)\\$$now put $dX_{t} = \gamma(a-\beta X_{t})dt + \delta X_{t}dW_{t} $so
$$dg=\gamma\beta e^{\gamma\beta t}Xdt+e^{\gamma\beta t}dX\\
dg=\gamma\beta e^{\gamma\beta t}Xdt+e^{\gamma\beta t}\big(\gamma(a-\beta X_{t})dt + \delta X_{t}dW_{t})\big)\\dg=e^{\gamma\beta t}\gamma adt+e^{\gamma\beta t}\delta X_{t}dW_{t}$$left hand side is complete differential ,so apply integration to both sides
$$\int dg=\int e^{\gamma\beta t}\gamma adt +\int e^{\gamma\beta t}\delta X_{t}dW_{t}\\g(x,t)-g(x_0,0)=\gamma a\int_0^t e^{\gamma\beta s}ds+\delta \int_0^t e^{\gamma\beta s} X_{s}dW_{s}\\
e^{\gamma\beta t}\times X-X_0=\gamma a\int_0^t e^{\gamma\beta s}ds+\delta \int_0^t e^{\gamma\beta s} X_{s}dW_{s}\\
e^{\gamma\beta t}\times X-X_0=\gamma a(\frac{1}{\gamma\beta})(e^{\gamma\beta t}-1)+\delta \int_0^t e^{\gamma\beta s} X_{s}dW_{s}\\
e^{\gamma\beta t}\times X=X_0+(\frac{a}{\beta})(e^{\gamma\beta t}-1)+\delta \int_0^t e^{\gamma\beta s} X_{s}dW_{s}\\\times e^{-\gamma\beta t} \\
X=X_0e^{-\gamma\beta t}+\frac{a}{\beta}(1-e^{-\gamma\beta t})+\delta e^{-\gamma\beta t}\int_0^t e^{\gamma\beta s} X_{s}dW_{s}$$
