# Evaluate $\int\limits_0^1\frac{\log(1-x+x^2)\log(1+x-x^2)}{x}dx$

I was doing experiments with Wolfram Alpha online calculator, about similar integrals (simpler than the below one) and wondered about how get a closed-form for $$\int_0^1\frac{\log(1-x+x^2)\log(1+x-x^2)}{x}dx\tag{1}.$$

I've calculated the definite integral using the online calculator, but I believe that the output is an approximation, and since after of this, I've asked to Wolfram Alpha about the indefinite integral, I know that Wolfram Alpha can calculate it, but to me is impossible to evaluate the terms (are about two pages)

int log(1-x+x^2)log(1+x-x^2)/x dx

Question. Is there some way to evaluate this integral in $(1)$? This was just a curiosity, but I am asking here if you know such integral or do you know how get the evaluation of our integral. Thanks in advance.

Since Wolfram Alpha's answer seems to me difficult, I didn't any attempt (change or variable, integration by parts...).

• I doubt there is a nice closed form, since $x^2-x+1$ is a cyclotomic polynomial, but $x^2-x-1$ is not. But maybe there is some strange interaction between the golden ratio and the sixth roots of unity. Jul 7, 2017 at 20:09
• I don't know, and many thanks for your help. I am asking as curiosity, but Wolfram Alpha provide us an antiderivative. Any case, feel free to add your reasonings, always is useful @JackD'Aurizio
– user243301
Jul 7, 2017 at 20:11
• I open this bounty to draw attention with the purpose to obtain, if it is possible, more contributions. Many thanks all users.
– user243301
Jul 12, 2017 at 8:00
• All users, I've decided choose this answer, due to the approach and also because the last statement has a great beauty. But the approach and approximation of the other answers are also very very nice. Thus my decision was very difficult. Many thanks all users.
– user243301
Jul 18, 2017 at 16:06

It's

$$\int_0^1\frac{\log(1-x+x^2)\log(1+x-x^2)}{x}dx= -2\sum\limits_{k=1}^\infty \frac{(2k-1)!^2}{(4k)!}\sum\limits_{v=0}^{k-1}\frac{1}{k+v}$$

which is $\enspace\approx -0.0848704554500727311…$ .

Already $\enspace\displaystyle -2\sum\limits_{k=1}^{10} \frac{(2k-1)!^2}{(4k)!}\sum\limits_{v=0}^{k-1}\frac{1}{k+v}\enspace$ gives a good approach.

Note: A closed form for such or comparable series is not known to me.

Proof:

$\displaystyle \int_0^1\frac{\log(1-x+x^2)\log(1+x-x^2)}{x}dx=$

$\displaystyle =\int_0^1\lim\limits_{h\to 0}\frac{((1-x+x^2)^h-1)((1+x-x^2)^h-1)}{h^2x}dx$

$\displaystyle =\lim\limits_{h\to 0}\frac{1}{h^2}\int_0^1\frac{((1-x+x^2)^h-1)((1+x-x^2)^h-1)}{x}dx$

$\displaystyle =\lim\limits_{h\to 0}\frac{1}{h^2}\left(\int_0^1\left(\frac{(1-(x-x^2)^2)^h-1}{x}-\frac{(1-x+x^2)^h-1}{x}-\frac{(1-x+x^2)^h-1}{x}\right)dx\right)$

$\displaystyle =\lim\limits_{h\to 0}\frac{1}{h^2}\int_0^1\left(\sum\limits_{k=1}^\infty \binom h k \left(x^{k-1}(-x(1-x)^2)^k -x^{k-1}(-1+x)^k -x^{k-1}(1-x)^k\right) \right)$

$\displaystyle =\lim\limits_{h\to 0}\frac{1}{h^2}\sum\limits_{k=1}^\infty \binom h k \int_0^1\left(x^{k-1}(-x(1-x)^2)^k -x^{k-1}(-1+x)^k -x^{k-1}(1-x)^k\right)dx$

$\displaystyle =\lim\limits_{h\to 0}\frac{1}{h^2}\sum\limits_{k=1}^\infty \binom h k \left((-1)^k\frac{(2k-1)!(2k)!}{(4k)!} -(1+(-1)^k)\frac{(k-1)!k!}{(2k)!}\right)$

$\displaystyle =-\lim\limits_{h\to 0}\frac{1}{h^2}\sum\limits_{k=1}^\infty \left((-1)^{k-1}\binom h k + 2\binom h {2k}\right) \frac{(2k-1)!(2k)!}{(4k)!}$

$\displaystyle =-\sum\limits_{k=1}^\infty \frac{(2k-1)!(2k)!}{(4k)!}\lim\limits_{h\to 0}\frac{1}{h^2}\left((-1)^{k-1}\binom h k + 2\binom h {2k}\right)$

$\displaystyle =-\sum\limits_{k=1}^\infty \frac{(2k-1)!(2k)!}{(4k)!}\frac{H_{2k-1}-H_{k-1}}{k}= -2\sum\limits_{k=1}^\infty \frac{(2k-1)!^2}{(4k)!}\sum\limits_{v=0}^{k-1}\frac{1}{k+v}$

$$\int_0^1\frac{\log(1-z(x-x^2))\log(1+z(x-x^2))}{x}dx= -2\sum\limits_{k=1}^\infty z^{2k}\frac{(2k-1)!^2}{(4k)!}\sum\limits_{v=0}^{k-1}\frac{1}{k+v}$$

for $\,z\in\mathbb{C}\,$ and $\,|z|\leq 1\,$ .

• Many thanks for your calculations and interesting series, and share these with us. I am going to study your nice calculations.
– user243301
Jul 13, 2017 at 8:51
• @user243301: You are welcome. :-) Jul 13, 2017 at 8:53
• (+1) It might be interesting to point out that $$\sum_{k\geq 1}\frac{(k-1)!}{(2k)!}x^{2k}=2\arcsin^2\left(\frac{x}{2}\right)$$ that is related with the last series through the discrete Fourier transform and the operator $$f\mapsto \int_{0}^{1}\frac{f(x)-1}{x-1}\,dx$$ Jul 14, 2017 at 2:17
• @JackD'Aurizio: Thanks for your note (I know: you've broad expertise) ! But maybe it's closer to the given problem to discuss (at least first) $\int_0^1\frac{\log(1-z(x-x^2))\log(1+z(x-x^2))}{x}\,\,dx$ . :-) Jul 14, 2017 at 7:51

First of all, it was probably a good call not trying this yourself...

I would say that you can't evaluate it "exactly", because if you go digging through Wolfram Alpha's gigantic monstrosity of antidifferentiation, you will find a lot of logarithmic integrals in there, which are not elementary functions.

It makes sense, too, that this is so ugly, because it will end up going into complex numbers. Your definite integral can be evaluated with less difficulty because $1+x-x^2$ is positive over that interval, but it is negative for all $x$ above the golden ratio and below its conjugate, meaning that $\ln(1+x-x^2)$ does not even exist in the reals over that interval. So calculating the antiderivative is out of the question.

If you still want to go after it, here's a trick that might lead somewhere (but probably not): let $$s(a,b)=\int_0^1 \frac{\ln(1-x+x^2)\ln(1+x-x^2)a^{\ln(1+x-x^2)-1}b^{\ln(1-x+x^2)-1}}{x}dx$$ Then integrate both sides to get $$\int s(a,b)da=\int_0^1 \frac{\ln(1-x+x^2)a^{\ln(1+x-x^2)}b^{\ln(1-x+x^2)-1}}{x}dx+C$$ $$\int s(a,b)da=\int_0^1 \frac{\ln(1-x+x^2)(1+x-x^2)^{\ln a}b^{\ln(1-x+x^2)-1}}{x}dx+C$$ Then integrate with respect to the other variable to get $$\int\int s(a,b)dadb=\int_0^1 \frac{(1+x-x^2)^{\ln a}b^{\ln(1-x+x^2)}}{x}dx+C$$ $$\int\int s(a,b)dadb=\int_0^1 \frac{(1+x-x^2)^{\ln a}(1-x+x^2)^{\ln b}}{x}dx+C$$

Your integral is equal to $S(1,1)$, so if you find a closed-form of $$\int_0^1 \frac{(1+x-x^2)^{\ln a}(1-x+x^2)^{\ln b}}{x}dx+C$$ and then use that to find $s(a,b)$, you might be able to do it... but I highly doubt that you will want to do this.

My advice to you is this: just evaluate it numerically and maybe use an inverse symbolic calculator (or abandon this evil integral altogether).

• Many thanks for your attention. Was just a curiosity, and it is incredible to me that you can add a nice answer as this.
– user243301
Jul 7, 2017 at 20:14
• @user243301 No problem, I was glad to help! I love "curiosities" like this. :) Jul 7, 2017 at 20:18
• The bottom of the formula for the antiderivative seems to have been cut off. Jul 7, 2017 at 20:45
• Presumably there must be terms involving $x - (1 \pm i \sqrt{3})/2$, which are the factors of $x^2 - x + 1$. Jul 7, 2017 at 20:47
• The integrand at the top is slightly different from the OP's (it has $\log(1-x\color{red}-x^2)$ instead of $\log(1-x\color{blue}+x^2)$), but I don't imagine the answer would be much simpler. Jul 8, 2017 at 5:32

Here's how a physicist is dealing with such a problem.

First of all, note the following relation:

$$1-x+x^2=\frac{1+x^3}{1+x}$$ It allows to split the original integral into two integrals:

$$I_1=\int_0^1\frac{\ln(1+x^3)\ln(1+x-x^2)}{x}dx;(1)$$

$$I_2=-\int_0^1\frac{\ln(1+x)\ln(1+x-x^2)}{x}dx;(2)$$

Even these integrals seem not to have easy manageable closed form solutions.

So we get out of the mainstream.

First step is to note that $y=\ln(1+x)$ satisfies the following differential equation: $$(1+x)\frac{d^2y}{dx^2}+\frac{dy}{dx}=0;(3)$$

On the other hand, if we consider the following functional:

$$J[y(x)]=\int_0^1(1+x)\left ({\frac{dy}{dx}} \right )^2dx;(4)$$

then $(3)$ is so called Euler-Lagrange Differential Equation for $(4)$

(See Wikipedia for ex.)

It means that we can use $(4)$ to find an approximate expression for $y=\ln(1+x)$ such that $(1)$ and $(2)$ can be evaluated in closed forms.

As a first approximation we choose a simplest expression:

$$y_1=x\ln(2)+cx(x-1);(5)$$

Next put $(5)$ into $(4)$ to get

$$J(c)=\frac{c^2}{2}+\frac{c\ln(2)}{3}+\frac{3\ln^2(2)}{2};(6)$$

An extremum point of $(6)$ is $c=-\frac{\ln(2)}{3}$

Put this into $(5)$ to get

$$y_1=\frac{\ln(2)}{3}(4-x)x;(7)$$

That's what we have been looking for, an approximation of $y=\ln(1+x)$ in the range $(0,1).$

For $y=\ln(1+x^3)$ we get from $(7)$:

$$y_1=\frac{\ln(2)}{3}(4-x^3)x^3;(8)$$

Now we are able to evaluate $(1)$ and $(2)$ in closed forms, replacing

$y=\ln(1+x^3)$ and $y=\ln(1+x)$ in $(1)$ and $(2)$ with $(8)$ and $(7)$ respectively.

I skip routine calculations and write down only the end result:

$$I=I_1+I_2=-\frac{13\ln(3)}{1080}(60\sqrt{5}\ln\frac{3+\sqrt{5}}{2}-119)=-0.0844...$$

Absolute error from exact value is less than $0.00042$.

• Many thanks, even I 've calculated the Euler-Lagrange equation to follow your nice calculations...since $F_{y'}=2(1+x)\frac{dy}{dx}$ then $0=0-\frac{d}{dx}(2(1+x)\frac{dy}{dx})=-2(\frac{dy}{dx}+(1+x)\frac{d^2y}{dx^2})$. And is that your answer is so cool.
• Your approach is certainly interesting, but unfortunately not effective. If we substitute $\ln(1+z)$ by $z-z^2/2+z^3/3$ then we get for the integral the approximation $-2419/28512\approx -0.084841$ which is simplier to calculate and a better result. Jul 14, 2017 at 22:14