Please help me to find an analogue for finite sums of $$\int_{a}^{b}fg=t\bar{f}\bar{g}(b)-t\bar{f}\bar{g}(a)+\int_{a}^{b}(\bar{f}-f)(\bar{g}-g) \tag{*}$$ where $ \bar{f}(t)=\frac{1}{t}\int_{a}^{t} f(s)\,ds$ and $f,g\in C([a,b])$
I assume that analogue of $\bar{f}$ is $$A_t=\frac{1}{t}\sum_{m=1}^{t}a_m $$ I tried to derive the same way as we proved (*). There we used integration by parts. And i tried use summation by parts like its analogue. But it doesn't work because,for a start, I don't know what $A_0B_0$ is.