Skip to main content
1 of 8

Simple closed forms for sums such as $\sum_{k=1}^\infty \frac{(-1)^{k+1}}{qk - p}$ and related integrals ($p,q$ integers)

By simple, I mean a finite sum involving only logarithms and trigonometric functions. Here $p, q$ are integers with $q>0$ and $p<q$. Let us define $$G_1(p,q)=\sum_{k=1}^\infty \frac{(-1)^{k+1} q}{qk-p}=\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k-\frac{p}{q}} \mbox{ and } G_2(p,q)=\sum_{k=1}^\infty \frac{(-1)^{k+1} q^2k}{(qk)^2-p^2} =\sum_{k=1}^\infty \frac{(-1)^{k+1} k}{k^2-\Big(\frac{p}{q}\Big)^2}$$ It is easy to establish the following: $$G_1(p,q) = \int_0^\infty \frac{\exp{\Big(\frac{p}{q}\cdot x\Big)}}{1+\exp x}dx \mbox{ and } G_2(p,q)=\int_0^\infty \frac{\cosh{\Big(\frac{p}{q}\cdot x\Big)}}{1+\exp x}dx.$$ Interestingly (see Mathematica computation here), we have: $$\sum_{k=1}^\infty \frac{(-1)^k }{k^2-\Big(\frac{p}{q}\Big)^2} =\frac{3}{2}\Big(\frac{p}{q}\Big)^2 +\frac{\pi}{2}\Big(\frac{p}{q}\Big)^{-1}\csc\Big(\pi\cdot \frac{p}{q}\Big).$$

Unfortunately, I could not find such formulas for $G_1$ or $G_2$. The last formula is especially appealing in the following sense. Assume $p,q\rightarrow\infty$ in such a way that $\frac{p}{q}\rightarrow\alpha$ where $\alpha$ is an irrational number. Then we have a simple close form for the sum even if $\frac{p}{q}$ is replaced by an irrational number.

My question

Is it possible to obtain such a simple expressions for $G_1$ and $G_2$, maybe a sum involving $q+1$ terms? Both integrals can be computed in closed form, even the indefinite integrals, when $p,q$ are integers with $p<q$ and $q>0$. I obtained a closed form for $G_2$ (see next section) and my guess is that $G_1$, even though a bit trickier, has also a simple closed form, see here or picture below for the case $q=16, p=1$. The next section provides hints about how to solve this problem.

The last section is about my second question: there is something that looks very mysterious to me, and maybe someone can provide some insights about that mystery.

enter image description here

Towards a solution

For $G_1$, we have, using integral-calculator.com (based on the Maxima symbolic math solver): $$\int \frac{\exp(px/q)}{1+e^x}dx=\sum_{\left\{w:\>w^q+1=0\right\}} w^{p-q} \cdot\log\Big(\Big|e^{x/q}-w\Big|\Big)+C.$$

The sum is over all $q$ (mostly complex) roots of $w^q+1=0$. I don't know what the symbol $|\cdot|$ stands for in the complex logarithm function. A similar formula, albeit more intricate, also exists for $G_2$, and eventually (after considerable cleaning and assuming $|\cdot|$ is the absolute value) it leads to:

$$G_2(p,q)=\frac{q}{2p}+\sum_{j=0}^{q-1}\cos\Big[(2j+1)\frac{p\pi}{q}\Big]\log\Big(1-\cos\Big[(2j+1)\frac{\pi}{q}\Big] \Big).$$

Note that I did not really prove the result. All I did was to use a symbolic math calculator for the indefinite integrals and for the few definite integrals that it was able to solve exactly (small values of $p$ and $q$). I found a pattern in the indefinite integrals when $p$ is a power of 2, turned to the definite integrals, plugged in the unitary complex roots in the formula, did a lot of cleaning, and tested my formula for various $p,q$ against values that were obtained numerically. It worked, and it even worked when $p$ is not a power of 2. Below is the code to compute $G_2(p,q)$. It is trivial, and the only reason I provide it is in case my formula has a typo: the code below is correct for sure.

$pi=3.141592653589793238462643383279;
$q=11;
$p=7;

$sum=0;
for ($j=0; $j<$q; $j++) {
  $theta=((2*$j+1)*$pi)*($p/$q);
  $theta2=((2*$j+1)*$pi)/$q;
  $sum+=(cos($theta)*log(1-cos($theta2)))/2; 
}
$sum+=($q/(2*$p));
print  "($p/$q): $sum\n";

My second question

If you look at my formula for $G_2(p,q)$ in the previous section, it does not seem to be a function of $\frac{p}{q}$. Yet I know it must be one. How can I write $G_2(p,q)$ explicitly as a function of $\frac{p}{q}$ only, say $G_2(\frac{p}{q})$? I am also interested in some expansion of $G_2$ when $p,q\rightarrow\infty$ and $\frac{p}{q}\rightarrow\alpha$.