I am told that the following equality follows from integration by parts:
$$\int_{R-k}^{1}(\theta-R)dG(\theta)-G(R-k)k=\int_{R-k}^{1}(1-G(\theta))d\theta-k$$ Where $R>k>0$ and $G$ is the CDF of $\theta$ which is distributed on $[0,1]$. Can someone explain how integration by parts has been used here? Thank you.