# Computing Definite Sums of Rational Functions

I am attempting to compute a rather complicated sum, $$S_n$$, that in the end satisfies the relation $$(S_n + T_n) = (\frac{(n+1)^2 - 1}{n+1})m^3 + O(m^2)$$. I should note that $$T_n$$ is also unknown. There are many intermediate sums in this computation, for example:

summand = ((3 + i + 8 j + 4 j^2 - m) (-2 + 2 j - n) (5 i + 8 i j + 2 i j^2 -
5 m - 8 j m - 2 j^2 m - i n - i j n + m n + j m n))/(4 (1 + 2 j)^2 (3 + 2 j)^2)

Sum[summand, {j, r, n/2-3,2}, Assumptions-> Mod[n,4]==0 && Mod[r,2]==1]
//FullSimplify


The output is a collection of PolyGamma functions:

-(1/512) (i - m) (-32 - 32 n + 24 n^2 - 64 n r + 32 r^2 +
8 (9 - 3 m - n (2 m + n) + i (3 + 2 n)) PolyGamma[0,
1/4 (-1 + n)] -
8 (5 i - 5 (5 + m) + 2 i n - 2 m n + n^2) PolyGamma[0, (1 + n)/
4] + 8 (-9 - 3 i + 3 m - 2 i n + 2 m n + n^2) PolyGamma[0,
1/4 + r/2] +
8 (5 i - 5 (5 + m) + 2 i n - 2 m n + n^2) PolyGamma[0,
3/4 + r/2] + (i - m) (-9 + n^2) PolyGamma[1,
1/4 (-1 + n)] + (-i + m) (-25 + n^2) PolyGamma[1, (1 + n)/
4] + (-i + m) (-9 + n^2) PolyGamma[1,
1/4 + r/2] + (i - m) (-25 + n^2) PolyGamma[1, 3/4 + r/2])


Unfortunately there are many of these sums en route to computing $$S_n$$ and eventually keeping track of the collection of PolyGamma terms becomes too much for Mathematica to handle and the computation stalls.

I am curious if there might be other methods for evaluating definite sums of rational functions like mine that might produce cleaner results. I have been looking at some of the software libraries that use Gosper's algorithm and creative telescoping libraries described here, https://www3.risc.jku.at/research/combinat/software/ergosum/RISC/fastZeil.html, but thus far have not been able to produce a closed form solution.

I would expect that a rational closed form expression exists for $$S_n$$ based on the above relation, so is there a way to find a rational expression for these intermediate sums?

• A power series can only be the power series of a rational function iff the coefficients satisfy a constant-coefficient linear difference equation; rational function coefficients do not fall into that category, so you are not going to be able to entirely avoid polygamma functions/harmonic numbers except through some cancellation miracle. – J. M.'s discontentment Nov 13 '19 at 5:38