# Problem with deriving the dynamics of a process

I'm trying to solve the following problem. Given a process $X_t$ and a process $Z_t$, with the dynamics of $X_t$ as

$$dX_t = (\alpha + \beta X_t)dt + (\gamma + \sigma X_t)dW_t$$

and $Z_t$ defined as

$$Z_t = \exp(\sigma W_t + (\beta-\frac{1}{2} \sigma^2)t)$$

where $W_t$ is a standard brownian motion, $\alpha$, $\beta$, $\gamma$ and $\sigma$ constants in $R$, i have to find the dynamics of the process $X_t / Z_t$.

Now, i've tried the following.

1) I treat the process $X_t / Z_t$ as a function of $X_t$ and $t$, and derive the dynamics of $d(X_t/Z_t)$ using Itô's formula. The solution i arrive at is somewhat complicated, and after i've derived the dynamics of $X_t / Z_t$ i also have to find an explicit solution to the stochastic differential equation, that is $d(X_t / Z_T)$ where $X(0)=0$ (i assume in that case, $Z(0) = 1$ such that $X(0)/Z(0) = 0$ is well-defined). Based on my result, i don't think this is the way to go since deriving an explicit formular afterwards seems very complicated.

2) I've tried to derive a solution for $X_t$ by using the "geometric brownian motion trick" of dividing either side of the equation for $dX_t$ by $X_t$, integrating on both sides, recognizing that the solution "looks like" $ln X_t$ and then moved forward, but i don't end up with something remotely nice (probably since $X(t)$ is not a geometric brownian motion).

3) $Z(t)$ is clearly a geometric brownian motion. I've been wondering if that is the key to solve the problem.

Can anyone give any tips or tricks that might aid me in solving this problem? Thank you for your time.

Use the 2D version of Ito on $d (\frac{X}{Z})$.
Ito on 2 variables gives $d f(X,Z) = f_x dX + f_z dZ + 0.5*(f_{xx} dX^2 + f_{zz} dZ^2 + 2 f_{xz} dX dZ)$.
in your case $f(x,z) = \frac{X}{Z}$. You know what $dX$ is, thus just plug in. You have what Z is. To find $dZ$ apply Ito on Z and "ito differentiate". Plug in dZ this gives you the dynamics you re looking for.
This is basically the integral factor technique for finding the solution of $X_t$; see also this question. Note that $$d\left(\frac{1}{Z_t}\right) = \frac{1}{Z_t}\left[(\sigma^2-\beta) dt - \sigma dW_t\right].$$ Then, \begin{align*} d\left(\frac{X_t}{Z_t}\right) &= X_t d\left(\frac{1}{Z_t}\right) +\frac{1}{Z_t} dX_t + d\Big\langle X, \, \frac{1}{Z}\Big\rangle_t\\ &=\frac{X_t}{Z_t}\Big[(\sigma^2-\beta) dt - \sigma dW_t\Big]\\ &\quad +\frac{1}{Z_t}\Big[(\alpha + \beta X_t)dt + (\gamma + \sigma X_t) dW_t \Big]-\sigma^2\frac{X_t}{Z_t}dt\\ &=\frac{1}{Z_t}(\alpha\, dt + \gamma\, dW_t). \end{align*} Therefore, \begin{align*} \frac{X_t}{Z_t} = \alpha \int_0^t \frac{1}{Z_s} ds +\gamma\int_0^t \frac{1}{Z_s} dW_s. \end{align*} That is, \begin{align*} X_t &= Z_t\left[ \alpha \int_0^t \frac{1}{Z_s} ds +\gamma\int_0^t \frac{1}{Z_s} dW_s\right] \\ &= \alpha\int_0^t e^{-\big(\frac{1}{2}\sigma^2 -\beta\big)(t-s) +\sigma(W_t-W_s)}ds +\gamma \int_0^t e^{-\big(\frac{1}{2}\sigma^2 -\beta\big)(t-s) +\sigma(W_t-W_s)}dW_s. \end{align*}