Solution (source code)

= Solution

The adsorption mechanism is uniform along the two vertical sides, and $X$ evolves independently of $Y$. Consequently the <mean first-passage time> depends only on the initial $x$-coordinate. Its <Kolmogorov backward equation> for $a_1=1$ is
$$
\tau''(x)+\tau'(x)=-1,\qquad -1<x<1.
$$

The forward <partially absorbing boundary condition for a diffusion> is $\mathbf J\mathbin\cdot\mathbf n=\kappa p$. The boundary term in the adjoint relation is
$$
\int_{\partial\Omega}
\left(\tau\,\mathbf J\mathbin\cdot\mathbf n
+p\,\partial_n\tau\right)ds,
$$
because the $X$ diffusion coefficient is one. It vanishes for every admissible $p$ precisely when
$$
\partial_n\tau=-\kappa\tau.
$$
For $\kappa=1$, the two <Robin boundary conditions> are therefore
$$
\tau'(-1)=\tau(-1),\qquad
\tau'(1)=-\tau(1).
$$

The general solution of the <ordinary differential equation> is
$$
\tau(x)=-x+C+De^{-x}.
$$
The right condition gives $C=2$, and the left gives $D=-2/e$. At the prescribed initial position,
$$
\boxed{\tau=\tau(0)=2-\frac2e.}
$$