Formula for harmonic progression $\sum _{k=1}^n \frac{1}{a k+b}$.

Can anyone prove this formula for the harmonic progression easily?

For $$a$$ and $$b$$ integers: $$\begin{multline}\sum _{k=1}^n \frac{1}{a k+b}=-\frac{1}{2b}+\frac{1}{2(a n+b)}\\+\int_0^1 2\pi (1-u)\sin[a n\pi u]\sin[(a n+2b)\pi u]\cot[a\pi u]\,du\end{multline}$$

PS This formula was created by me, am just looking for an indirect proof to show its validity (not sure if it's a good idea to divulge it before publishing the result but anyway, perhaps being here already shows I am the creator).

Now, even more surprising are the patterns of the higher orders:

$$\sum_{k=1}^n \frac{1}{(a k+b)^3}=-\frac{1}{2 b^3}+\frac{1}{2(a n+b)^3}\\-\frac{4\pi ^3}{3}\int _0^1 \left(-u+u^3\right) \sin{[a n\pi(1-u)]}\sin{[(a n+2b)\pi(1-u)]}\cot[a\pi (1-u)]du$$

The general formula for odd powers is:

$$\sum_{j=1}^{n}\frac{1}{(a j+b)^{2k+1}}=-\frac{1}{2b^{2k+1}}+\frac{1}{2(a n+b)^{2k+1}}\\+(-1)^{k}(2\pi)^{2k+1}\int_{0}^{1}\sum_{j=0}^{k}\frac{B_{2k-2j}\left(2-2^{2k-2j}\right)}{(2k-2j)!(2j+1)!}u^{2j+1}f(u,n)\,du$$

where $$f(u,n)=\sin{[a n\pi(1-u)]}\sin{[(a n+2b)\pi(1-u)]}\cot[a\pi (1-u)]$$,

and the general formula for even powers is:

$$\sum_{j=1}^{n}\frac{1}{(a j+b)^{2k}}=-\frac{1}{2b^{2k}}+\frac{1}{2(a n+b)^{2k}}\\-(-1)^{k}(2\pi)^{2k}\int_{0}^{1}\sum_{j=0}^{k}\frac{B_{2k-2j}\left(2-2^{2k-2j}\right)}{(2k-2j)!(2j)!}u^{2j}g(u,n)\,du$$

where $$g(u,n)=\sin{[a n\pi(1-u)]}\cos{[(a n+2b)\pi(1-u)]}\cot[a\pi (1-u)]$$

These formulae work for the harmonic numbers too ($$a=1,b=0$$), if term $$-1/(2b^k)$$ is discarded.

• If anyone wants to have at go—pull the sine out of the cotangent, use the geometric series formulae to expand the factor like $\tfrac{\sin mx/2}{\sin x/2}$ into a Fourier series, use the product-to-sum formula for trig functions twice, and integrate by parts. I expect that'll turn the integral into a generalized harmonic series. Nov 22, 2018 at 6:43
• You are welcome dear :) Nov 23, 2018 at 7:28
• Some easy algebra with the digamma function $\psi$ gives that the sum can be written $\frac{1}{a}\left[\psi\left(\frac{b}{a} + n + 1\right) - \psi\left(\frac{b}{a} + 1\right)\right]$, so one could just as well view this problem as showing an integral identity for $\psi$. NB there are some nice integral representations of $\psi$, so perhaps one of those could be manipulated to show this one. Nov 23, 2018 at 9:44
• In accordance with the comment of Travis, for $m\geq 2$ you can use the Hurwitz zeta function : $\enspace\displaystyle\sum\limits_{k=1}^n\frac{1}{(ak+b)^m}=\frac{1}{a^m}\left(\zeta(m,1+\frac{b}{a})-\zeta(m,1+\frac{b}{a}+n)\right)$ . Maybe there are some integrals which will help you. Nov 23, 2018 at 10:04
• And if I would like to proof such formulas, I would simply substitute $\sin x$ by $\frac{e^{ix}-e^{-ix}}{i2}$ and $\cot x$ by $i\frac{e^{ix}+e^{-ix}}{e^{ix}-e^{-ix}}$ . Then check what comes out. :) Nov 23, 2018 at 10:15