For every integer $-b\leqslant x\leqslant a$, let $t_x=\mathrm E_x(T_a:T_a\lt T_{-b})$. Then $t_{-b}=t_a=0$ and the Markov property after one step yields $ t_x=\mathrm P_x(T_a\lt T_{-b})+\frac12(t_{x-1}+t_{x+1}), $ for every integer $-b\lt x\lt a$. Write this as $ (\Delta t)_x=-\mathrm P_x(T_a\lt T_{-b})=-\frac{x+b}{a+b}, $ where $\Delta$ is the discrete Laplacian operator, defined by $ (\Delta u)_x=\frac12(u_{x-1}+u_{x+1})-u_x. $ Let us check the effect of $\Delta$ on some simple sequences:
- If $u_x=1$ for every $x$, then $(\Delta u)_x=0$.
- If $u_x=x$ for every $x$, then $(\Delta u)_x=0$.
- If $u_x=x^2$ for every $x$, then $(\Delta u)_x=1$.
- If $u_x=x^3$ for every $x$, then $(\Delta u)_x=3x$.
One sees that $\Delta t=\Delta t^{c,d}$, where, for every $(c,d)$, $t^{c,d}$ is defined by $ t_x^{c,d}=\frac{c+dx-3bx^2-x^3}{3(a+b)}. $ If $t_{-b}^{c,d}=t_a^{c,d}=0$, then $t=t^{c,d}$ on $\{-b,a\}$ and $\Delta t=\Delta t^{c,d}$ on $(-b,a)$, thus $\Delta (t-t^{c,d})=0$. The maximum principle shows that $t=t^{c,d}$ everywhere.
In particular, $t_0=\frac{c}{3(a+b)}$ if $(c,d)$ solves the system $t^{c,d}_{-b}=t^{c,d}_a=0$. This yields $c=ab(a+2b)$. QED.