# Integral: $\int_{0}^{1}\frac{\arctan^{2}\left(x\right)}{x}dx$

Context: While working on a contour integral for fun, I stumbled upon the following integral:

$$\int_{0}^{1}\frac{\arctan^{2}\left(x\right)}{x}dx.$$

I typed it into WolframAlpha and got that it equals

$$\frac{1}{8}(4\pi C - 7\zeta{(3)}),$$

where $$C$$ denotes Catalan's Constant and $$\zeta{(3)}$$ denotes Apery's Constant.

Attempt: Let's call the original integral $$I$$. At first, I tried IBP, then letting $$x = \tan{(\theta)}$$, then IBP again like this:

\eqalign{ I &= -2\int_{0}^{1}\frac{\arctan\left(x\right)\ln\left(x\right)}{1+x^{2}}dx \cr &= -2\int_{0}^{\frac{\pi}{4}}x\ln\left(\tan\left(x\right)\right)dx \cr &= 2\int_{0}^{\frac{\pi}{4}}\frac{x^{2}}{\sin\left(2x\right)}dx. }

At that point, I decided I was using IBP an unnecessary amount of times and figured there has to be a nicer solution. I also tried differentiating with respect to a parameter $$a$$ and defining

$$J(a) = -2\int_{0}^{1}\frac{\arctan\left(x\right)\ln\left(ax\right)}{1+x^{2}}dx,$$

but I ended up circling back to where I started after doing a lot of grunt work. I also tried

$$-2\int_{0}^{\frac{\pi}{4}}x\ln\left(\tan\left(x\right)\right)dx = -2\int_{0}^{\frac{\pi}{4}}x\ln\left(\sin\left(x\right)\right)dx+2\int_{0}^{\frac{\pi}{4}}x\ln\left(\cos\left(x\right)\right)dx$$

and using Taylor Series and complex definitions of $$\sin{(x)}$$ and $$\cos{(x)}$$, but I was getting a mess.

Question: Does anyone know a nice way of solving the given integral? If it's not a pretty solution, it's fine. Any hints and help are appreciated.

• Since the answer is Catalan's constant and Apery's constant, my guess would be that converting the integrand into a Taylor series is the way to go. Aug 20, 2022 at 11:38
• Does this help? math.stackexchange.com/questions/984026/… seems quite similar Aug 20, 2022 at 11:53
• In the step which you split $\log{(\tan{x})}$, try to use Fourier series of $\log{(\sin{x})}$ and $\log{(\cos{x})}$, then change the order of integration and summation This link will help you to find: math.stackexchange.com/questions/292468/… Aug 20, 2022 at 11:57

Continue with $$I= -2\int_{0}^{1}\frac{\arctan x\ln x}{1+x^{2}}\overset{x\to \frac1x}{dx}= \frac\pi2 \int_1^\infty \frac{\ln x}{1+x^2}dx -\int_0^\infty \frac{\arctan x\ln x}{1+x^2} dx$$ where $$\int_1^\infty \frac{\ln x}{1+x^2}dx=G$$ and \begin{align} \int_0^\infty \frac{\arctan x\ln x}{1+x^2}dx =& \int_0^\infty \int_0^1 \frac{x\ln x}{(1+x^2)(1+y^2x^2)} \overset{x\to \frac1{xy}}{dx}dy\\ = & \ \frac1{2}\int_0^1\int_0^\infty \frac{-x\ln y}{(1+x^2)(1+{y^2}x^2)} {dx}\ dy\\ =& \ \frac12\int_0^1\frac{\ln^2 y}{1-y^2}dy =\frac78\zeta(3) \end{align} Plug back into $$I$$ to ontain $$I= \frac\pi2G- \frac78\zeta(3)$$

• The expression after the substitution $x \to \frac{1}{x}$ is not correct. It's supposed to be $\pi\int_{1}^{\infty}\frac{\ln\left(x\right)}{1+x^{2}}dx-2\int_{1}^{\infty}\frac{\arctan\left(x\right)\ln\left(x\right)}{1+x^{2}}dx$. Aug 24, 2022 at 3:20
• @Accelerator - It is correct, after averaging with $-2\int_{0}^{1}\frac{\arctan x\ln x}{1+x^{2}}dx$. Aug 24, 2022 at 3:34
• My bad. Then how did you get the $0$ as the lower bound? Aug 24, 2022 at 3:42
• @Accelerator - $\int_0^1 +\int_1^\infty = \int_0^\infty$ Aug 24, 2022 at 4:02

If you are just interested in a method to evaluate it, no matter of how it could get complcated, my answer relies on Taylor Series, as someone suggested in the comments.

You could obtain beautiful representation of the Taylor series for $$\arctan^2(x)$$ with few tricks.

$$\arctan^2(x) = \sum_{n=1}^\infty x^{2n}\sum_{k=0}^{n-1} (-1)^k {1 \over {2k+1}} (-1)^{n-1-k} {1 \over {2(n-1-k)+1}}$$

Now we can manipulate a bit:

$$(-1)^{n-1} \sum_{k=0}^{n-1} {1 \over {2k+1}} \cdot {1 \over {2(n-1-k)+1}}$$

then $$(-1)^{n-1} \sum_{k=0}^{n-1} \left({1 \over {2k+1}} + {1 \over {2(n-1-k)+1}}\right) \cdot {1 \over {2n}}$$

using the fact that $${1 \over {2k+1}} \cdot {1 \over {2(n-1-k)+1}} = \left({1 \over {2k+1}} + {1 \over {2(n-1-k)+1}}\right) \cdot {1 \over {2n}}$$.

You'll find that the summation will meet every element of $$\{1, 1/3, 1/5, ..., 1/(2n-1)\}$$ twice. Thence

$$(-1)^{n-1} {1 \over {2n}} \cdot 2\sum_{k=0}^{n-1} {1 \over {2k+1}}$$

So finally,

$$\arctan^2x=\sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right) x^{2n}$$

We now use this fact into the integral, substituting this into the integral:

$$\int_0^1 \frac{1}{x}\sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right) x^{2n}\ \text{d}x = \sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right) x^{n}\text{d}x$$

Now we can swap the sums with the integrals because of the absolute convergence of the series

$$\sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right) \int_0^1x^{n}\ \text{d}x = \sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right) \frac{x^{n+1}}{n+1}\bigg|_0^1 = \sum_{n=1}^\infty \left((-1)^{n-1} {1 \over n} \cdot \sum_{k=0}^{n-1} {1 \over {2k+1}} \right)$$

With the help of W. Mathematica we can get the numerical result of this sum:

$$\frac{1}{8} \left(\pi ^2-4 \pi +8 \gamma \log (2)+8 \log (2)-4 \gamma \log (4)\right)$$

Warning

This does not match your result, actually. The numerical equivalent of my result gives

$$\approx 0.356051(...)$$

whilst

$$\int_0^1 \frac{\arctan^2(x)}{x}\ \text{d}x = \frac{1}{8} (4 \pi C-7 \zeta (3)) \approx 0.386996(...)$$

This is certainly due to the manipulation above.

Postface

I will keep reviewing my answer until I find some eventual error, or a better way to give, possibly, your result.

This was just some amusement.

• I notice that the equation beginning after: "Now we can swap the sums..." has: $$\color{red}{\sum_{n=1}^\infty(-1)^{n-1}\frac{1}{n}\cdot\sum_{k=0}^{n-1}\frac{1}{2k+1}}\int_0^1x^n\,\mathrm{d}x=\cdots=\color{red}{\sum_{n=1}^\infty(-1)^{n-1}\frac{1}{n}\cdot\sum_{k=0}^{n-1}\frac{1}{2k+1}}$$Which surely is a source of error Aug 21, 2022 at 9:18
• (+1) Thank you for typing out all this. If there's an error, which it seems like there is, I usually type each expression into Desmos and make my upper bound of a series/improper integral (like making $n = 500$) a huge number so that Desmos can approximate it really well. Aug 21, 2022 at 11:19

For the two integrals :

$$\int_{0}^{\frac{\pi}{4}}x\ln\left(\sin\left(x\right)\right)dx=-\frac{\pi^2 \ln(2)}{32}- \frac{ \pi}{8}G +\frac{35}{128}\zeta(3)$$ and

$$\int_{0}^{\frac{\pi}{4}}x\ln\left(\cos\left(x\right)\right)dx=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G-\frac{21}{128}\zeta(3)$$

You may use the expansions $$\ln\left(\cos(x)\right)=-\ln(2)+\sum_{k=1}^\infty \frac{(-1)^{k+1}\cos(2 k x)}{k}$$

$$\ln\left(\sin(x)\right)=-\ln(2)-\sum_{k=1}^\infty \frac{\cos(2 k x)}{k}$$

Then:

\begin{align*} K_1&=\int_0^{\pi/4}x \ln\left(\cos(x)\right)\,dx\\ &=-\ln(2)\int_0^{\pi/4}x\,dx+\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\int_0^{\pi/4}x \cos(2 k x)\,dx\\ &=-\frac{\pi^2 \ln(2)}{32}+\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\left( \frac{x \sin(2k x)}{2k}\Big|_0^{\pi/4}-\frac{1}{2k}\int_0^{\pi/4}\sin(2 k x)\,dx\right)\\ &=-\frac{\pi^2 \ln(2)}{32}+\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k}\left(\pi \frac{ \sin\left(\frac{k \pi}{2}\right)}{8k}+\frac{\cos\left(\frac{k \pi}{2}\right)}{4k^2}-\frac{1}{4k^2}\right)\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}\sum_{k=1}^\infty \frac{(-1)^{k+1}\sin\left(\frac{k \pi}{2}\right)}{k^2}+\frac{1}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}\cos \left(\frac{k \pi}{2}\right)}{k^3}-\frac{1}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}}{k^3}\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}\sum_{k=0}^\infty \frac{(-1)^{k}}{(2k+1)^2}+\frac{1}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}}{(2k)^3}-\frac{1}{4}\eta(3)\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G+\frac{1}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}}{(2k)^3}-\frac{1}{4}\eta(3)\\&=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G+\frac{1}{32}\eta(3)-\frac{1}{4}\eta(3)\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G+\frac{1}{4}\sum_{k=1}^\infty \frac{(-1)^{k+1}}{(2k)^3}-\frac{1}{4}\eta(3)\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G-\frac{7}{32}\eta(3)\\ &=-\frac{\pi^2 \ln(2)}{32}+ \frac{ \pi}{8}G-\frac{21}{128}\zeta(3) \end{align*}

\begin{align*} K_2&=\int_0^{\pi/4}x \ln\left(\sin(x)\right)\,dx \\ &=-\ln(2)\int_0^{\pi/4}x\,dx-\sum_{k=1}^\infty \frac{1}{k}\int_0^{\pi/4}x \cos(2 k x)\,dx\\ &=-\frac{\pi^2 \ln(2)}{32}-\sum_{k=1}^\infty \frac{1}{k}\left( \frac{x \sin(2k x)}{2k}\Big|_0^{\pi/4}-\frac{1}{2k}\int_0^{\pi/4}\sin(2 k x)\,dx\right)\\ &=-\frac{\pi^2 \ln(2)}{32}-\sum_{k=1}^\infty \frac{1}{k}\left(\pi \frac{ \sin\left(\frac{k \pi}{2}\right)}{8k}+\frac{\cos\left(\frac{k \pi}{2}\right)}{4k^2}-\frac{1}{4k^2}\right)\\ &=-\frac{\pi^2 \ln(2)}{32}- \frac{ \pi}{8}\sum_{k=1}^\infty \frac{\sin\left(\frac{k \pi}{2}\right)}{k^2}-\frac{1}{4}\sum_{k=1}^\infty \frac{\cos \left(\frac{k \pi}{2}\right)}{k^3}+\frac{1}{4}\sum_{k=1}^\infty \frac{1}{k^3}\\ &=-\frac{\pi^2 \ln(2)}{32}- \frac{ \pi}{8}G+\frac{1}{32}\eta(3)+\frac{1}{4}\zeta(3)\\ &=-\frac{\pi^2 \ln(2)}{32}- \frac{ \pi}{8}G +\frac{35}{128}\zeta(3) \end{align*}

• (+1) Thank you a lot for your patience in typing this. I will definitely reference this proof in the future. Aug 21, 2022 at 11:15

This is a super nice problem. I don't have a full solution but let me give you what I have first. First, let's observe that for $$x > 0$$: $$\arctan(x) + \arctan \left(\frac{1}{x} \right) = \frac{\pi}{2}$$ So, we have that: $$\int_{0}^{1} \frac{\arctan(x)^2}{x} \ dx = \frac{\pi}{2} \int_{0}^{1} \frac{\arctan(x)}{x} \ dx - \int_{0}^{1} \frac{\arctan(x)\arctan \left(\frac{1}{x} \right)}{x} \ dx$$

Now, let me deal with that first integral. For this, we use the power series expansion of $$\arctan$$: $$\arctan(x) = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n+1}}{2n+1}$$

So, now, we have that: $$\frac{\pi}{2} \int_{0}^{1} \frac{\arctan(x)}{x} \ dx = \frac{\pi}{2} \sum_{n=0}^{\infty} \int_{0}^{1} \frac{(-1)^n x^{2n}}{2n+1} \ dx = \frac{\pi}{2}\sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)^2} = \frac{\pi C}{2}$$

where $$C$$ is the Catalan constant. I have not yet tried to evaluate the second integral but I suspect that it actually leads us to where we would like to go.

• (+1) Awesome answer! To be honest, I tried evaluating that second integral too but I couldn't come up with anything. I put it into WolframAlpha out of curiosity and it gives us the result we want, which is nice. Aug 21, 2022 at 11:16
• Hmm I'm thinking that we could try to reduce that integral to one of the integrals that gives $\zeta(3)$ through some trickery but I don't quite have the time right now to give it a shot. Aug 21, 2022 at 12:00

$$I=2\int\frac{x^{2}}{\sin\left(2x\right)}dx=\frac 14\int\frac{t^{2}}{\sin\left(t\right)}dt$$ $$\frac{t^{2}}{\sin\left(t\right)}=\sum_{n=0}^\infty (-1)^n \frac{2^{2 n} B_{2 n}\left(\frac{1}{2}\right)}{(2 n)!} t^{2n+1}$$ $$I=\sum_{n=0}^\infty (-1)^n \frac{2^{2 n-3} B_{2 n}\left(\frac{1}{2}\right)}{(n+1) (2 n)!} t^{2 n+2}$$ Using $$t=\frac \pi 2$$ leads to the result.

Just for the fun

Using my favored $$1,400^+$$ years old approximation $$\sin(t) \simeq \frac{16 (\pi -t) x}{5 \pi ^2-4 (\pi -t) t}\qquad (0\leq t\leq\pi)$$ $$\frac 14\frac{t^{2}}{\sin\left(t\right)}\sim\frac 1 {64} \frac{t \left(5 \pi ^2-4 (\pi -t) t\right)}{\pi -t}$$ $$\frac 14\int\frac{t^{2}}{\sin\left(t\right)}dt\sim \frac{1}{64} \left(-\frac{4 t^3}{3}-5 \pi ^2 t-5 \pi ^3 \log (\pi -t)+\frac{19 \pi^3}{3}\right)$$ $$\frac 14\int_0^{\frac \pi 2}\frac{t^{2}}{\sin\left(t\right)}dt\sim \frac{1}{192} \pi ^3 \left(11-15 \log \left(\frac{\pi }{2}\right)\right)-\frac{1}{192} \pi ^3 (19-15 \log (\pi ))$$ $$I\sim\frac{\pi ^3}{192} (15 \log (2)-8)=0.387128$$ which is in a relative error of $$0.034$$%.

Using what I wrote here $$\sin(x)\sim\sum_{i=1}^3 a_i \big(\pi-x)x\big)^i$$ again an explicit result which, evaluated is $$0.38699551$$ (almost exact).

Letting $$y=arctan x$$, then
$$I=\int_{0}^{\frac{\pi}{4}} \frac{y^{2}}{\tan y} \sec ^{2} y d y= \int_{0}^{\frac{\pi}{4}} \frac{y^{2}}{\cos y \sin y} d y \stackrel{t=2y}{=} \frac{1}{4} \int_{0}^{\frac{\pi}{2}} \frac{t^{2}}{\sin t} d t$$
By the my post, $$\int_{0}^{\frac{\pi}{2}} \frac{x^{2}}{\sin x} d x =2 \pi G-\frac{1}{2} \zeta(3)$$
Hence $$\boxed{I=\frac{\pi G}{2}-\frac{7}{8} \zeta(3)}$$