In the book "Semimartingale theory and Stochastic Calculus" from He, Wang and Yan I found the following integration by parts formula for semimartingales (Theorem 9.33):
If $X$ and $Y$ are semimartingales then, $$X_tY_t = \int_0^t X_{s-} \text{d} Y_s + \int_0^t Y_{s-} \text d X_s + X_0Y_0 + \langle X^c, Y^c\rangle _t + \sum_{s\le t} \Delta X_s \Delta Y_s$$ where $X_{s-} := \lim_{r\nearrow s} X_s$ and $X^c$ denotes the continuous part of $X$, $\langle \rangle_t $ is the quadratic variation and $\Delta X_s := X_s - X_{s-}$. In my application I have given the case that $Y$ is in fact purely discontinuous and both $X$ and $Y$ have finitely many jumps up to a time $t>0$.
In this case I conjecture that $$X_tY_t = X_0Y_0 + \int_0^t Y_{s-} \text d X_s^c + \sum_{s\le t} \Delta (XY) _s$$
In my calculation by intuition I assumed the following: $$\int_0^tX_{s-} \text dY_s = \sum_{s\le t}X_{s-} \Delta Y_s \quad\text{and}\quad \int_0^t Y_{s-} \text d X_s = \int_0^t Y_{s-}\text dX_s^c + \sum_{s\le t} Y_{s-} \Delta X_s$$ Is this true? If yes, how can I prove it? The reason must be that there are just finitly many jumps.
Edit: I searched in the book but the definition of purely discontinuous is not clear to me. Anyway, may I just state the particular situation I work with: Let us take the definition of pure jump type from here. Then in my case $X = M + A$, where $M$ is a local martingale (possibly with jumps) and $Y,A$ are pure jump type. Unfortunately, I really want to use this integration by parts formula.
I think what you conjectured would be true if $Y$ is a pure jump process, but the condition of a purely discontinuous $Y$ is too weak. Indeed, $Y$ is purely discontinuous if and only if $\langle Y\rangle$ is a pure jump process (by definition). However, we can easily find examples in which $Y$ is purely discontinuous and has finitely many jumps but $\mathrm dY^c\ne 0$ on some intervals. For example, consider a degenerate case (i.e., $Y_t(\omega)$ is given by $Y(t)$ below almost surely): $$Y(t)=\begin{cases}t, &\text{if }0\le t<1\\t+1, &\text{otherwise}\end{cases}$$ It is easy to verify that $$\langle Y\rangle_t=\begin{cases}0, &\text{if }0\le t<1\\1,&\text{otherwise}\end{cases},$$ which is a pure jump process, and so $Y$ is purely discontinuous. In this case, we have $\mathrm d Y^c_t=1$ for each $t>0$. Notice that $Y$ exhibits finitely many jumps (indeed only one jump) almost surely for $t>1$.