# Integral $\int_0^1 \frac{\arctan x}{x^2-x-1}dx$

After seeing this integral I've decided to give a try to calculate:$$I=\int_0^1 \frac{\arctan x}{x^2-x-1}dx$$ That is because it's common for many integrals to have a combination of a polynomial in the denominator and a logarithm or an inverse trig function in the numerator.

Mostly I tried standard ways such as integrating by parts, random substitutions, or using: $$\frac{\arctan x}{x}=\int_0^1 \frac{dy}{1+x^2y^2}\Rightarrow I=\int_0^1 \int_0^1 \frac{x}{(1+y^2x^2)(x^2-x-1)}dxdy$$ But I realised that is not a great idea since it gives some mess after partial fractions, so I decided to prepare the integral a little for a Feynman's trick using probably the only helpful thing with that denominator, it won't change while using $$x\mapsto 1-x$$. $$I=\int_0^1 \frac{\arctan x}{x^2-x-1}dx=\int_0^1 \frac{\arctan (1-x)}{x^2-x-1}dx$$ $$2I=\int_0^1 \frac{\arctan x+\arctan(1-x)}{x^2-x-1}dx=\int_0^1 \frac{\arctan\left(\frac{1}{x^2-x+1}\right)}{x^2-x-1}dx$$ $$=\frac{\pi}{2 \sqrt 5}\ln\left(\frac{3-\sqrt 5}{3+\sqrt 5}\right)-\int_0^1 \frac{\arctan(x^2-x+1)}{x^2-x-1}dx$$ Now considering the following integral: $$J(a)=\int_0^1 \frac{\arctan(a(x^2-x-1)+2)}{x^2-x-1}dx\Rightarrow J'(a)=\int_0^1 \frac{1}{1+(a(x^2-x-1)+2)^2}dx$$ Although this trick worked nicer with the linked integral, this time I don't have so much success.

I have also rewritten the integral as: $$I=\frac{\phi}{\phi^2+1} \left(\int_0^1 \frac{\arctan x}{x-\phi}dx -\int_0^1 \frac{\arctan x}{x+\phi} dx \right)$$ Where $$\phi=\frac{1+\sqrt 5}{2}$$. And now considering: $$I(a)=\int_0^1 \frac{\arctan x}{x+a}dx\Rightarrow I(a)=\int_0^1 \int_0^1 \frac{x}{(1+y^2x^2)(x+a)}dxdy$$ It reduces to evaluating $$I(a)=a\int_0^1\frac{y\arctan y}{a^2y^2+1}dy-\frac12\int_0^1\frac{\ln\left(y^2+1\right)}{a^2y^2+1}dy+\int_0^1\frac{\ln\left(a+1\right)}{a^2y^2+1}dy-\int_0^1\frac{\ln a}{a^2y^2+1}dy$$ Of course, later we would have to take the difference between $$I(\phi)$$ and $$I(-\phi)$$, but the first two integrals are quite scary.

I would like to see a method which finds a closed form form this integral. I don't expect it to be very nice, I already imagine there will be some special functions, but atleast I hope it's something decent.

• Wolfram returns the value $I\approx -0.376513$. I would probably expect that this integral has a closed form in terms of the inverse tangent integral or dilogarithm. – aleden Feb 8 '19 at 20:09
• This is related to the dilogarithm $\mathrm{Li}_2$ as mentioned in aleden's comment. Unlike the integral in the link, where the relationship between $\mathrm{Li}_2$ and the golden ratio allows us to produce a closed-form, this integral seems not enjoying such nice relation. As such, I suspect that we cannot get rid of $\mathrm{Li}_2$ terms from the answer. – Sangchul Lee Feb 8 '19 at 20:32

Here is one approach. As a warning, the final answer I find is not pretty.

Let $$I = \int_0^1 \frac{\tan^{-1} x}{x^2 -x - 1} \, dx.$$ Start by using a self-similar substitution of $$x = \frac{1 - u}{1 + u}, \,\, dx = -\frac{2}{(1 + u)^2} \, du.$$ So , after having reverted the dummy variable $$u$$ back to $$x$$, we have $$I = 2 \int_0^1 \frac{\tan^{-1} \left (\frac{1 - x}{1 + x} \right )}{x^2 - 4x - 1} \, dx.$$ Noting that for $$0 < x < 1$$ $$\tan^{-1} \left (\frac{1 - x}{1 + x} \right ) = \frac{\pi}{4} - \tan^{-1} x,$$ then \begin{align} I &= \frac{\pi}{2} \int_0^1 \frac{dx}{x^2 - 4x - 1} - 2 \int_0^1 \frac{\tan^{-1} x}{x^2 - 4x - 1} \, dx\\ &= -\frac{\pi}{2 \sqrt{5}} \coth^{-1} \left (\frac{3}{\sqrt{5}} \right ) - 2 J, \end{align} where $$J = \int_0^1 \frac{\tan^{-1} x}{x^2 - 4x - 1} \, dx.$$

To find $$J$$ we begin by noting that $$\tan^{-1} x = \operatorname{Im} \ln (1 + ix)$$. Thus $$J = \operatorname{Im} \int_0^1 \frac{\ln (1 + ix)}{x^2 - 4x - 1} \, dx.$$ Making a substitution of $$t = 1 + ix$$ we have $$J = - \operatorname{Re} \int_1^{1+i} \frac{\ln t}{(t - \alpha)(t - \beta)} \, dt,$$ where $$\alpha = 1 + i(2 - \sqrt{5})$$ and $$\beta = 1 + i(2 + \sqrt{5})$$. After performing a partial fraction decomposition we are left with $$J = \frac{1}{2 \sqrt{5}} \operatorname{Im} \left [\int_1^{1 + i} \frac{\ln t}{\alpha - t} \, dt - \int_1^{1 + i} \frac{\ln t}{\beta - t} \, dt \right ].$$ Now, as $$\int \frac{\ln x}{z - x} \, dx = - \ln \left (1 - \frac{x}{z} \right ) \ln x - \operatorname{Li}_2 \left (\frac{x}{z} \right ),$$ (for a proof of this result see the appendix below), one has $$J = \frac{1}{2 \sqrt{5}} \operatorname{Im} \left [\ln (1 + i) \ln \left (\frac{\alpha}{\beta} \cdot \frac{\beta - 1 - i}{\alpha - i - i} \right ) + \operatorname{Li}_2 \left (\frac{1}{\alpha} \right ) - \operatorname{Li}_2 \left (\frac{1}{\beta} \right ) + \operatorname{Li}_2 \left (\frac{1 + i}{\beta} \right ) - \operatorname{Li}_2 \left (\frac{1 + i}{\alpha} \right ) \right ]$$ or after performing a huge amount of algebra \begin{align} J &= \frac{\pi}{8 \sqrt{5}} \ln (\sqrt{5} - 1) + \frac{1}{2 \sqrt{5}} \operatorname{Im} \left [\operatorname{Li}_2 \left (\frac{1}{2} + \frac{1}{\sqrt{5}}+ \frac{i}{2 \sqrt{5}} \right ) - \operatorname{Li}_2 \left (\frac{1}{2} - \frac{1}{\sqrt{5}} - \frac{i}{2 \sqrt{5}} \right ) \right.\\ & \quad+ \left. \operatorname{Li}_2 \left (\frac{1}{2} -\frac{1}{2 \sqrt{5}} - i \left (\frac{3}{2 \sqrt{5}} - \frac{1}{2} \right ) \right ) - \operatorname{Li}_2 \left (\frac{1}{2} +\frac{1}{2 \sqrt{5}} + i \left (\frac{3}{2 \sqrt{5}} + \frac{1}{2} \right ) \right ) \right ]\\ &= \frac{\pi}{8 \sqrt{5}} \ln (\sqrt{5} - 1) + \frac{1}{2 \sqrt{5}} \operatorname{Im} \frak{w}, \end{align} where $$\frak{w}$$ is the term containing the four dilogarithms with complex arguments. Thus $$\int_0^1 \frac{\tan^{-1} x}{x^2 - x - 1} \, dx = -\frac{\pi}{4 \sqrt{5}} \left (\ln 2 + \sinh^{-1} (2) \right ) - \frac{1}{\sqrt{5}} \operatorname{Im} \frak{w}.$$ Note that as $$\operatorname{Im} {\frak{w}} = -0.8363170651979\ldots$$ we see that $$I \approx -0.376513$$.

Appendix

Proof of $$\int \frac{\ln x}{z - x} \, dx = - \ln \left (1 - \frac{x}{z} \right ) \ln x - \operatorname{Li}_2 \left (\frac{x}{z} \right ) + C$$

Setting $$t = x/z, dt = dx/z$$, we have \begin{align} \int \frac{\ln x}{z - x} \, dx &= \int \frac{\ln (zt)}{1 - t} \, dt\\ &= -\ln (1 - t) \ln (zt) + \int \frac{\ln (1 - t)}{t} \, dt \qquad \text{(by parts)}\\ &= -\ln (1 - t) \ln t - \operatorname{Li}_2 (t) + C\\ &= - \ln \left (1 - \frac{x}{z} \right ) \ln x - \operatorname{Li}_2 \left (\frac{x}{z} \right ) + C, \end{align} as required to show.

• Thank you. A small question, what is the merit of the substitution: $x = \frac{1 - u}{1 + u}$. Why not directly perform what you've done afterwards? – Zacky Feb 9 '19 at 10:47
• @Zacky - Of course the method I use can be applied directly to the integral without the need for first making a self-similar substitution. I just felt the integral $J$ is slightly easier to deal with rather than the initial integral $I$ once it comes to making the substitution of $t = 1 + ix$ but that is hardly here nor there. – omegadot Feb 9 '19 at 22:11