Solution (source code)

= Solution

For $u\in C^2(\overline D)$, <Itô formula> shows that
$$
u(B_{t\wedge T})-u(x)
-\frac12\int_0^{t\wedge T}\Delta u(B_s)\,ds
$$
is a <martingale>. Take <expected value>[expectations] and let $t\to\infty$. The function $u$ is bounded on the <compact set> $\overline D$, while $\Delta u$ is bounded and $\mathbb E_xT<\infty$ by part (a). The <dominated convergence theorem> therefore gives <Dynkin formula for Brownian motion>
$$
\mathbb E_xu(B_T)
=u(x)+\frac12\mathbb E_x\int_0^T\Delta u(B_s)\,ds.
$$