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.
 A: 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)$$
A: 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.
A: 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.
A: $$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).
A: 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)}
$$
