Abel's summation formula states that for two functions $f$ and $g$, with $f$ differentiable, we have $$\sum_{k=1}^n f(k)g(k)=G(n)f(n)-\int_1^n G(x)f'(x)\; dx \tag{$*$}$$ where $G(n)=\sum_{k=1}^n g(k)$ (it is possible to generalize to other bounds, but let's stick with this for now). Now consider a sum in which the "weight" function $f$ depends not only on $k$ but also on $n$: $$\sum_{k=1}^n f(k,n)g(k).$$ Does there exist a similar formula?
For example, consider the basic example $f(a,b)=ab$. Then $$\sum_{k=1}^n f(k,n)g(k)=n\sum_{k=1}^n kg(k)=n^2G(n)-n\int_1^n G(x)\; dx$$ by $(*)$. If we use $(*)$ directly, by assuming that the derivative $f'(x)$ in the integral is $\frac d{dx} f(x,n)$, we obtain the same result. Does this always hold? In other words: can we extend Abel's summation formula to read $$\sum_{k=1}^n f(k,n)g(k)=G(n)f(n,n)-\int_1^n G(x)\frac d{dx}f(x,n)\; dx?$$