12

In https://math.stackexchange.com/a/4015346/198592 it was shown that the sum

$$s(x) = \sum_{k=1}^{\infty}\frac{\sin(k x)}{1+k^2}$$

is exactly expressible in terms of the hypergeometric function.

I wonder what happens íf we replace the sine by its absolute value, i.e. ask for the properties of the function $a(x)$ defined by the sum

$$a(x) = \sum_{k=1}^{\infty}\frac{|\sin(k x)|}{1+k^2}$$

Questions

(1) can you find a closed expression for $a(x)$ if $x$ is a rational multiple of $\pi$?

(2) is there a closed expression for $a(x)$?

Here is a plot of the two functions $a(x)$ and $s(x)$

enter image description here

2 Answers2

5

Some first results

In order not to spoil the fun of those who wish to find solutions be themselves I provide here only the answers to some question (1) without deriving the results.

$$a(\frac{\pi}{2}) = \frac{1}{4} i \left(H_{-\frac{1}{2}-\frac{i}{2}}-H_{-\frac{1}{2}+\frac{i}{2}}\right)\simeq 0.72033 \tag{1a}$$

$$a(\frac{\pi}{2}) =\frac{1}{4} \pi \tanh \left(\frac{\pi }{2}\right)\tag{1b}$$

Here $H_z$ is the harmonic number of the (complex) argument $z$

$$\begin{align} a(\frac{\pi}{3})=\frac{i}{4 \sqrt{3}} \left(-H_{-\frac{1}{3}+\frac{i}{3}}-H_{-\frac{2}{3}+\frac{i}{3}}+H_{-\frac{1}{3}-\frac{i}{3}}+H_{-\frac{2}{3}-\frac{i}{3}}\right)\simeq 0.784626 \end{align}\tag{2a}$$

$$a(\frac{\pi}{3})=\frac{\pi \sinh \left(\frac{2 \pi }{3}\right)}{\sqrt{3} \left(1+2 \cosh \left(\frac{2 \pi }{3}\right)\right)}\tag{2b}$$

These results show an interesting relation of $s(x)$ to the harmonic numbers and - less obviously - to explicit functions via contour integrals and residues.

General solution to question (1)

With a nudge from @NN2's solution I have found, using Cauchy's theorem and residues, the following simple finite sum for the case of a rational argument

$$a(x=\pi \;\frac{p}{q}) = a_{Q}(p,q): = \frac{\pi}{2 q}\sum _{j=1}^{q-1} | \sin \left(\pi \frac{ p }{q} j\right)| \frac{ \sinh \left(\frac{2 \pi }{q}\right)}{ \cosh \left(\frac{2 \pi }{q}\right)-\cos \left(\frac{2 \pi j}{q}\right)}\tag{s.1}$$

This formula is the full answer to problem part (1) of the OP, and thus generalizes the special results of the initial post in the second form of the equations (i.e. $(1.b)$ and $(2.b)$ ).

Derivation

We have to consider the sum

$$a_Q(p,q) = \sum_{k=1}^{\infty} \frac{| \sin\left(\pi (\frac{p}{q}) k\right)|}{1+k^2}\tag{s.2}$$

In order to simplfy the sum, we start with the observation that the numerator of the summmand has period $q$ in $k$ to split the summation over $k$ into chunks of length $q$ writing

$$k= m q + j\tag{s.3a}$$

with the index ranges

$$m=0,1,...\tag{s.3b}$$ $$j=1,2,...,q-1\tag{s.3c}$$

notice that the $j$ needs to run only up to $q-1$ because the $\sin$-factor vanishes.

Hence our sum becomes the double sum

$$a_{Q}(p,q) = \sum_{j=1}^{q-1} \sum_{m=0}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q + j)^2}\tag{s.4}$$

Let us now calculate the $m$-sum (designating it following @NN2)

$$u(q,j) = \sum_{m=0}^{\infty}\frac{1}{1+(m q + j)^2}\tag{s.5}$$

Partial fraction decomposition, shifting the summation index $m\to n-1$ and extracting a factor $\frac{1}{q}$ leads to

$$\begin{align} u(q,j) &= \sum_{m=0}^{\infty}\frac{1}{2 i} \left(\frac{1}{-i+m q + j}-\frac{1}{+i+m q + j}\right) \\ &=\frac{1}{2 i q} \sum_{n=1}^{\infty} \left(\frac{1}{n-1 +\frac{-i+j}{q}}-\frac{1}{n-1 +\frac{ i+j}{q}}\right) \\ &=\frac{1}{2 i q} \sum_{n=1}^{\infty} \left(\left(\frac{1}{n}-\frac{1}{n-1 +\frac{+i+j}{q}}\right)-\left(\frac{1}{n}-\frac{1}{n-1 +\frac{-i+j}{q}}\right)\right) \end{align} \tag{s.6}$$

Here, in order to obtain two summands with convergent sums, we have added and subtracted a term $\frac{1}{n}$.

Using the definition of the harmonic number for a general argument $z$

$$H_{z}=H(z) = \sum_{m=1}^{\infty}(\frac{1}{m}-\frac{1}{m+z})\tag{s.7}$$

we can write

$$\begin{align} u(q,j) &=\frac{1}{2 i q} \left(H(\frac{+i+j}{q}-1)-H(\frac{-i+j}{q}-1)\right)\\ &=\frac{1}{q}\Im(H(\frac{+i+j}{q}-1)) \end{align} \tag{s.8}$$

We can also easily find an integral representation of $u$ as follows. Writing the summand as

$$\begin{align} \frac{1}{1+(m q+j)^2}&=\Im \left(\frac{-1}{i+m q + j}\right)=-\Im(\int_{0}^{\infty}e^{-(i+m q + j)}\,dt )\\ &=\int_{0}^{\infty}\sin{t}\;e^{-(m q + j)}\,dt \end{align} \tag{s.9}$$

and performing the sum over $m$ gives finally

$$u(q,j) =\int_0^{\infty } \frac{e^{-j\; t} \sin (t)}{1-e^{-q\; t}} \, dt \tag{s.10}$$

A similar formula was first given in the answer of @NN2 (https://math.stackexchange.com/a/4024768/198592).

Summarizing up to this point, we have obtained for the infinite sum $a_{Q}(p,q)$ a finite sum over $(q-1)$ summands which however contain the more awkward harmonic functions of a complex argument, or, equivalently, a non elementary integral.

Luckily, formula $(s.1)$ shows that there is a similar sum containing more elementary functions.

The key to its derivation is extending the one-sided sum over $m$ into a two-sided sum. It turns out that this is possible if we work under the $j$-sum and take into account the specific numerator.

Derivation A)

Consider, under the sum over $j$ from $1$ to $q-1$,

$$\begin{align} &\sum_{m=-\infty}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q + j)^2}\\ &= \sum_{m=-\infty}^{-1}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q + j)^2}+\sum_{m=0}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q + j)^2} \end{align} \tag{s.11} $$

and the first sum can be transformed as follows

$$\begin{align} &\sum_{m=-\infty}^{-1}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q + j)^2}=\sum_{m=1}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(-m q + j)^2}\\ &=\sum_{m=1}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) j)|}{1+(m q - j)^2} \overset{j\to q-i}=\sum_{m=1}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) (q-i))|}{1+(m q - q+i)^2}\\ &=\sum_{m=1}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) i)|}{1+((m-1) q - +i)^2}=\sum_{m=0}^{\infty}\frac{|\sin(\pi (\frac{p}{q}) i)|}{1+(m q +i)^2} \end{align} \tag{s.12}$$

Hence we can write (with a factor $\frac{1}{2}$)

$$a_{Q}(p,q) = \frac{1}{2} \sum_{j=1}^{q-1} |\sin(\pi (\frac{p}{q}) j)| \sum_{m=-\infty}^{\infty}\frac{1}{1+(m q + j)^2}\tag{s.13}$$

Derivation B)

Let

$$\begin{align} S_1 = \sum_{j=1}^{q-1} | \sin(\pi \frac{p}{q} j) | \sum_{m \ge 0} \frac{1}{1+(q m+j)^2 }=\frac{1}{2}(S_1+S_2) \end{align} \tag{s.14}$$

where $S_2$ has the same values as $S_1$ and differs only in the direction of the summation index $j$.

We proceed with $S_2$ as follows

$$\begin{align} S_2 &= \sum_{j=q-1}^{1} | \sin(\pi \frac{p}{q} j)| \sum_{m \ge 0} \frac{1}{1+(q m+j)^2 }\\ &\overset{j\to q-i}= \sum_{i=1}^{q-1} | \sin(\pi \frac{p}{q}(q- i)) | \sum_{m \ge 0} \frac{1}{1+(q m+q-i)^2 }\\ &=\sum_{i=1}^{q-1} \left|\sin(\pi \frac{p}{q} i) \right| \sum_{m \ge 0} \frac{1}{1+(q(m+1)-i)^2 }\\ &=\sum_{i=1}^{q-1} \left|\sin(\pi \frac{p}{q} i) \right| \sum_{m \ge 0} \frac{1}{1+(-q(m+1)+i)^2 }\\ &\overset{m+1\to n}=\sum_{i=1}^{q-1} \left| \sin(\pi \frac{p}{q} i) \right| \sum_{n=-1}^{-\infty} \frac{1}{1+(q n+i)^2 } \end{align}\tag{s.15} $$

hence from $(s.14)$ follows

$$S_1 =\frac{1}{2} \sum_{j=1}^{q-1} \left| \sin(\pi \frac{p}{q} j) \right| \left( \sum_{m =-1}^{-\infty} + \sum_{m =0}^{\infty} \right) \frac{1}{1+(q m+j)^2}\tag{s.16}$$

hence the two sums add up to a double-sided sum:

$$\begin{align} a_{Q}(p,q) = S_1=\frac{1}{2}\sum_{j=1}^{q-1} | \sin(\pi \frac{p}{q} j)| \sum_{m =-\infty}^{\infty} \frac{1}{1+(q m+j)^2 } \end{align}\tag{s.17}$$

Now the double-sided sum

$$v(q,j) = \sum_{m=-\infty}^{\infty}\frac{1}{1+(m q + j)^2}\tag{s.18}$$

can be calculated by evaluating the contour integral

$$\int_C (\pi \cot(\pi m) \frac{1}{q} \frac{1}{1+(m q +j)^2}\, dm\tag{s.19}$$

over a circle of radius $R$ concentric around the origin in the complex $m$-plane. In the limit of $R \to \infty$ the integral vanishes so that $v$ is given by the sum of the residues at the two poles of $\frac{1}{1+(m q +j)^2}$ which are at $m = \frac { \pm i - j} {q}$

This leads for $1 \le j \le q-1$ to

$$v(q,j) = \frac{\pi \left(\coth \left(\frac{\pi +i \pi j}{q}\right)+\coth \left(\frac{\pi -i \pi j}{q}\right)\right)}{2 q}\tag{s.20}$$

This can be simplified to

$$v(q,j) = \frac{\pi \sinh \left(\frac{2 \pi }{q}\right)}{q \left(\cosh \left(\frac{2 \pi }{q}\right)-\cos \left(\frac{2 \pi j}{q}\right)\right)}\tag{s.21}$$

which completes the derivation of $(s.1)$.

Afterwards I noticed that Mathematica can do the two-sided sum immediately and afterwards can be used to complete the simplification.

Remark: the fact that the values of the two sums for $a_{Q}$ (i.e. using either $u$ or $v$) with the "weight factor" $|\sin(\pi \frac{p}{q}j)|$ are the same might lead at first sight to the conjecture that $v$ is the solution of the integral $(s.10)$ for $u$. But this is not the case: $u$ and $v$ are different.

Plot

Here is a discrete plot of $a_{Q}(p,q)$

enter image description here

The graph is gratifying as is comes very close to the origial graph for real $x$ presented in the OP.

Notice that $a_Q$ can not serve as the general solution for real $x$. We compare the two graphs in the discussion.

Discussion

§d.1

It is interesting to compare the graphs for the function $a_Q(x\in \mathbb{Q})$ if taken at discrete values (as it is intended) and for continuous values $a_Q(x\in \mathbb{R})$. What emerges looks to me like the stalactites hanging of the ceiling of a cave

enter image description here

The function $a_Q(x)$ with $x\in \mathbb{R}$ creates the "ceiling", and its minima (downwards peaks) are the values at the discrete argument $x\in \mathbb{Q}$.

Notice as the main result that the function $a_{Q}(x \in \mathbb{R})$ is different from the original function $a(x)$ almost everywhere (i.e. except for a countable number of points).

§d.2

Type of curve of $a(x)$

For the sake of definiteness we consider the partial sum

$$a(x,n) = \sum_{k=1}^{n} \frac{|\sin(x k)|}{(1+k^2)}$$

For fixed $n$ this is a continuous function of $x$.

The first and second derivatives are calculated from the corresponding expression for $|\sin(k x)|$, i.e.

$$\frac{d}{dx} |\sin(k x)| = \frac{d}{dx} \sqrt{\sin(k x)^2}=\frac{k \sin (k x) \cos (k x)}{\sqrt{\sin ^2(k x)}}\tag{d.1a}$$

$$\left(\frac{d}{dx}\right)^2 |\sin(k x)| = -k^2 \sqrt{\sin ^2(k x)}=-k^2 |\sin(k x)|\tag{d.1b}$$

The first derivative is discontinuous at the points where the sin vanishes, i.e. at $x = \pi \frac{m}{k}$, i.e. it has the value $-k$ for $x$ coming from below and $+k$ for $x$ coming from above. Hence $|\sin(k x)|$ and has a jump of size $2k$.

The second derivative of $|\sin(k x)|$ is continuous.

This reflects in the corresponding expressions for the partial sum which are show in the next picture

enter image description here

Summing up we find that the first derivative of $a(x)$ is discontinuous in all $x$ which are rational multiples of $\pi$. Without mentioning it, these were exactly the points for which $a$ had to be calculated in the OP. Hence the graph of $a'(x)$ is a sawtooth at any scale, probably even self-similar, we could call it a "rough" curve.

Casual question (1): what is the length of the graph of $a'(x)$?

Casual question (ii): what is the first derivative of $a(x)$ at $x=\frac{1}{e}$?

§d.3

I have tried to understand the sum over $j$ in the expression $(s.1)$ in the limit $q\to\infty$ as a Riemann integral, but with no avail.

Replacement of $|\sin(x)|$

I don't know if this leads to something useful but we can write

$$\begin{align}|\sin(x)| = \sin(x)\times \text{sgn}(\sin(x)) \\ =\sin (x) \; \Im\left(\frac{4}{\pi}\text{arctanh}\left(e^{i x}\right)\right)\\ = \sin (x) \; \Re\left(\frac{4}{\pi }\text{arctan}\left(e^{i \left(x-\frac{\pi }{2}\right)}\right)\right) \end{align} \tag{3} $$

here

$$\begin{align} \text{arctanh}(z) = \frac{1}{2} \left(\log(1+z)-\log(1-z) \right)\\ \text{arctan}(z) = \frac{1}{2 i} \left(\log(1+i z)-\log(1-i z) \right)\end{align}\tag{4}$$

  • Do you mean that there exists closed form solution for $a(x)$ (but you dont want to spoil yet)? If really there exists the closed form solution, I think I’ll try by myself. But currently I doubt there exists. – NN2 Feb 13 '21 at 17:04
  • I think I found the closed expression (if we can call it closed expression :-) ). I'm verifying the result. – NN2 Feb 13 '21 at 19:14
  • @ NN2 No, I don't think that there's a closed expression for general real $x$. I have provided examples for the answer to question (1) which probably can be generalised. But what is e.g. $a(e)$, $a(\sqrt{2})$? I'm eagerly looking forward to seeing your closed expression. – Dr. Wolfgang Hintze Feb 13 '21 at 19:36
  • @ NN2 Maybe you have brought me to an idea: we have $|\sin(x)| = \frac{2 i \sin (x) \left(\tanh ^{-1}\left(e^{-i x}\right)-\tanh ^{-1}\left(e^{i x}\right)\right)}{\pi }$ so probably we can proceed ... – Dr. Wolfgang Hintze Feb 13 '21 at 20:21
  • In fact, I found a "semi-closed expression" for $x \in \mathbb{Q}$. Because $\mathbb{Q}$ is dense in $\mathbb{R}$ then I hope we can calculate $a(x)=\lim_{q \to x} a(q)$. But it seems to me that the formula of $a(x)$ with $x \in \mathbb{Q}$ is still quite complex that it's currently diffficult to calculate the limit. – NN2 Feb 13 '21 at 20:21
  • We made comments at the same time. I haven't yet tried your formula but it seems to me it's a good approach. – NN2 Feb 13 '21 at 20:24
  • Thank you very much. Your question in your first comment encouraged me to have a second look on the problem. But ir is still seems to be too complicated ... – Dr. Wolfgang Hintze Feb 13 '21 at 20:47
  • @ NN2 you might wish to have look at my updated solution. – Dr. Wolfgang Hintze Feb 14 '21 at 17:26
  • It's good that you succeed to calculate the integral and now reduce the infinite sum to the formula (0.b). This formula is definitely simpler and I believe we can reduce it to a function $f(\frac{p}{q})$. Perhaps you can post a question to Math.stackexchange.com or Mathoverflow? – NN2 Feb 14 '21 at 19:13
  • Formula is not TRUE ?. Try MMA code: {N[Sum[Abs[Sin[p/q* k]]/(1 + k^2) /. {p -> 3, q -> 4}, {k, 1, 50000}], 20], N[Sum[ Pi/(2 q)*Abs[Sin[Pi p k/q]]*Sinh[2 *Pi/q]/( Cosh[2 Pi/q] - Cos[2 Pi k/q]) /. p -> 3 /. q -> 4, {k, 1, 4}], 20]} – Mariusz Iwaniuk Feb 15 '21 at 15:51
  • Mariusz, if you correct a factor Pi under the sine in the your first term everything is fine, including my formula ;-) – Dr. Wolfgang Hintze Feb 15 '21 at 18:27
  • Please update yours answers with MMA code. – Mariusz Iwaniuk Feb 15 '21 at 19:18
  • I don't understand what you want now. I'm rather waiting for he correction of your wrong statement about my formula. I'll help you: your error is {N[Sum[Abs[Sin[---> here: missing pi <----p/q* k]]/(1 + k^2) /. {p -> 3, q -> 4}, {k, 1, 50000}], 20], N[Sum[ Pi/(2 q)Abs[Sin[Pi p k/q]]Sinh[2 *Pi/q]/( Cosh[2 Pi/q] - Cos[2 Pi k/q]) /. p -> 3 /. q -> 4, {k, 1, 4}], 20]} – Dr. Wolfgang Hintze Feb 15 '21 at 19:44
  • Your repeated edits to this answer have raised an automatic flag. Please try to determine what it is that you want to say, then say it. Making repeated edits bumps this question to the top of the front page over and over again, which takes time away from new questions which also deserve answers. Also, when you edit, please try to create a single coherent post. Your answer should appear to have been written as a single document---if you make an edit, try to incorporate it into your post without marking the edit. – Xander Henderson Mar 02 '21 at 13:19
  • If someone really wants to know what edits were made, they may look into the edit history. – Xander Henderson Mar 02 '21 at 13:20
  • Thank you for your hints. It is not at all my intention to block new questions, of course. It would be desirable to have a "silent mode" which prevents this and still allows changes to be made. Ok. I have removed the heading beginning with "edit" which BTW appeared just once ;-), and have the "original post" under a new heading to the beginning. The text should now be better readable as one document, but still as a document which has developed in some places as new ideas concerning content (discussion) and better presentation are concerned. – Dr. Wolfgang Hintze Mar 02 '21 at 17:56
  • Xander Henderson It seems to me that a recent comment of marty cohen and my response to it have vanished, the same goes for a clarifying conversation with Mariusz Iwaniuk before. I have not deleted any comment. Do you have an explanation? – Dr. Wolfgang Hintze Mar 02 '21 at 18:08
2

Here I provide a "semi-closed" form expression for $a(x)$ in case of $x\in \mathbb{Q}$ (rational numbers). Perhaps from it, we can obtain the closed form expression for $a(x)$ for $x\in \mathbb{R}$.

As $a(x)$ is a periodic function, it suffices to calculate $a(x)$ for $x\in (0,\pi)$.

Suppose $x\in \mathbb{Q}$, then $x=\frac{p}{q}\pi$ with $p,q\in \mathbb{N}$, $p<q$ and $(p,q)=1$. \begin{align} a(x) &= \sum_{k=1}^{\infty}\frac{|\sin(k x)|}{1+k^2} \\ &= \sum_{k=1}^{\infty}\frac{|\sin(k\frac{p}{q}\pi)|}{1+k^2} \\ &= \sum_{k=1}^q \left(\left|\sin \left(k\frac{p}{q}\pi \right)\right| \sum_{n=0}^{\infty}\frac{1}{1+(k+nq)^2} \right) \tag{1} \\ \end{align} Denote $$u(k,q)=\sum_{n=0}^{\infty}\frac{1}{1+(k+nq)^2}$$ We have \begin{align} u(k,q) &=\frac{i}{2q} \sum_{n=0}^{\infty}\frac{-2\frac{i}{q}}{(n+\frac{k}{q})^2+\frac{1}{q^2}} \\ &=\frac{i}{2q} \sum_{n=0}^{\infty} \left(\frac{1}{n+\frac{k}{q}+\frac{i}{q}}-\frac{1}{n+\frac{k}{q}-\frac{i}{q}} \right) \tag{1} \\ \end{align}

We know that the digamma function for complex number is calculated as $$\psi(z)=-\gamma + \sum_{n=0}^{\infty}\frac{1}{n} - \sum_{n=0}^{\infty}\frac{2}{n+z}=\int_0^{+\infty} \left( \frac{e^{-t}}{t} -\frac{e^{-zt}}{1-e^{-t}} \right)dt \tag{3}$$

From (2) and (3), we can easily deduce

$$u(k,q)=\int_0^{+\infty} \frac{e^{-\frac{k}{q}t}}{1-e^{-t}}\frac{\sin \left( \frac{t}{q} \right)}{q}dt$$

Hence, from (1) we have \begin{align} a(x) &=\sum_{k=1}^q \left(\left|\sin \left(k\frac{p}{q}\pi \right) \right| \int_0^{+\infty} \frac{e^{-\frac{k}{q}t}}{1-e^{-t}}\frac{\sin \left( \frac{t}{q} \right)}{q}dt\right) \tag{4} \\ \end{align}

The formulas (4) can be considered to be the "semi-closed form expression" for $a(x)$ in case of $x\in \mathbb{Q}$ (rational numbers).

Find the closed-form expression for $a(x)$ in general case ($x\in \mathbb{R}$) is equivalent to find the closed-form expression of $a(\frac{p}{q}\pi)$

We have this identity from Fourier transform (link) $$\left|\sin x\right| = \frac{2}{\pi}-\sum_{j = 1}^\infty \frac{4}{\pi(4j^2-1)}\cos(2j x)$$

Then \begin{align} a \left(\frac{p}{q}\pi \right)&=\sum_{k=1}^q \left(\left(\frac{2}{\pi}-\sum_{j = 1}^\infty \frac{4}{\pi(4j^2-1)}\cos \left(2j k\frac{p}{q}\pi\right) \right) \int_0^{+\infty} \frac{e^{-\frac{k}{q}t}}{1-e^{-t}}\frac{\sin \left( \frac{t}{q} \right)}{q}dt\right) \tag{5}\\ \end{align}

Remark: It's possible that from (5), we can transform $a(x)$ to a function $f\left(\frac{p}{q}\right)$. If the function $f\left(\frac{p}{q}\right)$ exists, it suffices then replace $\frac{p}{q}$ by $r \in \Bbb R$.

We can use the formula $(5)$ by noticing that $\sin(x)\cos(y) =\frac{1}{2}(\sin(x+y)+\sin(x-y))$ and
$$\sum_{i=1}^n \sin(nx) = \frac{\sin\left(\frac{nx}{2}\right)\sin\left(\frac{(n+1)x}{2}\right)}{\cos\left(\frac{x}{2}\right)}$$ We have \begin{align} a \left(\frac{p}{q}\pi \right)&=\sum_{k=1}^q \left(\left(\frac{2}{\pi}-\sum_{j = 1}^\infty \frac{4}{\pi(4j^2-1)}\cos \left(2j k\frac{p}{q}\pi\right) \right) \int_0^{+\infty} \frac{e^{-\frac{k}{q}t}}{1-e^{-t}}\frac{\sin \left( \frac{t}{q} \right)}{q}dt\right) \\ &=\frac{2}{\pi}\sum_{k=1}^q \int_0^{+\infty} \frac{e^{-\frac{k}{q}t}}{1-e^{-t}}\frac{\sin \left( \frac{t}{q} \right)}{q}dt - \sum_{j = 1}^\infty \left( \frac{4}{\pi(4j^2-1)} \int_0^{+\infty} \frac{\sum_{k=1}^q e^{-\frac{k}{q}t}\cos \left(2j k\frac{p}{q}\pi \right) \sin \left( \frac{t}{q} \right)}{(1-e^{-t})q}dt \right)\\ &= I_1 - I_2 \\ \end{align} The first term $I_1$ is equal to $$I_1 = \frac{2}{\pi} \int_0^{+\infty} \frac{\sin \left( \frac{t}{q} \right)}{q(e^{\frac{t}{q}}-1)}dt = \frac{2}{\pi} \int_0^{+\infty} \frac{\sin (t)}{e^t-1}dt$$ The second term $I_2$ is equal to \begin{align} I_2 &=\sum_{j = 1}^\infty \left( \frac{4}{\pi(4j^2-1)} \int_0^{+\infty} \frac{\sum_{k=1}^q e^{-\frac{k}{q}t}\cos \left(2j k\frac{p}{q}\pi \right) \sin \left( \frac{t}{q} \right)}{(1-e^{-t})q}dt \right)\\ &=\sum_{j = 1}^\infty \left( \frac{4}{\pi(4j^2-1)} \int_0^{+\infty} \frac{ \sin(\frac{t}{q})(-e^{-t}+\cos(2jpt)+e^{t+\frac{t}{q}}\cos(2j\frac{p}{q}t)-e^{\frac{t}{q}}\cos(2j(\frac{p}{q}+p)t))}{q(e^t-1)(1+e^{\frac{2t}{q}} -2e^{\frac{t}{q}}\cos(2j\frac{p}{q}t)) } \right)\\ \end{align}

Denote $r = \frac{p}{q}$ \begin{align} I_2 &=\sum_{j = 1}^\infty \left( \frac{4}{\pi(4j^2-1)} \int_0^{+\infty} \frac{ \sin(\frac{t}{q})(-e^{-t}+\cos(2jrqt)+e^{t+\frac{t}{q}}\cos(2jrt)-e^{\frac{t}{q}}\cos(2jr(1+q)t))}{q(e^t-1)(1+e^{\frac{2t}{q}}+-2e^{\frac{t}{q}}\cos(2jrt)) } \right)\\ \end{align}

We can transform the integrand into a function depended on only $r$ and $t$. But it's too calculating. I must stop here.

NN2
  • 15,892
  • Looks great. Do you recover the two special values I have given in my solution? – Dr. Wolfgang Hintze Feb 14 '21 at 04:52
  • @Dr.WolfgangHintze: I found a formula for $|\sin(x)|$ by Fourier transform and modified the answer. Perhaps this formula is helpful for you to find the closed-form solution of $a(x)$? – NN2 Feb 16 '21 at 02:34
  • Thanks a lot for your updated solution. (1) I have already devoted a whole paragraph (#3) to this formula for $|\sin(x)|$ in my answer But I couldn't make further progress. (2) I don't agree with your statement "If the function $f(\frac{p}{q})$ exists, it suffices then replace $\frac{p}{q}$ by $r\in \mathbb{R}$". The reason can be seen in the picture in the discussion of my updated solution. – Dr. Wolfgang Hintze Feb 16 '21 at 17:39
  • @ NN2 (1) question concerning your equ. $(4)$: how did you come from the first line (with the integral) to the second one (with cosh etc.)? (2) remark: the formula after the credits (developed by Dr. Wolfgang Hintze) in not mine. You can easily clairify these two remarks by just moving the credits to the transisition in $(4)$. – Dr. Wolfgang Hintze Feb 17 '21 at 08:19
  • @Dr.WolfgangHintze the formula (4) is your formula (0.b) (I copied this from your answer). I should have given credit to you on the (4), not (6). The formula (6) is what I deduced from (4). PS: I just modified it – NN2 Feb 17 '21 at 08:41
  • Thank you. Please notice the important fact that your integral is NOT equal to my expression, as you can check easily numerically. I found my expression not by calculating your integral but by extending the unilateral sum over $m$ to a bilateral sum and then using residues. Equivalence of the two lines in $(4)$ hold only under the sum over $k$. – Dr. Wolfgang Hintze Feb 17 '21 at 09:33
  • I see. I modified then the answer. – NN2 Feb 17 '21 at 09:44