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...).

  • $\begingroup$ 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. $\endgroup$ Jul 7, 2017 at 20:09
  • $\begingroup$ 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 $\endgroup$
    – user243301
    Jul 7, 2017 at 20:11
  • $\begingroup$ I open this bounty to draw attention with the purpose to obtain, if it is possible, more contributions. Many thanks all users. $\endgroup$
    – user243301
    Jul 12, 2017 at 8:00
  • 1
    $\begingroup$ 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. $\endgroup$
    – user243301
    Jul 18, 2017 at 16:06

3 Answers 3



$$\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.


$\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}$

Additional comment:

$$\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\,$ .

  • $\begingroup$ Many thanks for your calculations and interesting series, and share these with us. I am going to study your nice calculations. $\endgroup$
    – user243301
    Jul 13, 2017 at 8:51
  • $\begingroup$ @user243301: You are welcome. :-) $\endgroup$
    – user90369
    Jul 13, 2017 at 8:53
  • 1
    $\begingroup$ (+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 $$ $\endgroup$ Jul 14, 2017 at 2:17
  • 1
    $\begingroup$ @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$ . :-) $\endgroup$
    – user90369
    Jul 14, 2017 at 7:51

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

enter image description here

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).

  • $\begingroup$ Many thanks for your attention. Was just a curiosity, and it is incredible to me that you can add a nice answer as this. $\endgroup$
    – user243301
    Jul 7, 2017 at 20:14
  • $\begingroup$ @user243301 No problem, I was glad to help! I love "curiosities" like this. :) $\endgroup$ Jul 7, 2017 at 20:18
  • $\begingroup$ The bottom of the formula for the antiderivative seems to have been cut off. $\endgroup$ Jul 7, 2017 at 20:45
  • 1
    $\begingroup$ Presumably there must be terms involving $x - (1 \pm i \sqrt{3})/2$, which are the factors of $x^2 - x + 1$. $\endgroup$ Jul 7, 2017 at 20:47
  • 2
    $\begingroup$ 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. $\endgroup$ 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:



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:


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


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

Put this into $(5)$ to get


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)$:


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:


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

Not bad.

  • $\begingroup$ 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. $\endgroup$
    – user243301
    Jul 14, 2017 at 16:52
  • $\begingroup$ 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. $\endgroup$
    – user90369
    Jul 14, 2017 at 22:14
  • $\begingroup$ @user90369 For this particular integral maybe ineffective but if an integral is for example parameter-dependent then your simple Taylor series approach is useless while the method i presented is still applicable. $\endgroup$ Jul 15, 2017 at 12:32
  • $\begingroup$ If a method is unsufficient, why should we use it - especially if there are simpler alternatives? --- However, you can certainly discuss this better with the OP. $\endgroup$
    – user90369
    Jul 15, 2017 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy