---
title: Feynman–Kac PDE Residuals
url: https://www.emergentmind.com/topics/feynman-kac-pde-residual
type: topic
---

# Feynman–Kac PDE Residuals

The Feynman–Kac PDE residual is the differential, functional, weak, or viscosity operator obtained by moving all terms of a Feynman–Kac-type equation to one side after a stochastic representation has been specified. In the classical Markovian setting it is the left-hand side of a linear or semilinear parabolic PDE; in BSDE formulations it is the drift discrepancy produced by applying Itô’s formula to a candidate solution; in non-Markovian and path-dependent settings it becomes a functional residual on path space; and in rough, stochastic, or fully nonlinear regimes it is interpreted through weak formulations, viscosity inequalities, or semimartingale drift identities rather than pointwise equalities [1108.4317][1907.07104][1007.5507].

## 1. Basic definition through drift cancellation

In the semilinear parabolic framework, the central PDE has the form
\[
\partial_t u(t,x)+\mathcal L u(t,x)+f\bigl(t,x,u(t,x),\sigma^\top(t,x)\nabla u(t,x)\bigr)=0,\qquad u(T,x)=g(x),
\]
with
\[
\mathcal L u(t,x)=\nabla u(t,x)\cdot \mu(t,x)+\frac12 \operatorname{Tr}\!\Big(\sigma(t,x)\sigma(t,x)^\top \,\mathrm{Hess}_x\,u(t,x)\Big).
\]
The corresponding residual is therefore
\[
\mathcal R[u](t,x):=\partial_tu(t,x)+\mathcal Lu(t,x)+f\bigl(t,x,u(t,x),\sigma^\top(t,x)\nabla u(t,x)\bigr),
\]
together with the terminal residual \(u(T,x)-g(x)\) [2503.16407].

The Feynman–Kac principle identifies this residual with a drift term. If \(X\) solves the forward SDE and \(Y,Z\) solve the associated BSDE, then the representation
\[
Y_t=u(t,X_t),\qquad Z_t=\sigma^\top(t,X_t)\nabla u(t,X_t)
\]
implies that Itô’s formula applied to \(u(t,X_t)\) produces the same martingale part as the BSDE. The PDE residual is exactly the remaining drift term. Vanishing of the residual is thus equivalent to stochastic drift cancellation, and this remains the organizing principle even when the state variable, the generator, or the solution concept is generalized [2503.16407].

## 2. Classical linear and forward semilinear residuals

For linear Feynman–Kac formulas, the residual is the familiar parabolic operator. In the perturbed harmonic oscillator problem,
\[
\partial_t v(t,x)-\partial_x^2 v(t,x)+\bigl(x^2+c(t,x)\bigr)v(t,x)=0,
\]
the natural residual is
\[
\mathcal R[v](t,x)=\partial_t v(t,x)-\partial_x^2 v(t,x)+\bigl(x^2+c(t,x)\bigr)v(t,x).
\]
The same equation may be written in generator form with \(L=\partial_x^2-x^2\),
\[
\mathcal R[v](t,x)=\partial_t v(t,x)-Lv(t,x)+c(t,x)v(t,x),
\]
or with the harmonic oscillator operator \(H=-\partial_x^2+x^2\),
\[
\mathcal R[v](t,x)=\partial_t v(t,x)+Hv(t,x)+c(t,x)v(t,x).
\]
The Wiener-space representation proved for this problem yields \(\mathcal R[v]=0\) classically under stronger smoothness assumptions and weakly under the weaker assumptions of the main theorem [1009.4613].

A forward, nonconservative semilinear analogue appears in the representation of density evolution:
\[
\partial_t u=L_t^*u+u\,\Lambda(t,x,u,\nabla u),\qquad u(0,\cdot)={\bf u_0}.
\]
Here the residual is
\[
\mathcal R[u](t,x)=\partial_t u(t,x)-L_t^*u(t,x)-u(t,x)\Lambda(t,x,u(t,x),\nabla u(t,x)).
\]
In weak form, residual vanishing is expressed by testing against \(\varphi\in C_0^\infty(\mathbb R^d)\); in mild form, it is the Duhamel identity built from the transition kernel of the forward diffusion. The exponential weight in the forward Feynman–Kac formula supplies the nonconservative source term \(u\Lambda\), so the residual measures failure of self-consistency between the weighted law of the diffusion and the semilinear source evaluated at the resulting density and gradient [1608.04871].

## 3. Path-dependent and non-Markovian residuals

In the path-dependent setting of Peng and Wang, the state variable \((t,x)\) is replaced by a stopped path \(\gamma_t\), and the unknown becomes a functional \(u(\gamma_t)\). The associated BSDE is driven by the concatenated path
\[
B^{\gamma_t}(u):=\gamma_t(u)\mathbf 1_{[0,t)}(u)+\big(\gamma_t(t)+B(u)-B(t)\big)\mathbf 1_{[t,T]}(u),
\]
and the deterministic value functional is
\[
u(\gamma_t):=Y_{\gamma_t}(t).
\]
The path-dependent PDE is
\[
D_tu(\gamma_t)+D_{xx}u(\gamma_t)+ f\big(\gamma_t,u(\gamma_t),D_xu(\gamma_t)\big)=0,
\qquad u(\gamma)=\Phi(\gamma),
\]
so the residual is
\[
\mathcal R[u](\gamma_t):=D_tu(\gamma_t)+D_{xx}u(\gamma_t)+ f\big(\gamma_t,u(\gamma_t),D_xu(\gamma_t)\big).
\]
Its meaning is exact: functional Itô calculus shows that \(\mathcal R[u](B_s^{\gamma_t})\) is the drift left over when the candidate functional is inserted into the BSDE, while the martingale matching yields
\[
Z_{\gamma_t}(s)=D_xu(B_s^{\gamma_t}).
\]
In this framework the residual is a pointwise path-space object in the classical \(C^{1,2}\) regime [1108.4317].

Cosso develops the viscosity counterpart on an enlarged path space \(\Omega^{d+n}\), allowing possibly degenerate forward diffusions. The PPDE is
\[
-\partial_t \hat u(t,\omega^{d+n}) -(\hat{\mathcal L}\hat u)(t,\omega^{d+n})
-f\Big(t,\omega^d,\omega_t^n,\hat u,
\partial_{\omega^d}\hat u+\partial_{\omega^n}\hat u\,\sigma(t,\omega^d,\omega_t^n)\Big)=0,
\]
with terminal condition
\[
\hat u(T,\omega^{d+n})=g(\omega^d,\omega_t^n).
\]
The residual is therefore
\[
\mathcal R[\hat u]
=
-\partial_t \hat u-\hat{\mathcal L}\hat u
-f\Big(t,\omega^d,\omega_t^n,\hat u,
\partial_{\omega^d}\hat u+\partial_{\omega^n}\hat u\,\sigma\Big).
\]
For nonsmooth solutions it is not evaluated on \(\hat u\) itself, but on smooth test functionals selected by the path-dependent viscosity tangency condition. The residual remains the drift mismatch of \(\hat u(t,B^d,\hat X)\), but now encoded in viscosity inequalities rather than classical equalities [1202.2502].

## 4. Source terms, higher-order operators, and nonconservative formulations

The residual need not be a homogeneous second-order expression. For Brownian-time Brownian motion with multiplicative potential, the Feynman–Kac functional satisfies
\[
\frac{\partial}{\partial t}u(t,x)
=
\frac{1}{\sqrt{2\pi t}} \Big[\Delta f(x)+c(x)f(x)\Big]
+\left[\frac12 \Delta c(x)+\frac14 c^2(x)\right]u(t,x)
+\frac12 \nabla c(x)\cdot \nabla u(t,x)
+\frac12 c(x)\Delta u(t,x)
+\frac18 \Delta^2 u(t,x),
\]
with \(u(0,x)=f(x)\). The distinguishing term is the time-singular source
\[
R_f(t,x)=\frac{1}{\sqrt{2\pi t}\big(\Delta f(x)+c(x)f(x)\big)},
\]
which makes the initial function \(f\) enter the PDE itself rather than only the initial condition. In residual form, the full left-hand side is not merely a second-order backward operator but a fourth-order, source-perturbed expression [1005.3802].

A different departure from conservative diffusion occurs in McKean–Feynman–Kac equations. There the weighted law of a McKean-type diffusion is represented by a nonconservative semilinear PDE
\[
\partial_t u = L_t^* u - \operatorname{div}\bigl(b(t,x,u)u\bigr)+\Lambda(t,x,u)u,
\]
and the residual is
\[
\mathcal R(u)(t,x)
=
\partial_t u(t,x)-L_t^*u(t,x)
+\operatorname{div}\bigl(b(t,x,u(t,x))u(t,x)\bigr)
-\Lambda(t,x,u(t,x))u(t,x).
\]
The Feynman–Kac perturbation is the exponential weight
\[
\exp\left(\int_0^t \Lambda(s,Y_s,u(s,Y_s))\,ds\right),
\]
and it is precisely this factor that produces the zeroth-order nonconservative term in the residual. In the low-regularity framework of the paper, the rigorous meaning is the weak vanishing of this residual against test functions [1810.10205].

## 5. Viscosity, sublinear, and generalized residuals

When the diffusion generator itself is uncertain or optimized over a family of models, the residual becomes nonlinear in the Hessian and gradient. In the sublinear parabolic problem
\[
\partial_tu(t,x)+F\left(t,x,\nabla_xu,D_x^2u\right)+f(t,x,u,\nabla_xu)=0,
\qquad u(T,x)=g(x),
\]
the residual is
\[
\mathcal R[u](t,x)
=
\partial_tu(t,x)
+
F\!\left(t,x,\nabla_xu(t,x),D_x^2u(t,x)\right)
+
f\!\left(t,x,u(t,x),\nabla_xu(t,x)\right).
\]
Because
\[
F(t,x,p,S)=\max_{(b,\sigma)\in\mathcal K_F}
\left(
\frac12\langle \sigma^2(t,x),S\rangle+p^\dag b(t,x)
\right),
\]
the residual may also be written as a supremum of linear generator contributions. The associated stochastic representation is a supremum of expectations over controlled forward-backward systems, so the nonlinear residual is the PDE counterpart of model uncertainty or control in the probabilistic formulation [1907.07104].

Under volatility uncertainty in the \(G\)-expectation framework, the discounted payoff
\[
u(r,x):=\hat{\mathbb E}_r\left[\varphi(T,X_T^{r,x})e^{-\int_r^T X_s^{r,x}ds}\right]
\]
solves the fully nonlinear PDE
\[
u_t + 2G \left(u_x g(t,x) + \frac{1}{2} u_{xx} \left(h(t,x)\right)^2\right)  + f(t,x)u_x - xu =0.
\]
The corresponding residual is
\[
\mathcal R[u](t,x)
=
u_t(t,x)
+ 2G\!\left(u_x(t,x) g(t,x)+\frac12 u_{xx}(t,x)(h(t,x))^2\right)
+ f(t,x)u_x(t,x) - x\,u(t,x),
\]
or, equivalently,
\[
\mathcal R[u](t,x)
=
u_t(t,x)
+
\sup_{\sigma\in[\underline{\sigma}^2,\overline{\sigma}^2]}
\left[
\frac12 (h(t,x))^2\sigma\,u_{xx}(t,x)
+
(g(t,x)\sigma+f(t,x))u_x(t,x)
-
x\,u(t,x)
\right].
\]
The paper proves pointwise residual vanishing only for regularized equations; the limit solution is characterized in the viscosity sense [2012.08163].

With rough or stochastic coefficients, residuals are often meaningful only after regularization or testing. For the stochastic heat equation with fractional-in-time Gaussian noise,
\[
\partial_t u=\frac12\Delta u+u\,\partial_t W,
\]
the formal residual
\[
\partial_t u-\frac12\Delta u-u\,\partial_t W
\]
is not handled pointwise. Instead, the Feynman–Kac field is shown to satisfy the weak Stratonovich identity
\[
\int_{\mathbb R^d}(u(t,x)-u_0(x))\varphi(x)\,dx
-
\int_0^t\int_{\mathbb R^d}u(s,x)\Delta\varphi(x)\,dx\,ds
-
\int_0^t\int_{\mathbb R^d}u(s,x)\varphi(x)\,W(ds,x)\,dx
=0,
\]
obtained as the limit of classical residuals for symmetric time-regularized equations. Under a finite-entropy condition for rough \(b\) and \(V\), a different generalized notion arises: the Feynman–Kac function \(g\) belongs to the \(P\)-localized extended-generator domain of the reference diffusion and satisfies
\[
[(\mathcal L^{R,P}+V)g](X)=0
\quad dt\,dP\text{-a.e.},
\]
so the residual is a trajectorial semimartingale drift identity rather than a pointwise PDE equation [1007.5507][2104.09171].

## 6. Numerical and algorithmic interpretations

In modern computational language, the Feynman–Kac PDE residual may be used either directly as a differential operator or indirectly through probabilistic consistency conditions. The path-dependent theory of Peng and Wang already isolates the natural residual for an approximate functional \(\hat u\),
\[
\mathcal R[\hat u](\gamma_t)
=
D_t\hat u(\gamma_t)+D_{xx}\hat u(\gamma_t)
+f\bigl(\gamma_t,\hat u(\gamma_t),D_x\hat u(\gamma_t)\bigr),
\]
with terminal mismatch \(\hat u(\gamma)-\Phi(\gamma)\). Along simulated concatenated paths \(B^{\gamma_t}\), the drift discrepancy in the induced BSDE dynamics is precisely \(\mathcal R[\hat u](B_s^{\gamma_t})\), which gives a direct pathwise meaning to residual evaluation even though the paper itself does not propose a residual-minimization algorithm [1108.4317].

By contrast, deep Feynman–Kac methods for high-dimensional semilinear PDEs may avoid explicit differential residuals altogether. In the DFK-GT method, the PDE
\[
\partial_t u+\mathcal L u + f\bigl(t,x,u,\sigma^\top\nabla u\bigr)=0
\]
is enforced through a time-discrete Feynman–Kac recursion, and the minimized object is a Monte Carlo regression mismatch rather than a pointwise PINN residual. In the one-step form the natural sample residual is
\[
u_\theta(t_{n-1},x) -
\mathbb E\!\left[
u_\theta(t_n,X_{t_n})
+
f\bigl(t_n,X_{t_n},u_\theta(t_n,X_{t_n}),z_\theta(t_n,X_{t_n})\bigr)\Delta t_n
\,\middle|\, X_{t_{n-1}}=x
\right],
\]
while the DFK-GT variant replaces the one-step target by a recursively accumulated pathwise target \(\tilde u\). The resulting loss is therefore a discrete probabilistic consistency residual, not
\[
\partial_t u_\theta+\mathcal L u_\theta+f(\cdots)
\]
evaluated at collocation points. In the linear case, the backward target reduces to a direct Monte Carlo estimator of the Feynman–Kac payoff functional [2503.16407].

Across these formulations, the phrase “Feynman–Kac PDE residual” does not denote a single universal operator. It denotes a family of structurally related objects: a pointwise differential operator in smooth Markovian problems, a functional drift term on path space in non-Markovian BSDEs, a source-perturbed or higher-order operator in Brownian-time models, a weak or mild defect in stochastic or singular equations, a viscosity inequality under nonlinear generators, or a probabilistic consistency error in deep algorithms. What remains invariant is the underlying principle: the residual measures the failure of the stochastic representation and the PDE dynamics to produce the same drift.

Source: https://www.emergentmind.com/topics/feynman-kac-pde-residual