Let $\tau = \inf\{t >0 : |W_t| = 1\}$ where $W_t$ is brownian motion.
What is the expected value of $E\tau e^{-\lambda \tau}$, $\lambda > 0$?
I guess we need to find appropriate martingale (something like $e^{\alpha W_t - t\alpha^2/2}$ or $W_t^2 - t$) and use Doob's theorem but I can't understand what exactly.
$$ \mathsf{E}\tau e^{-\lambda\tau}=-\frac{d}{d\lambda}\mathsf{E}e^{-\lambda\tau}=-\frac{d}{d\lambda}\frac{1}{\cosh(\sqrt{2\lambda})}. $$