# Evaluating $\int_0^\infty\sqrt{\frac{x-1}{x^n-1}}\,dx$

I had a lot of fun in this answer where I worked out $$\int_0^\infty\frac1{\sqrt{x^4+x^3+x^2+x+1}}\,dx=\frac4{\sqrt{4\varphi+3}}F\left(\frac{3\pi}{10},m=8\varphi-12\right)$$ But what happens if the largest exponent in the denominator polynomial is not $$4$$ but some other integer? In other words, is there a general closed form or single series expression for $$\int_0^\infty\sqrt{\frac{x-1}{x^n-1}}\,dx\ ?$$ For $$n=5$$ the answer is as above and for $$n=4$$ $$\int_0^\infty\frac1{\sqrt{x^3+x^2+x+1}}\,dx=2^{-1/4}F\left(\cos^{-1}\frac{1-\sqrt2}{1+\sqrt2},\frac12+\frac1{2\sqrt2}\right)$$ The integrals for $$n=1,2,3$$ diverge. Evaluating the integral for $$n\ge6$$, however, appears to be infeasible even with series; while the gamma product sum in Jack d'Aurizio's answer here looks quite appealing, it only works for $$n=5$$ – only then can it be shown that the integral over $$[0,\infty]$$ is twice the integral over $$[0,1]$$, at which point you bring in beta functions. The other result in Jack's answer is a double sum, which can be generalised to other $$n$$ but is not very elegant (partly because of the double sum and partly because one bound of that sum uses a floor function).

If an approach that solves the task also gives integrals for the same integrand but with other bounds (e.g. $$[0,1]$$), that would be appreciated.

I'll offer a "single series expression"; hopefully someone eagle-eyed can spot what that is in hypergeometric terms, thereby achieving a closed form.

For $$x\in[0,\,1]$$, apply $$x=\sin^{2/n}t$$; for $$x\ge1$$, apply $$x=\csc^{2/n}t$$. In terms of falling Pochhammer symbols, the integral is\begin{align}&\frac2n\int_0^{\pi/2}(\sin^{2/n-1}t+\sin^{-3/n}t)\sqrt{1-\sin^{2/n}t}dt\\&=\frac2n\sum_{k\ge0}\frac{(\tfrac12)_k(-1)^k}{k!}\int_0^{\pi/2}(\sin^{2(k+1)/n-1}t+\sin^{2(k-3/2)/n}t)dt\\&=\frac1n\sum_{k\ge0}\frac{(\tfrac12)_k(-1)^k}{k!}(\operatorname{B}(\tfrac{k+1}{n},\,\tfrac12)+\operatorname{B}(\tfrac{k-3/2}{n}+\tfrac12,\,\tfrac12))\\&=\frac{\sqrt{\pi}}{n}\sum_{k\ge0}\frac{(\tfrac12)_k(-1)^k}{k!}\left(\tfrac{\Gamma\left(\tfrac{k+1}{n}\right)}{\Gamma\left(\tfrac{k+1}{n}+\tfrac12\right)}+\tfrac{\Gamma\left(\tfrac{k-3/2}{n}+\tfrac12\right)}{\Gamma\left(\tfrac{k-3/2}{n}+1\right)}\right).\end{align}

For each positive integer $$n$$ greater than or equal to three, let $$\mathcal{I}_{n}$$ denote the value of the convergent improper integral

$$\mathcal{I}_{n}:=\int_{0}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{\sum_{k=0}^{n}x^{k}}};~~~\small{n\in\mathbb{N}\land n\ge3}.$$

From the degree of the polynomial inside the radical, it can be told at a glance that $$\mathcal{I}_{3}$$ and $$\mathcal{I}_{4}$$ are elliptic integrals whereas $$\mathcal{I}_{n}$$ with $$n\ge5$$ are hyperelliptic. Nevertheless, we will show that in at least one particular case, $$n=6$$, the initial hyperelliptic integral can be reduced to elliptic integrals.

For reference, the integral $$\mathcal{I}_{6}$$ has an approximate numerical value of

$$\mathcal{I}_{6}\approx0.997901.$$

As another user indicated, we can use symmetry to reduce the integral with unbounded interval of integration to an integral over $$[0,1]$$:

\begin{align} \mathcal{I}_{6} &=\int_{0}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{\sum_{k=0}^{6}x^{k}}}\\ &=\int_{0}^{1}\mathrm{d}x\,\frac{1}{\sqrt{\sum_{k=0}^{6}x^{k}}}+\int_{1}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{\sum_{k=0}^{6}x^{k}}}\\ &=\int_{0}^{1}\mathrm{d}x\,\frac{1}{\sqrt{\sum_{k=0}^{6}x^{k}}}+\int_{0}^{1}\mathrm{d}x\,\frac{x}{\sqrt{\sum_{k=0}^{6}x^{6-k}}};~~~\small{\left[x\mapsto x^{-1}\right]}\\ &=\int_{0}^{1}\mathrm{d}x\,\frac{1+x}{\sqrt{1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6}}}.\\ \end{align}

The next step is the reverse Euler substitution

$$\frac{1+x^{2}}{2x}=y;~~~\small{0

$$\implies x=y-\sqrt{y^{2}-1}=\frac12\left(\sqrt{y+1}-\sqrt{y-1}\right)^{2}.$$

It can be checked that

$$dx=dy\,\frac{(-1)\left(y-\sqrt{y^{2}-1}\right)}{\sqrt{y^{2}-1}}$$,

$$x^{-1}+x=2y$$,

$$x^{-2}+x^{2}=4y^{2}-2$$,

$$x^{-3}+x^{3}=8y^{3}-6y$$,

$$x^{-1}+1=y+1+\sqrt{y^{2}-1}$$,

$$\sqrt{2x}=\left(\sqrt{y+1}-\sqrt{y-1}\right)$$.

Then, $$\mathcal{I}_{6}$$ can be reduced to a manifestly elliptic integral as follows:

\begin{align} \mathcal{I}_{6} &=\int_{0}^{1}\mathrm{d}x\,\frac{1+x}{\sqrt{1+x+x^{2}+x^{3}+x^{4}+x^{5}+x^{6}}}\\ &=\int_{0}^{1}\mathrm{d}x\,\frac{1+x}{\sqrt{x^{3}\left(x^{-3}+x^{-2}+x^{-1}+1+x+x^{2}+x^{3}\right)}}\\ &=\int_{0}^{1}\mathrm{d}x\,\frac{\sqrt{2}\left(x^{-1}+1\right)}{\sqrt{2x}\sqrt{\left(x^{-3}+x^{3}\right)+\left(x^{-2}+x^{2}\right)+\left(x^{-1}+x\right)+1}}\\ &=\int_{+\infty}^{1}\mathrm{d}y\,\frac{(-1)\left(y-\sqrt{y^{2}-1}\right)}{\sqrt{y^{2}-1}}\cdot\frac{\left(y+1+\sqrt{y^{2}-1}\right)}{\left(\sqrt{y+1}-\sqrt{y-1}\right)}\\ &~~~~~\times\frac{\sqrt{2}}{\sqrt{\left(8y^{3}-6y\right)+\left(4y^{2}-2\right)+\left(2y\right)+1}};~~~\small{\left[x=y-\sqrt{y^{2}-1}\right]}\\ &=\int_{1}^{\infty}\mathrm{d}y\,\frac{\left(\sqrt{y+1}-\sqrt{y-1}\right)^{2}}{\sqrt{y+1}\sqrt{y-1}}\cdot\frac{\left(\sqrt{y+1}+\sqrt{y-1}\right)\sqrt{y+1}}{\left(\sqrt{y+1}-\sqrt{y-1}\right)}\\ &~~~~~\times\frac{\sqrt{2}}{2\sqrt{\left(8y^{3}-6y\right)+\left(4y^{2}-2\right)+\left(2y\right)+1}}\\ &=\int_{1}^{\infty}\mathrm{d}y\,\frac{\sqrt{2}}{\sqrt{y-1}}\cdot\frac{1}{\sqrt{8y^{3}+4y^{2}-4y-1}}\\ &=\int_{2}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{x-2}\sqrt{x^{3}+x^{2}-2x-1}};~~~\small{\left[y=\frac{x}{2}\right]}\\ &=\int_{2}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{\left(x-2\right)\left(x^{3}+x^{2}-2x-1\right)}}\\ &=\int_{2}^{\infty}\mathrm{d}x\,\frac{1}{\sqrt{\left(x-2\right)\left[\left(x+\frac13\right)^{3}-\frac73\left(x+\frac13\right)-\frac{7}{27}\right]}}\\ &=\int_{2+\frac13}^{\infty}\mathrm{d}t\,\frac{1}{\sqrt{\left(t-\frac13-2\right)\left(t^{3}-\frac73t-\frac{7}{27}\right)}};~~~\small{\left[x=t-\frac13\right]}\\ &=\int_{\frac73}^{\infty}\mathrm{d}t\,\frac{1}{\sqrt{\left(t-\frac73\right)\left(t^{3}-\frac73t-\frac{7}{27}\right)}}.\\ \end{align}

Given $$(p,q)\in\mathbb{R}^{2}$$ such that $$0, the depressed cubic equation

$$t^{3}-3pt-2q=0$$

has three distinct real roots $$t_{0},t_{1},t_{2}$$ that may be given by the trigonometric expression

$$t_{k}=2\sqrt{p}\cos{\left(\frac13\arccos{\left(\frac{q}{p\sqrt{p}}\right)}-\frac{2k\pi}{3}\right)};~~~\small{k\in\{0,1,2\}}.$$

Suppose $$p=\frac79\land q=\frac{7}{54}$$. Then, $$p>0\land p^{3}-q^{2}=\frac{49}{108}>0$$. Setting

$$a:=\frac73,$$

$$b:=\frac23\sqrt{7}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}\right)},$$

$$c:=\frac23\sqrt{7}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}-\frac{2\pi}{3}\right)},$$

$$d:=\frac23\sqrt{7}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}-\frac{4\pi}{3}\right)},$$

we have $$a>b>c>d$$ and

$$\forall t\in\mathbb{R}:t^{3}-\frac73t-\frac{7}{27}=\left(t-b\right)\left(t-c\right)\left(t-d\right).$$

Let $$\left(a,b,c,d,z\right)\in\mathbb{R}^{5}\land d. Then, $$0<\frac{\left(a-d\right)\left(b-c\right)}{\left(a-c\right)\left(b-d\right)}<1$$ and

$$0\le\frac{(b-d)(z-a)}{(a-d)(z-b)}<\frac{b-d}{a-d}<1.$$

Set $$\kappa:=\sqrt{\frac{\left(a-d\right)\left(b-c\right)}{\left(a-c\right)\left(b-d\right)}}\land\theta=\arcsin{\left(\sqrt{\frac{b-d}{a-d}}\right)}\land\omega=\arcsin{\left(\sqrt{\frac{(b-d)(z-a)}{(a-d)(z-b)}}\right)}$$. Then, the value of the elliptic integral $$\mathcal{E}{\left(a,b,c,d,z\right)}$$ can be reduced to Legendre normal form as follows:

\begin{align} \mathcal{E}{\left(a,b,c,d,z\right)} &=\int_{z}^{\infty}\mathrm{d}t\,\frac{1}{\sqrt{\left(t-a\right)\left(t-b\right)\left(t-c\right)\left(t-d\right)}}\\ &=\int_{z}^{\infty}\mathrm{d}t\,\frac{1}{\left(t-b\right)^{2}\sqrt{\left(\frac{t-a}{t-b}\right)\left(\frac{t-c}{t-b}\right)\left(\frac{t-d}{t-b}\right)}}\\ &=\int_{\frac{z-a}{z-b}}^{1}\mathrm{d}u\,\frac{\left(a-b\right)}{\left(1-u\right)^{2}}\cdot\frac{\left(1-u\right)^{2}}{\left(a-b\right)^{2}}\\ &~~~~~\times\frac{1}{\sqrt{u\left(\frac{a-c}{a-b}-\frac{b-c}{a-b}u\right)\left(\frac{a-d}{a-b}-\frac{b-d}{a-b}u\right)}};~~~\small{\left[t=\frac{a-bu}{1-u}\right]}\\ &=\int_{\frac{z-a}{z-b}}^{1}\mathrm{d}u\,\frac{1}{\sqrt{u\left[\left(a-c\right)-\left(b-c\right)u\right]\left[\left(a-d\right)-\left(b-d\right)u\right]}}\\ &=\int_{\frac{z-a}{z-b}}^{1}\mathrm{d}u\,\frac{\left(b-d\right)}{\sqrt{\left(b-d\right)u\left[\left(a-c\right)\left(b-d\right)-\left(b-c\right)\left(b-d\right)u\right]\left[\left(a-d\right)-\left(b-d\right)u\right]}}\\ &=\int_{\frac{b-d}{a-d}\cdot\frac{z-a}{z-b}}^{\frac{b-d}{a-d}}\mathrm{d}v\,\\ &~~~~~\times\frac{1}{\sqrt{v\left(1-v\right)\left[\left(a-c\right)\left(b-d\right)-\left(b-c\right)\left(a-d\right)v\right]}};~~~\small{\left[u=\frac{a-d}{b-d}v\right]}\\ &=\int_{\frac{(b-d)(z-a)}{(a-d)(z-b)}}^{\frac{b-d}{a-d}}\mathrm{d}v\,\frac{1}{\sqrt{\left(a-c\right)\left(b-d\right)v\left(1-v\right)\left[1-\frac{\left(a-d\right)\left(b-c\right)}{\left(a-c\right)\left(b-d\right)}v\right]}}\\ &=\frac{2}{\sqrt{\left(a-c\right)\left(b-d\right)}}\int_{\sin^{2}{\left(\omega\right)}}^{\sin^{2}{\left(\theta\right)}}\mathrm{d}v\,\frac{1}{2\sqrt{v\left(1-v\right)\left(1-\kappa^{2}v\right)}}\\ &=\frac{2}{\sqrt{\left(a-c\right)\left(b-d\right)}}\int_{\sin{\left(\omega\right)}}^{\sin{\left(\theta\right)}}\mathrm{d}x\,\frac{1}{\sqrt{\left(1-x^{2}\right)\left(1-\kappa^{2}x^{2}\right)}};~~~\small{\left[v=x^{2}\right]}\\ &=\frac{2}{\sqrt{\left(a-c\right)\left(b-d\right)}}\left[F{\left(\theta,\kappa\right)}-F{\left(\omega,\kappa\right)}\right],\\ \end{align}

where for $$\theta\in\left[-\frac{\pi}{2},\frac{\pi}{2}\right]\land\kappa\in\left(-1,1\right)$$ the incomplete elliptic integral of the first kind is defined by

$$F{\left(\theta,\kappa\right)}:=\int_{0}^{\theta}\mathrm{d}\varphi\,\frac{1}{\sqrt{1-\kappa^{2}\sin^{2}{\left(\varphi\right)}}}=\int_{0}^{\sin{\left(\theta\right)}}\mathrm{d}x\,\frac{1}{\sqrt{\left(1-x^{2}\right)\left(1-\kappa^{2}x^{2}\right)}}.$$

Returning finally to the evaluation of $$\mathcal{I}_{6}$$, we find that it is an instance of the elliptic integral $$\mathcal{E}$$ evaluated above:

\begin{align} \mathcal{I}_{6} &=\int_{\frac73}^{\infty}\mathrm{d}t\,\frac{1}{\sqrt{\left(t-\frac73\right)\left(t^{3}-\frac73t-\frac{7}{27}\right)}}\\ &=\int_{a}^{\infty}\mathrm{d}t\,\frac{1}{\sqrt{\left(t-a\right)\left(t-b\right)\left(t-c\right)\left(t-d\right)}}\\ &=\mathcal{E}{\left(a,b,c,d,a\right)}\\ &=\frac{2}{\sqrt{\left(a-c\right)\left(b-d\right)}}F{\left(\arcsin{\left(\sqrt{\frac{b-d}{a-d}}\right)},\sqrt{\frac{\left(a-d\right)\left(b-c\right)}{\left(a-c\right)\left(b-d\right)}}\right)},\\ \end{align}

where

\begin{align} &a=\frac73,\\ &b=\frac{2\sqrt{7}}{3}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}\right)},\\ &c=\frac{2\sqrt{7}}{3}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}-\frac{2\pi}{3}\right)},\\ &d=\frac{2\sqrt{7}}{3}\cos{\left(\frac13\arccos{\left(\frac{1}{2\sqrt{7}}\right)}-\frac{4\pi}{3}\right)}.\\ \end{align}

Let $$n\ge5$$. $$J_n=\int_0^\infty\sqrt{\frac{x-1}{x^n-1}}dx=\int_0^1\sqrt{\frac{x-1}{x^n-1}}dx+\int_1^\infty\sqrt{\frac{x-1}{x^n-1}}dx.$$ Then do $$x\mapsto 1/x$$ in the second integral, and add the two together: $$J_n=\int_0^1\left(1+x^{(n-5)/2}\right)\sqrt{\frac{x-1}{x^n-1}}dx.$$ Using $$(1-q)^{-\alpha}=\,_1F_0(\alpha;;q),$$ we have $$\sqrt{\frac{x-1}{x^n-1}}=\sum_{k\ge0}\beta_k^{(n)}x^k,$$ where $$\beta_k^{(n)}=\sum_{r=0}^{k}[n|r]\frac{(\tfrac12)_{r/n}(-\tfrac12)_{k-r}}{(r/n)!(k-r)!},$$ with $$[a|b]$$ being the Iverson Bracket for $$b/a\in\Bbb Z$$: $$[a|b]=\left\lfloor \exp\left(a\left\lfloor \frac{b}{a}\right\rfloor-b\right)\right\rfloor.$$ Thus $$J_n=\sum_{k\ge0}\beta_k^{(n)}\int_0^1(1+x^{(n-5)/2})x^kdx=\sum_{k\ge0}\beta_k^{(n)}\left(\frac1{k+1}+\frac{2}{2k+n-3}\right).$$ We have, additionally, that $$\beta_k^{(n)}=\sum_{r=0}^{\lfloor k/n \rfloor}\frac{(\tfrac12)_{r}(-\tfrac12)_{k-nr}}{r!(k-nr)!}.$$ I am doubtful that there is a general closed form.