(I'm much more used to number theory than to stochastic processes, so there are probably a lot of errors in the following:)
Consider a stochastic differential equation $dx = F(t,x) dt + \sigma dW$, where $W$ is the standard Wiener process, and a stopping time $T$ which for now will be $\inf \left\{ t \geqslant 0, x(t) \geqslant c\right\}$ for some $c$. (I know that $x(0) < c$ and $T < \infty$ almost surely).
I want to compute (some approximation of) the repartition of $t$. My reasoning is the following. Let $u(t,x)$ be a regular function $\mathbb [0,+\infty[ \times \mathbb R \rightarrow \mathbb R$; then by Itô's lemma I know that $$(1)\qquad \frac{d}{dt} E(u(t,x)) = \frac{\partial u}{\partial t} + F(t,x(t)) \frac{\partial u}{\partial x} + \frac{\sigma^2}{2} \frac{\partial^2 u}{\partial x^2}.$$ Therefore, assuming that the right-hand side is zero, $u(t,x(t))$ is a martingale. Thus, by the optional stopping theorem, $$(2)\qquad E(u(T, x(T))) = u(0, x(0)).$$ Therefore, my strategy for computing, say, the $n$-th moment of $T$ would be to solve the partial differential equation $$ (3)\qquad \begin{cases} \frac{\partial u_n}{\partial t} + F(t,x) \frac{\partial u_n}{\partial x} + \frac{\sigma^2}{2} \frac{\partial^2 u_n}{\partial x^2} = 0,\\ u_n(t,c) = t^n &\text{(boundary condition);} \end{cases}$$ then the $n$-th moment is $E(T^n) = u_n(0, x(0))$. However, having a boundary condition on only the $t = 0$ boundary is obviously not enough to fully determine $u$. For example, in the case where $F = 0$ (Brownian process), if $u$ is a solution of (3) then so is $u + \lambda (x-c)$.
My question is: what is the missing boundary (or other) condition in (3) that guarantees the unicity of the solution, and that (2) will hold?
Obviously this cannot be a condition on $u(0,x)$ (because this is what I am trying to determine here). I guess that the missing condition would be some kind of boundedness condition coming from the hypotheses of the optional stopping theorem (which I admit to not understand in full), but this is not obvious either: again in the case where $F = 0$ the function $u(t,x) = x^2 - t$ is a “good” solution (it is classically used to compute the expectation of hitting times for Brownian motion).