TITLE: Distribution of first exit time of Brownian motion
QUESTION [6 upvotes]: Let $B_t$ be standard one dimensional Brownian motion and $\tau = \inf\{s : B_s \notin (a,b) \}$ where $a<0<b$ are real numbers.
What is the distribution of $\tau$? 
I know that for hitting times $\tau_a = \inf \{s : B_s =a \}$ the distribution can be calculated with the reflection principle. And clearly $ \tau = \tau_a \wedge \tau_b$. So how can I continue?

REPLY [5 votes]: The Laplace transform of the density $f$ of $\tau$ is given by
$$
f^*(\lambda)\equiv \mathcal{L}\{f\}(\lambda)=\mathsf{E}e^{-\lambda \tau}=\frac{\cosh((b+a)\sqrt{\lambda/2})}{\cosh((b-a)\sqrt{\lambda/2})}, \quad\lambda>0
$$
(see, for example, Exercise 7.5.3 in Durrett's book). Then one needs to calculate the inverse Laplace transform to get $f$. For $t>0$,
$$
f(t)=\mathcal{L}^{-1}\{f^*\}(t)=\sum_{k=-\infty}^{\infty}(-1)^k\frac{\varphi_k(a,b)}{\sqrt{2\pi}t^{3/2}}\exp\left\{-\frac{(\varphi_k(a,b))^2}{2t}\right\},
$$
where
$$
\varphi_k(a,b):=\frac{b+a}{2}+\frac{b-a}{2}(1+2k).
$$