We know that the solution of the heat equation $\partial_tu=\frac 12\Delta u$ with Dirichlet boundary condition $u\rvert_{\partial\Omega}=g$ is $u(t,x)=\mathbb{E}[g(B_\tau)\mid B_t=x]$, with $\tau$ the hitting time of the boundary by standard Brownian motion $B_t$.

I am looking for a reference that provides a similar stochastic representation of heat equation on a domain with smooth boundary with **Neumann boundary condition**, using reflected Brownian motion. The equation I just described is the following: $$\partial_t u = \frac 12\Delta u,\quad\frac{\partial u}{\partial\mathbf{n}}(t,x)=g(x),\quad\forall x\in\partial\Omega,t>0.$$ I suspect this should be in some standard textbooks, but I can't find it in some common stochastic calulus books….