# How to calculate the generating function of the unified harmonic sum $U(\sigma,n,p) = \sum_{k=1}^n \frac{\sigma^k}{k^p}$?

Euler sums are dealing usually with either the harmonic sum or the alternating harmonic sum. Most of the operations and result are, however, similar in many respects.

Hence I propose here to study applications of a unified harmonic sum defined as

$$U(\sigma,n,p) = \sum_{k=1}^n \frac{\sigma^k}{k^p}\tag{1}$$

Here we have introduced a parameter $$\sigma$$ which for specific values gives back the well known harmonic sums

$$H_{n,p} = U(\sigma = +1, n,p)\tag{2a}$$ $$A_{n,p}= - \overline{H}_{n,p} = U(\sigma = -1,n,p)\tag{2b}$$

Some typical problems to be solved are

1) provide an integral representation of $$U(\sigma,n,p)$$ analogous to $$H_n = \int_0^1 \frac{1-x^n}{1-x}\,dx\tag{3}$$

2) provide an infinite sum representation of $$U(\sigma,n,p)$$ analogous to $$H_n = \sum_{m=1}^{\infty}\left(\frac{1}{m}-\frac{1}{m+n}\right)\tag{4}$$

3) Calculate the generating function of order $$q$$ of $$U$$ defined as

$$g(\sigma,p,q,z) =g_{p,q}(\sigma,z) = \sum_{n=1}^\infty \frac{z^n}{n^q} U(\sigma, n,p)\tag{5}$$

that is, provide a representation as an integral and as a sum (as in 1), and 2)), and calculate the g.f. for some small values of $$p$$ and $$q$$, specifically $$p=1$$, $$q=0,1,2,3(?)$$

First we derive the formulas, afterwards we study some applications of these.

1) Integral representation of the unified harmonic sum

$$U(\sigma ,n,p)=U_{n,p}(\sigma)=\sum _{k=1}^n \frac{\sigma ^k}{k^p} \\ =\sum _{k=1}^n \sigma ^k \left(\frac{1}{\Gamma (p)}\int _0^{\infty }t^{p-1}\exp \left(-k t\right)\,dt\right) \\ =\frac{1}{\Gamma (p)}\int _0^{\infty }t^{p-1}\left(\sum _{k=1}^n \sigma ^k \exp \left(-k t\right)\right)\,dt$$ hence

$$U(\sigma ,n,p)=U_{n,p}(\sigma)=\frac{1}{\Gamma (p)}\int_0^{\infty } t^{p-1}\sigma e^{-t}\frac{ 1-\left(\sigma e^{-t}\right)^n}{1-\sigma e^{-t}} \, dt\tag{s1}$$

After the transformation $$t\to \log(\frac{1}{x})$$ this form of the integral is obtained

$$U(\sigma ,n,p)=U_{n,p}(\sigma)=\frac{\sigma }{\Gamma (p)} \int_0^1 \log ^{p-1}\left(\frac{1}{x}\right)\frac{1-(\sigma x)^n}{1-\sigma x} \, dx\tag{s1a}$$

For $$p=1$$ this simplifies to

$$U(\sigma,n) = \sum _{k=1}^n \frac{\sigma ^k}{k}=\sigma \int_0^1 \frac{1-(\sigma x)^n}{1-\sigma x} \, dx=\int_0^{\sigma} \frac{1-y^n}{1-y} \, dy\tag{s1b}$$

Here we have abbreviated $$U(\sigma,n,p=1) = U(\sigma,n)$$.

2) Representation of the unified harmonic sum as an infinite sum

A power series expansion of the denominator in $$(s1)$$ gives

$$U(\sigma ,n,p)=U_{n,p}(\sigma)=\frac{1}{\Gamma (p)}\int_0^{\infty } t^{p-1}\sigma e^{-t}\frac{ 1-\left(\sigma e^{-t}\right)^n}{1-\sigma e^{-t}} \, dt \\ = \frac{1}{\Gamma (p)} \int_0^{\infty } t^{p-1} \left( 1-\left(\sigma e^{-t}\right)^n\right) \sum_{m=1}^{\infty}(\sigma e^{-t})^m \, dt \\ = \frac{1}{\Gamma (p)}\sum_{m=1}^{\infty} \int_0^{\infty } t^{p-1} \left( 1-\left(\sigma e^{-t}\right)^n\right) (\sigma e^{-t})^m \, dt \\ = \frac{1}{\Gamma (p)}\sum_{m=1}^{\infty} \int_0^{\infty } \left( t^{p-1}(\sigma e^{-t})^m - t^{p-1}\left(\sigma e^{-t}\right)^{m+n}\right)\, dt$$

The two integrals can be easily done so that we get

$$U(\sigma ,n,p)=U_{n,p}(\sigma)= \sum _{m=1}^{\infty } \left(\frac{\sigma ^m}{m^p}-\frac{\sigma ^{m+n}}{(m+n)^p}\right)\tag{s2}$$

Notice that this relation can also be written in terms of standard functions as

$$U(\sigma,n,p)= \operatorname{Li}_p(\sigma )-\sigma ^{n+1} \Phi (\sigma ,p,n+1)\tag{s2a}$$

where $$\operatorname{Li}_p(z)=\sum_{k=1}^{\infty}\frac{z^k}{k^p}$$ is the polylog function and $$\Phi (z ,p,c)= \sum_{k=0}^{\infty}\frac{z^k}{(k+c)^p}$$ is the Lerch phi function.

3) The generating function of the unified harmonic sum

The generating function of order $$q$$ is defined as

$$g_{p,q}(\sigma,z )=\sum_{n=1}^{\infty} \frac{z^n}{n^q}U_{n,p}(\sigma)$$

Inserting $$U$$ from $${s1}$$ we have

$$g_{p,q}(\sigma,z )= =\sum_{n=1}^{\infty} \frac{z^n}{n^q}\left(\frac{1}{\Gamma (p)}\int_0^{\infty } t^{p-1}\sigma e^{-t}\frac{ 1-\left(\sigma e^{-t}\right)^n}{1-\sigma e^{-t}}\right) \, dt \\ =\frac{1}{\Gamma (p)}\int_0^{\infty } t^{p-1}\sigma e^{-t}\frac{1}{1-\sigma e^{-t}}\sum_{n=1}^{\infty} \frac{z^n}{n^q}\left( 1-\left(\sigma e^{-t}\right)^n\right) \, dt$$

The sums can be expressed by polylog functions defined as

$$\operatorname{Li}_{q}(z)=\sum_{n=1}^{\infty} \frac{z^n}{n^q}$$

so that we get finally

$$g_{p,q}(\sigma,z )=\frac{1}{\Gamma (p)}\int_0^{\infty } t^{p-1}(\sigma e^{-t})\frac{ \operatorname{Li}_q(z)-\operatorname{Li}_q\left(e^{-t} z \sigma \right)}{1-\sigma e^{-t} } \, dt\tag{s3}$$

We can get a simplified version doing the integral of the first term giving

$$g_{p,q}(\sigma,z )= \operatorname{Li}_p(\sigma ) \operatorname{Li}_q(z)-\frac{1}{\Gamma (p)}\int_0^{\infty } \frac{t^{p-1} \left(\sigma e^{-t}\right) \operatorname{Li}_q\left(e^{-t} z \sigma \right)}{1-\sigma e^{-t}} \, dt\tag{s4}$$

An alternative representation as a double integral can be obtained replacing $$\frac{1}{n^q}$$ with an integral, resulting in

$$g_{p,q}(\sigma,z )=\frac{1}{\Gamma (p) \Gamma (q)}\int_0^\infty \int_0^\infty\,ds\,dt \frac{ t^{p-1} s^{q-1} e^{-t-s} (\sigma z) }{ \left(1-e^{-s} z\right) \left(1-\sigma z e^{-s-t}\right)}\tag{s5}$$

If we now do the $$t$$-integral we get a simpler alternative to $$(s3)$$

$$g_{p,q}(\sigma,z )= \frac{1}{\Gamma(q)} \int_0^\infty s^{q-1} \frac{\operatorname{Li}_p\left(e^{-s} z \sigma \right)}{1-e^{-s} z}\,ds\tag{s6}$$

4) Micellaneous

The following symmetry relations for even an odd indices hold

$$U_{2n,p}(\sigma) = - U_{2n,p}(-\sigma) +U_{n,p}(\sigma^2) \tag{s4.1}$$ $$U_{2n+1,p}(\sigma) = - U_{2n+1,p}(-\sigma) +U_{n,p}\sigma^2)\tag{s4.2}$$

For $$\sigma = 1$$ these reduce to

$$H_{2n,p} = \overline{H}_{2n,p} +H_{n,p} \tag{s4.1a}$$ $$H_{2n+1,p} = \overline{H}_{2n+1,p} +H_{n,p}\tag{s4.2b}$$

By repeated partial integration of $${(s1b)}$$ we can easily derive the following asymptotic expansion valid for $$\sigma \ne 1$$

$$U(\sigma,n) = \sigma \int_0^1 \frac{1-(\sigma x)^n}{1-\sigma x} \, dx \overset{n\to\infty} \simeq -\log (1-\sigma ) \\-\sigma ^{n+1} \left(\frac{1}{n (1-\sigma )}-\frac{1}{n^2 (1-\sigma )^2}+\frac{\sigma +1}{n^3 (1-\sigma )^3} \\ -\frac{\sigma ^2+4 \sigma +1}{n^4 (1-\sigma )^4}+\frac{\sigma ^3+11 \sigma ^2+11 \sigma +1}{n^5 (1-\sigma)^5}+O(\frac{1}{n^6})\right)\tag{s4.3}$$

Notice that for $$\sigma = 1$$ the terms with $$\frac{1}{n^3}$$ and $$\frac{1}{n^5}$$ vanish and we recover the asymptotics of $$(-\overline{H}_n)$$ provided here How to prove the asymptotic expansion $\overline{H}_n \sim \log(2) -(-1)^n\left (\frac{1}{2n}-\frac{1}{4 n^2} +\frac{1}{8n^4}\mp\ldots\right)$?

Recently I became aware of a paper of 2004 https://www.sciencedirect.com/science/article/pii/S0022247X04003920?via%3Dihub (quoted in https://en.wikipedia.org/wiki/Lerch_zeta_function#Asymptotic_expansion) which provided the following expression for the asymptotics of the Lerch Psi function

$$\Phi(z,s,a) \underset{a->\infty} \simeq \frac{1}{1-z} \frac{1}{a^s} + \sum_{k=1}^{N}\frac{ (-1)^k}{k!} \operatorname{Li}_{-k}(z) \frac{(s)_k}{a^{k+s}}+R\tag{s4.4}$$

Using this result the asymptotics of the unified harmonic sum becomes

$$U(\sigma,n) \overset{n\to \infty}\simeq -\log (1-\sigma ) -\sigma ^n \left(\sum _{k=0}^{N} \frac{(-1)^r \operatorname{Li}_{-k}(\sigma )}{n^{k+1}}\right)+O(n^{-N-2})\tag{s4.4a}$$

Notice that the polylog of negative integer index is a quotient of two polynomials. The first few are

$$\left\{\frac{\sigma }{(1-\sigma )},\frac{\sigma }{(1-\sigma )^2},\frac{\sigma ^2+\sigma }{(1-\sigma )^3},\frac{\sigma ^3+4 \sigma ^2+\sigma }{(1-\sigma )^4}\right\}$$