# Is there any method other than Feynman’s trick which can deal further with powers higher than 2?

Background

When I met the integral $$\int_0^1 \frac{\left(x^\phi-1\right)^2}{\ln ^2 x} d x\\$$ where $$\phi$$ is the golden ratio: $$\phi^2= \phi+1,$$

I was surprised by its simple and decent value though it is hard to tackle. I had tried some methods such as substitutions, integration by parts etc. and failed.

Then I tried Feynman’s trick by introducing the integral parametrized by $$t$$

$$I(t)= \int_0^1 \frac{\left(x^t-1\right)^2}{\ln ^2 x} d x\\$$ As usual differentiating $$I(t)$$ w.r.t. $$t$$ once and twice yields $$I^{\prime}(t)=\int_0^1 \frac{2\left(x^t-1\right) x^t}{\ln x}dx$$and \begin{aligned} I^{\prime \prime}(t) & =\int_0^1 \left(4x^{2 t}-2x^t\right) d x \\ & =\frac{4}{2 t+1}-\frac{2}{t+1} \end{aligned} Noticing that $$I(0)=I^{\prime}(0)=0$$, we can easily integrating back to $$I(t)$$ in two steps. $$I^{\prime}(t)-I^{\prime}(0)=\int_0^t I^{\prime \prime}(u) d u=\int_0^t\left(\frac{4}{2 u+1}-\frac{2}{u+1}\right) du$$ $$I^{\prime}(t)=2\ln (2 t+1)-2 \ln (t+1)$$ Similarly, \begin{aligned} I(t)-I(0) & =\int_0^t I^{\prime}(u) d u =\int_0^t[2\ln (2 u+1)-2 \ln (u+1)] d u \end{aligned} Using the result $$\int \ln x d x=x \ln x-x+C$$, we have $$\boxed{\int_0^1 \frac{\left(x^t-1\right)^2}{\ln ^2 x} d x =(2 t+1) \ln (2 t+1)-2(t+1) \ln (t+1)}$$ Using $$\phi^2= \phi+1$$ gives $$I=I(\phi)= (2 \phi+1) \ln \left(\phi^3\right)-2(\phi+1) \ln \left(\phi^2\right)= (2 \phi-1) \ln \phi =(2 \phi-1) \ln \phi =\boxed{\sqrt 5 \ln \phi }$$

My Questions:

1. Is there any method other than Feynman’s trick?
2. Can we go further with the powers higher than 2?
• Is $a=t$? It seems like you're switching between the two letters. Commented Mar 24, 2023 at 6:07
• Sorry for my typo. Thank you.
– Lai
Commented Mar 24, 2023 at 6:09
• You can use Frullani Integral, although it is very similar to Feyman's trick. Commented Mar 24, 2023 at 6:49
• Why wouldn't the same method work for powers higher than 2? Commented Mar 24, 2023 at 7:08
• "other than Feynman's trick and": did you mean to suggest another method we should avoid when suggesting alternatives?
– J.G.
Commented Mar 24, 2023 at 7:26

$$x=e^{-u}$$ is easier for guessing. Consider $$I=\int_0^{\infty}\left(\frac{1-e^{-u\phi}}{u}\right)^2e^{-u}du=\int_0^{\infty}\left(\int_0^{\phi}\int_0^{\phi}e^{-ut_1-ut_2}dt_1dt_2\right)du=\int_0^{\phi}\int_0^{\phi}\frac{dt_1dt_2}{1+t_1+t_2}=\int_0^{\phi}[\log(1+t_1+\phi)-\log(1+t_1)]dt_1=(2\phi+1)\log (2\phi+1)-2(\phi+1)\log (\phi+1)$$ and we conclude as in the previous solution.

Of course the power $$2$$ can be replaced by $$n$$: all what we need are the primitives of $$x^k\log x$$ for $$k=0,1,n-2.$$

• A great solution generalize the integral $I_n$. Thank you very much!
– Lai
Commented Mar 25, 2023 at 2:06

Let $$I(a,b)=\int_0^1\frac{(x^a-1)(x^b-1)}{\ln^2x}dx.$$ It is easy to calculate $$\frac{\partial^2I(a,b)}{\partial a\partial b}=\int_0^1x^{a+b}dx=\frac1{a+b+1}$$ and so $$I(\phi,\phi)=\cdots.$$

• Creative solution! Thank you.
– Lai
Commented Mar 25, 2023 at 0:54

We have

$$I:=\int_{0}^{1}\frac{\left(x^{\phi}-1\right)^{2}}{\ln^{2}\left(x\right)}dx = \int_{-\infty}^{0}\frac{\left(e^{\phi x}-1\right)^{2}}{x^{2}}e^{x}dx$$

using the mapping $$x \mapsto e^x$$. To avoid messy bounds and divergent integrals, let $$J$$ be the integral above but without the bounds. Then

$$J=\int_{ }^{ }\frac{e^{2\phi x+x}}{x^{2}}dx-2\int_{ }^{ }\frac{e^{\phi x+x}}{x^{2}}dx+\int_{ }^{ }\frac{e^{x}}{x^{2}}dx.$$

Using IBP on the first integral, let $$u = e^{2\phi x + x}$$ and $$dv = dx/x^2$$ so that the first integral becomes

$$-\frac{e^{2\phi x+x}}{x}+\left(2\phi+1\right)\int_{ }^{ }\frac{e^{2\phi x+x}}{x}dx=-\frac{e^{2\phi x+x}}{x}+\left(2\phi+1\right)\operatorname{Ei}\left(\left(2\phi+1\right)x\right)+C$$

where $$\operatorname{Ei}(z)$$ denotes the Exponential Integral.

We can apply similar IBP procedures for the other two integrals. After that grunt work, we get

$$J = \left(2\phi+1\right)\operatorname{Ei}\left(\left(2\phi+1\right)x\right)-\left(2\phi+2\right)\operatorname{Ei}\left(\left(\phi+1\right)x\right)+\operatorname{Ei}\left(x\right)-\frac{\left(e^{\phi x}-2\right)e^{\left(\phi+1\right)x}+e^{x}}{x}+C.$$

Let some small $$\epsilon < 0$$. By FTC Part 2, we have

$$I = \lim_{\epsilon \to 0} \lim_{t \to -\infty}\bigg[\left(2\phi+1\right)\operatorname{Ei}\left(\left(2\phi+1\right)x\right)-\left(2\phi+2\right)\operatorname{Ei}\left(\left(\phi+1\right)x\right)+\operatorname{Ei}\left(x\right)-\frac{\left(e^{\phi x}-2\right)e^{\left(\phi+1\right)x}+e^{x}}{x}\bigg]_{t}^{\epsilon}.$$

It can be shown that $$\displaystyle \lim_{t\to -\infty} \operatorname{Ei}(t) = 0$$ and $$\displaystyle \frac{\left(e^{\phi x}-2\right)e^{\left(\phi+1\right)x}+e^{x}}{x} \to 0$$ as $$x \to -\infty$$ and $$x \to 0$$. This leaves us with

$$I = \lim_{\epsilon \to 0} \left(\left(2\phi+1\right)\operatorname{Ei}\left(\left(2\phi+1\right)ϵ\right)-\left(2\phi+2\right)\operatorname{Ei}\left(\left(\phi+1\right)ϵ\right)+\operatorname{Ei}\left(ϵ\right)\right).$$

Using the series expansion for $$\operatorname{Ei}(az)$$, which is

$$γ-\frac{1}{2}\log\left(\frac{1}{az}\right)+\frac{1}{2}\log\left(az\right)+\sum_{n=1}^{\infty}\frac{\left(az\right)^{n}}{nn!},$$

we can deal with the removable discontinuity at $$0$$ and get $$I$$ to be

$$\lim_{\epsilon \to 0}\left(\left(2\phi+1\right)\left(γ+\ln\left(\left(2\phi+1\right)ϵ\right)+\sum_{n=1}^{\infty}\frac{\left(2\phi+1\right)^{n}ϵ^{n}}{nn!}\right)-\left(2\phi+2\right)\left(γ+\ln\left(\left(\phi+1\right)ϵ\right)+\sum_{n=1}^{\infty}\frac{\left(\phi+1\right)^{n}ϵ^{n}}{nn!}\right)+\left(γ+\ln\left(ϵ\right)+\sum_{n=1}^{\infty}\frac{ϵ^{n}}{nn!}\right)\right)$$

which simplifies as

$$\lim_{\epsilon \to 0}\left(\left(2\phi+1\right)\left(γ+\ln\left(\left(2\phi+1\right)ϵ\right)+0\right)-\left(2\phi+2\right)\left(γ+\ln\left(\left(\phi+1\right)ϵ\right)+0\right)+\left(γ+\ln\left(ϵ\right)+0\right)\right)$$ $$=\lim_{\epsilon \to 0} \sqrt{5}\ln\left(\phi\right) = \sqrt{5}\ln\left(\phi\right).$$

• Interesting solution with Exponential Integral. Thank you.
– Lai
Commented Mar 25, 2023 at 0:51
• You're welcome! I enjoyed struggling with that problem. @Lai Commented Mar 25, 2023 at 2:07
• It’s quite challenging to deal with the limits of the Exponential integral
– Lai
Commented Mar 25, 2023 at 2:55

Let $$J(t)=\int_0^1 \frac{\left(x^t-1\right)^3}{\ln ^3 x} d x,$$ then differentiating $$J(t)$$ w.r.t $$t$$ thrice yields \begin{aligned} J^{(3)}(t) & =\int_0^1 \frac{3 x^t\left(9 x^{2 t}-8 x^t+1\right) \ln ^3 x}{\ln ^3 x} d x \\ & =27 \int_0^1 x^{3 t} d x-24 \int_0^1 x^{2 t} d x+3 \int_0^1 x^t d x \\ & =\frac{27}{3 t+1}-\frac{24}{2 t+1}+\frac{3}{t+1} \end{aligned}

Noting that $$I(0)=I’(0)=I”(0)=0$$, we can integrating back $$J(t)$$ quickly.

$$J^{(2)}(t)=3\ln (3 t+1)-4 \ln (2 t+1)+3 \ln (t+1)$$ Using $$\int \ln xdx=x\ln x-x+C$$ gives

$$J^{(1)}(t)=-2 t+3 t \ln(3 t+1)+3(t+1) \ln(t+1)-2(2 t+1) \ln(2 t+1)+\ln(3 t+1)+C$$ Using $$\int x\ln x dx=\frac{x^2}{4}(2\ln x-1)+C$$ gives

$$\boxed{J(t)= \frac{1}{6}\left(-9 t^2+9 t^2 \ln(3 t+1)-6 t+6 t \ln(3 t+ 1)+9(t+1)^2 \ln(t+1)\; \quad \\-3(2 t+1)^2 \ln(2 t+1)+\ln(3 t+1)\right)}$$

Now we can conclude that

$$\boxed{J(\phi)= \frac{1}{6}\left(-9 \phi ^2+9 \phi ^2 \ln(3 \phi +1)-6 \phi +6 \phi \ln(3 \phi + 1)+9(\phi +1)^2 \ln(t+1)\; \quad \\-3(2 \phi +1)^2 \ln(2 \phi +1)+\ln(3 \phi +1)\right)}$$

Remark: The answer is so complicated and the method is hard to be carried on for higher powers.

$$x=e^{-u}$$ gives $$I=\int_0^{\infty}u^{-2}\left(e^{-(2\phi+1)u}-2e^{-(\phi+1)u}+e^{-u}\right)du.$$ This produces an $$\Gamma(-1).0$$ uncertainty but we can make a trick: \begin{align} I&=\lim_{\epsilon\rightarrow 0}\int_0^{\infty}u^{-2+\epsilon}\left(e^{-(2\phi+1)u}-2e^{-(\phi+1)u}+e^{-u}\right)du\\ &=\lim_{\epsilon\rightarrow 0}\Gamma(-1+\epsilon)\left((2\phi+1)^{1-\epsilon}-2(\phi+1)^{1-\epsilon}+1\right)\\ &=(2\phi+1)\ln(2\phi+1)+2(\phi+1)\ln(\phi+1)\hspace{1cm}\text{(By L'hospital rule)}\\ &=\sqrt5\ln\phi \end{align}

WolframAlpha took the limit.

By Gérard Letac‘s idea, we can directly generalize the integral as \begin{aligned} I_n &=\int_0^1\left(\frac{x^\phi-1}{\ln x}\right)^n d x \\ & =\int_0^1 \left(\underbrace{\int_0^\phi \int_0^\phi \cdots \int_0^\phi}_{n \text { integral signs }} x^{t_1+t_2+\ldots+t_n} d t_1 d t_2 \cdots d t_n\right) dx \\&= \underbrace{\int_0^\phi \int_0^\phi \cdots \int_0^\phi}_{n \text { integral signs } }\left(\int_0^1 x^{t_1+t_2+\ldots+t_n} d x\right) d t_1 d t_2 \cdots d t_n \\ &= \int_0^\phi \int_0^\phi \cdots \int_0^\phi \frac{1}{1+t_1+t_2+\cdots+t_n} d t_1 d t_2 \cdots d t_n\\ & \end{aligned} For example, \begin{aligned} I_3 & =\int_0^\phi \int_0^\phi \int_0^\phi \frac{1}{1+t_1+t_2+t_3} d t_1 d t_2 d t_3 \\ &=\int_0^\phi \int_0^\phi \ln \left(1+\phi+t_2+t_3\right) d t_2 d t_3\\ &= \int_0^\phi\left[\left(1+\phi+t_2+t_3\right) \ln \left(1+\phi+t_2+t_3\right)-\left(1+\phi+t_2+t_3\right)\right]_0^1 d t \\ & =\int_0^\phi[\left(2 \phi+1+t_3\right) \ln \left(2 \phi+1+t_3\right)-1-2 \phi -t_3 \\ & \quad \left.-\left(\phi+1+t_3\right) \ln \left(\phi+1+t_3\right)+1+\phi+t_3\right] d t_3\\& \end{aligned} Using $$\int x \ln x d x=\frac{x^2}{4}(2 \ln x-1)+C$$, we have \begin{aligned} I_3= & \frac{\left(\phi^3+\phi\right)^2}{4}\left[2 \ln \left(\phi^3+\phi\right)-1\right]-\frac{\left(\phi^2+\phi\right)^2}{4}\left[2 \ln \left(\phi^2+\phi\right)-1\right] \\ & -\frac{\phi^6}{4}\left[2 \ln \left(\phi^3\right)-1\right]-\frac{\phi^4}{4}\left[2 \ln \left(\phi^2\right)-1\right] \end{aligned}

Making the problem more general $$I_n=\int_0^1 \left(\frac{x^a-1}{\log (x)}\right)^n\,d x\qquad \text{where}\qquad a>0$$ using $$x=e^{-t}$$ gives $$I_n=\int_0^\infty e^{-t}\, t^{-n}\, \left(1-e^{-a t}\right)^n\,dt$$ leads to interesting expressions.

For example $$I_5=\frac{5}{24} (1+a)^4\log(1+a)-\frac{5}{12} (1+2 a)^4\log(1+2a)+\frac{5}{12} (1+3 a)^4\log(1+3a)-$$ $$\frac{5}{24} (1+4 a)^4\log(1+4a)+\frac{1}{24} (1+5 a)^4\log(1+5a)$$ All of them present the same structure $$I_n=\frac 1{(n-1)!}\sum_{k=1}^n \alpha_n \, (1+k\,a)^{n-1}\,\log(1+k\,a)$$ the $$\alpha_n$$ being integer numbers probably related to Pascal triangle.