The reason $\ln(x)$ is chosen is this:

(Note: where I say $B_{t}$ I mean Brownian motion, which you denoted in your question as $W_{t}$)

The SDE you provided is one of the few we can explicitly solve. I'll talk about Geometric Brownian Motion (GBM) $dX_{t} = \mu X_{t} \,dt + \sigma X_{t} \,dB_{t}$, but as you mentioned in your question, your case is the same when $\mu$ becomes a function of $t$.

You can "multiply" the stochastic differential equation (SDE) in its differential form by $\frac{1}{X_{t}}$ to get $$\frac{1}{X_{t}}dX_{t} = \frac{1}{X_{t}}\mu X_{t} \,dt + \frac{1}{X_{t}}\sigma X_{t} \,dB_{t} $$
and this simplifies to $$ \frac{1}{X_{t}}dX_{t} = \mu \,dt + \sigma \,dB_{t}.$$

Notice that the right hand side no longer depends on $X_{t}$. Now recall Ito's formula for a $C^{2,1}$ function $f(t,x)$ ($C^{2,1}$ means $f$ is twice differentiable in $x$ and once differentiable in $t$). Ito's formula tells us if $X_{t}$ satisfies the previous SDE, then $f(t,X_{t})$ will satisfy:

$$d(f(t,X_{t})) = \frac{\partial f}{\partial t}(t,X_{t}) \,dt + \frac{\partial f}{\partial x}(t,X{t}) \,dX_{t} + \frac{1}{2} \frac{\partial^{2} f}{\partial x^{2}}(t,X_{t}) \,d[X]_{t}$$
where $[X]_{t}$ is the quadratic variation process of $X_{t}$. Notice that in the SDE given to us by Ito's formula, one of the terms on the right hand size is $\frac{\partial f}{\partial x}(t,X{t}) \,dX_{t}$. This almost looks like our $\frac{1}{X_{t}} \,dX_{t}$, which was the left hand side of our original SDE. If we can choose $f(t,X_{t})$ wisely such that these are equal (i.e., such that $\frac{\partial f}{\partial x}(t,X{t})= \frac{1}{X_{t}}$, then we can solve this special SDE.

Hopefully you see that we should have $f(t,x) = \ln(x)$ for the above equality to hold. Okay, so since $f$ doesn't depend on $t$, let's call it $f(x)$ to save space. Substituting this $f$ into Ito's formula above gives:

$$d(\ln(X_{t})) = 0 \,dt + \frac{1}{X_{t}} \,dX_{t} - \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t}$$

Hmm... on the right hand side there is conveniently a $\frac{1}{X_{t}} \,dX_{t}$ (which was the whole point! That's why we choose $f$ as we did) and we have an SDE for this already. We have that $\frac{1}{X_{t}}dX_{t} = \mu \,dt + \sigma \,dB_{t}$.

Okay, so solving for $\frac{1}{X_{t}}\,dX_{t}$ in the Ito's formula SDE gives

$$\frac{1}{X_{t}} \,dX_{t} =d(\ln(X_{t})) + \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t} $$

and this allows us to set the right hand side of the above equal to $\mu \,dt + \sigma \,dB_{t}$. So we have $$d(\ln(X_{t})) + \frac{1}{2} \frac{1}{X_{t}^2} \,d[X]_{t} = \mu \,dt + \sigma \,dB_{t}. $$

What is $d[X]_{t}$? If you do the computation, you get $\sigma^{2} X_{t}^{2} \,dt$, so that our equation becomes $$d(\ln(X_{t})) + \frac{1}{2} \sigma^{2} \,dt = \mu \,dt + \sigma \,dB_{t}. $$

This simplifies to $$\ln(X_{t}) = \ln(X_{0}) + \int \limits_{0}^{t}(\mu - \frac{1}{2} \sigma^{2}) \,dt + \int \limits_{0}^{t}\sigma \,dB_{t} $$

so that $X_{t} = X_{0}e^{\int \limits_{0}^{t}(\mu - \frac{1}{2} \sigma^{2}) \,dt + \int \limits_{0}^{t}\sigma \,dB_{t}}$.

## Best Answer

Let $Z_t=\frac{t}{2}+\ln{(X_t)}$ and denote quadratic variation by $\langle\cdot\rangle$. By Ito, $$dZ_t=d\left(\frac{t}{2}+\ln{(X_t)}\right)=\frac{dt}{2}+\frac{dX_t}{X_t}-\frac{\langle X_t\rangle}{X_t^2}\,dW_t$$ Now note that \begin{gather*} X_t=e^{Z_t-\frac{t}{2}} \\ dX_t=Y_t(dt+dW_t) \\ \langle X_t\rangle=Y_t \end{gather*} Thus \begin{align*} dZ_t&=\frac{dt}{2}+Y_te^{\frac{1}{2}t-Z_t}(dt+dW_t)-Y_te^{t-2Z_t}\,dW_t \\ &=\left(\frac{1}{2}+Y_te^{\frac{1}{2}t-Z_t}\right)dt+Y_te^{\frac{1}{2}t-Z_t}\left(1-e^{\frac{1}{2}t-Z_t}\right)\,dW_t \end{align*}

You've already noticed that $Y_t=Y_0e^{W_t-\frac{t}{2}}$, so we can substitute that to get a slightly nicer answer: $$dZ_t=\left(\frac{1}{2}+Y_0e^{W_t-Z_t}\right)dt+e^{W_t-Z_t}\left(1-e^{\frac{1}{2}t-Z_t}\right)\,dW_t$$