Solution (source code)

= Solution

Before the lifetime, $X>0$, so apply the <Itô formula> to $g(x)=\sqrt{x}$ after stopping inside compact subintervals of $(0,\infty)$. The derivatives are $g'(x)=1/(2\sqrt{x})$ and $g''(x)=-1/(4x^{3/2})$. Since the <quadratic variation> of $X$ satisfies $d[X]_t=X_tdt$, we get
$$
\boxed{dY_t=\frac12\,dB_t-\frac1{8Y_t}\,dt,\qquad Y_0=\sqrt{x_0},\quad t<T.}
$$
The negative drift is the second-order correction in the <Itô formula>. This is a <Lamperti transform> up to a constant scale: the <square root> transformation makes the noise coefficient constant. Its drift is singular at zero, which is why this <stochastic differential equation> is stated only before the boundary lifetime.