First exit time How to calculate the first exit time of the process 
$$dx=-M\;dt+dw,$$
where $M$ is a positive constant, and $w$ is a Wiener process? Start from $d>0$, to the boundary $0$.
I solved the differential equation
$$\frac{T''(x)}2-MT'(x)=-1$$
with the condition $T(0)=0$. The solution has two parameters. Using the condition $T(0)=0$, one parameter can be determined. How can we determine the other parameter? Do we need to consider infinity as another boundary, and how to set the boundary condition?
Starting from $d$, this process will almost surely exit via $0$, not $\infty$.
Thanks much for any hint, discussion and help!
 A: Let $\tau=\inf\{t\geqslant0\mid x_t=0\}$. Since $x_t=w_t-Mt+d$, $\tau=\inf\{t\geqslant0\mid w_t=Mt-d\}$. Thus $\tau$ is a stopping time for $(w_t)$. Assume that $\tau$ is integrable. Then the optional stopping theorem yields $\mathrm E(w_\tau)=\mathrm E(w_0)=0$, hence $\mathrm E(x_\tau)=d-M\mathrm E(\tau)$. Since $\tau$ is integrable, $\tau$ is almost surely finite, hence $x_\tau=0$ almost surely, and $\mathrm E(\tau)=d/M$.
It remains to show that $\tau$ is integrable. But $[\tau\geqslant t+(d/M)]\subseteq A_t$ with $A_t=[w_t\geqslant Mt]$. By scaling, $\mathrm P(A_t)=\mathrm P(w_1\geqslant M\sqrt{t})$. When $t\to+\infty$, $\mathrm P(w_1\geqslant M\sqrt{t})=O(\mathrm e^{-t/2})$ hence $\tau$ is integrable (in fact, this proves that $\mathrm e^{c\tau}$ is integrable, for every $c\lt1/2$). The proof is complete.

Another method is to compute $t_h(x)=\mathrm E_x(\tau_{h})$ for every $0\leqslant x\leqslant h$, where 
$$
\tau_{h}=\inf\{t\geqslant0\mid x_t\in\{0,h\}\}.
$$
Then $t_h(0)=t_h(h)=0$ and, as you mentioned, $\frac12t''_h(x)-Mt'_h(x)=-1$ for every $x$ in $(0,h)$. The two boundary conditions yield
$$
t_h(x)=\frac{x}M-\frac{h}M\,\frac{\mathrm e^{2Mx}-1}{\mathrm e^{2Mh}-1}.
$$
Since $\tau=\sup\limits_h\ \tau_h$, $t_h(x)\to \mathrm E_x(\tau)$ when $h\to+\infty$, and $\mathrm E_x(\tau)=x/M$ for every $x\geqslant0$.
