How to use integration by parts in an example

We work on a filtered probability space. Let $\phi$ be an adapted predictable finite variation process, $S$ a cadlag submartingale, $T>0$ fixed, and $\tau,\sigma$ stopping times such that $0\leq\tau\leq\sigma\leq T$. How can we use integration by parts to show that the subsequent equality holds:

$(\phi\cdot(1_{[\tau,\sigma[}S))_T=(\phi1_{]\tau,\sigma]}\cdot S)_T + (\phi_{\tau}S_{\tau}-\phi_{\sigma}S_{\sigma})$

What I received so far: Using integration by parts, I get that

$(\phi\cdot(1_{[\tau,\sigma[}S))_T=(\phi1_{[\tau,\sigma[}S)_T-(1_{]\tau,\sigma]}S_{-}\cdot\phi)_T-[\phi,1_{[\tau,\sigma[}S]_T$.

How to proceed further?

Edit: In the first version of the question I wrote that $\phi$ is adapted, cadlag, FV. However, $\phi$ is adapted, predictable, FV.


Solution 1:

The following is a direct method to get the equality what you want. Denote $S^\sigma$ the stopped process of $S$ at $\sigma$, $(S^\sigma)_t=S_{t\wedge\sigma}$. Hence, \begin{gather*} 1_{[0,\sigma[}S=S^\sigma - S_{\sigma}1_{[\sigma,\infty[}\\ \begin{aligned} \phi\cdot 1_{[0,\sigma[}S &=\phi \cdot S^\sigma - \phi\cdot (S_{\sigma}1_{[\sigma,\infty[})\\ &=\phi 1_{[0,\sigma]}\cdot S-\phi_\sigma S_{\sigma}1_{[\sigma,\infty[}. \end{aligned} \end{gather*} Therefore, using $1_{[\tau,\sigma[}=1_{[0,\sigma[}-1_{[0,\tau[} $ get \begin{equation*} \phi\cdot 1_{[\tau,\sigma[}S=\phi 1_{]\tau,\sigma]}\cdot S +\phi_{\tau} S_{\tau}1_{[\tau,\infty[}-\phi_\sigma S_{\sigma}1_{[\sigma,\infty[}. \end{equation*}