Hitting time for Brownian Motion Surplus Process I'm trying to solve this question for a continuous surplus process.
The surplus process is $$U_s=U_0+s-B_s$$ where $B_t$ is a Brownian motion representing payouts, $U_0$ is starting capital, $s$ is premiums
How do I calculate the probability of hitting zero (probability of ruin) before hitting a level $X$, where $X>U_0$?
Thoughts:
I've been shown to how to calculate the probability of ruin at a specific time, but I'm not sure how to find the probability of 'infinite' ruin and incorporate in the hitting $0$ before $X$ factor.
 A: Define
$$\tau:=\tau_x := \inf\{t \geq 0; U_t \notin [0,x]\}.$$
Since
$$U_t = U_0+t-B_t \geq U_0-B_t$$
we can conclude from the continuity of the sample paths and the fact that
$$\sigma := \inf\{t \geq 0; B_t = U_0-2x\} < \infty \quad \text{a.s.}$$
that $\tau<\infty$ a.s. Now set
$$M_t := e^{-2(U_t-U_0)}.$$
Applying Itô's formula, it follows easily that $(M_t)_{t \geq 0}$ is a martingale. Hence, by the optional stopping theorem (applied to the bounded stopping time $t \wedge \tau$)
$$\mathbb{E}M_{t \wedge \tau} = 1.$$
By the definition of the stopping time, we have $|U_{t \wedge \tau}| \leq U_0$; hence $|M_{t \wedge \tau}| \leq e^{2U_0}$. This means that we may apply the dominated convergence theorem and obtain
$$\mathbb{E}M_{\tau}=1. \tag{1}$$
On the other hand,
$$\mathbb{E}M_{\tau} = e^{-2(x-U_0)} \cdot \mathbb{P}(U_{\tau}=x) + e^{2U_0} \mathbb{P}(U_{\tau}=0). \tag{2}$$
Using that $\mathbb{P}(U_{\tau}=0) = 1- \mathbb{P}(U_{\tau}=x)$, we find by combining $(1)$ and $(2)$ that
$$\mathbb{P}(U_{\tau}=0) = \frac{e^{-2U_0}-e^{-2x}}{1-e^{-2x}}.$$

Alternative solution For a diffusion process
$$dX_t = \mu_t \, dt + \sigma_t \, dB_t$$
the scale function is defined by
$$s(x) := \int_{x_0}^x \exp \left(- \int_{y_0}^y \frac{2\mu(z)}{\sigma^2(z)} \, dz \right) \, dy$$
for arbitrary $x_0,y_0$. It satisfies (see e.g. Revuz-Yor)
$$\mathbb{P}^x(\tau_a<\tau_b) = \frac{s(b)-s(x)}{s(b)-s(a)} \tag{3}$$
for any $a<x<b$. If we apply this in the given setting, we find (for $x_0 := 0$, $y_0 :=0$)
$$s(x) := e^{-2x}-1$$
Plugging this into $(3)$ yields
$$\mathbb{P}^{U_0}(\tau_0<\tau_x) = \frac{e^{-2x}-e^{-2U_0}}{e^{-2x}-1}.$$
