AbstractWe establish a local martingaleMassociate withf(X,Y) under some restrictions onf, whereYis a process of bounded variation (on compact intervals) and eitherXis a jump diffusion (a special case being a Lévy process) orXis some general (càdlàg metric-space valued) Markov process. In the latter case,fis restricted to the formf(x,y)=∑k=1Kξk(x)ηk(y). This local martingale unifies both Dynkin's formula for Markov processes and the Lebesgue–Stieltjes integration (change of variable) formula for (right-continuous) functions of bounded variation. For the jump diffusion case, when further relatively easily verifiable conditions are assumed, then this local martingale becomes anL2-martingale. Convergence of the product of this Martingale with some deterministic function ( of time ) to 0 both inL2and almost sure is also considered and sufficient conditions for functions for which this happens are identified.