Question
Let $W_t = (X_t, Y_t)$ be planar Brownian motion started at $(x,y)$ with $x>0$, $y>0$.
What is the probability that the process hits the $y$-axis before the $x$-axis, i.e.
$\mathbb{P}[\tau_y < \tau_x]$, where $$ \tau_x = \min\{t : Y_t = 0\}, \qquad \tau_y = \min\{t : X_t = 0\}? $$
Solution

Define $\tau = \min\{\tau_x, \tau_y\}$ and let $u(x,y)$ be twice differentiable.

Itô’s formula gives

$$ u(X_\tau, Y_\tau) - u(x,y) = \int_0^\tau u_x dX_t + \int_0^\tau u_y dY_t + \frac12 \int_0^\tau (u_{xx} + u_{yy}) dt. $$

Choose $u$ to solve the boundary value problem $$ \begin{cases} \Delta u = 0, & x>0,\ y>0 \\ u(0,y) = 1, & y>0 \\ u(x,0) = 0, & x>0. \end{cases} $$

Since $\Delta u = 0$ and the stochastic integrals have mean zero, $$ u(x,y) = \mathbb{E}[u(X_\tau, Y_\tau)]. $$ On the boundary, $u=1$ on the $y$-axis and $u=0$ on the $x$-axis, so $$ u(x,y) = 1 \cdot \mathbb{P}[\tau_y < \tau_x] + 0 \cdot \mathbb{P}[\tau_x < \tau_y] = \mathbb{P}[\tau_y < \tau_x]. $$

Thus we compute $u$ from Laplace’s equation with the stated boundary conditions.

Switch to polar coordinates $(r,\theta)$ with $$ x = r\cos\theta,\qquad y = r\sin\theta,\qquad 0 < \theta < \frac{\pi}{2}. $$ The angular boundary conditions become $$ u(r,0) = 0,\qquad u\left(r, \frac{\pi}{2} \right) = 1. $$

Look for solutions independent of $r$: $u(r,\theta) = f(\theta)$.
Then $\Delta u = 0$ reduces to $$ f’’(\theta) = 0, $$ so $f(\theta) = a + c\theta$.

Use the boundary values: $$ f(0) = 0 \implies a = 0, \ f\left(\frac{\pi}{2}\right) = 1 \implies c\frac{\pi}{2} = 1 \implies c = \frac{2}{\pi}. $$

Therefore $$ u(r,\theta) = \frac{2}{\pi}\theta. $$

Since $\theta = \arctan(y/x)$ for the starting point $(x,y)$, we obtain $$ \mathbb{P}[\tau_y < \tau_x] = u(x,y) = \frac{2}{\pi} \arctan\left(\frac{y}{x}\right). $$