Taylor series coefficients This question arose in connection with A hard integral identity on MATH.SE.
Let
$$f(x)=\arctan{\left (\frac{S(x)}{\pi+S(x)}\right)}$$
with $S(x)=\operatorname{arctanh} x -\arctan x$, and let
$$f(x)=\sum_{n=0}^\infty a_nx^n=\frac{2}{3\pi}x^3-\frac{4}{9\pi^2}x^6+\frac{2}{7\pi}x^7+\frac{16}{81\pi^3}x^9-\frac{8}{21\pi^2}x^{10}+\ldots$$
be its Taylor series expansion at $x=0$. Some numerical evidence suggests the following interesting properties of the $a_n$ coefficients ($b_n$, $c_n$, $d_n$, $\tilde{c}_n$, $\tilde{d}_n$ are some positive rational numbers, $k>0$ is an integer):
1) $a_n=0$, for $n=4k$.
2) $a_n=\frac{2/n}{\pi}-\frac{b_n}{\pi^5}+(\text{maybe other terms of higher order in} 1/\pi)$, for $n=4k+3$.
3) $a_n=-\frac{c_n}{\pi^2}+\frac{d_n}{\pi^6}+(\text{maybe other terms of higher order in} 1/\pi)$, for $n=4k+2$.
4) $a_n=\frac{\tilde{c}_n}{\pi^3}-\frac{\tilde{d}_n}{\pi^7}+(\text{maybe other terms of higher order in } 1/\pi)$, for $n=4k+1$, $k>1$.
How can these properties (if correct) be proved?
P.S. We have
$$\arctan{\left(1+\frac{2S}{\pi}\right)}-\frac{\pi}{4}=\arctan{\left(\frac{1+2S/\pi-1}{1+(1+2S/\pi)}\right)}=\arctan{\left(\frac{S}{\pi+S}\right)} .$$
Using
$$\arctan(1+x)=\frac{\pi}{4}+\frac{1}{2}x-\frac{1}{4}x^2+\frac{1}{12}x^3-\frac{1}{40}x^5+\frac{1}{48}x^6-\frac{1}{112}x^7+\ldots$$
we get
$$\arctan{\left(\frac{S}{\pi+S}\right)}=\frac{S}{\pi}-\frac{S^2}{\pi^2}+\frac{2S^3}{3\pi^3}-\frac{4S^5}{5\pi^5}+\frac{4S^6}{3\pi^6}-\frac{8S^7}{7\pi^7}+\ldots$$
This proves 2), 3) and 4), because
$$S=2\left(\frac{x^3}{3}+\frac{x^7}{7}+\frac{x^{11}}{11}+\ldots\right)=2\sum_{k=0}^\infty \frac{x^{4k+3}}{4k+3} .$$
To prove 1), we need to prove the analogous property for $\arctan(1+x)$ and the proof can be based on the formula 
$$\frac{d^n}{dx^n}(\arctan x)=\frac{(-1)^{n-1}(n-1)!}{(1+x^2)^{n/2}}\sin{\left (n\,\arcsin{\left(\frac{1}{\sqrt{1+x^2}}\right)}\right )}$$
proved in K. Adegoke and O. Layeni, The Higher Derivatives Of The Inverse Tangent Function and Rapidly Convergent BBP-Type Formulas For Pi, Applied Mathematics E-Notes, 10(2010), 70-75, available at http://www.math.nthu.edu.tw/~amen/2010/090408-2.pdf. This formula enables us to get a closed-form expression
$$\arctan{\left(\frac{S}{\pi+S}\right)}=\sum_{n=1}^\infty \frac{(-1)^{n-1}}{n}\,2^{n/2}\,\sin{\left(\frac{n\pi}{4}\right)}\,\frac{S^n}{\pi^n} .$$
So the initial questions are not actual now. However I'm still interested to know whether one can calculate in a closed-form the integral $$\int\limits_0^1 S^n(x)\frac{dx}{x} .$$
 A: $\newcommand{\Catalan}{\operatorname{Catalan}}$
I made an attempt for $\int_0^1 S^2\;dx/x$, but with limited success.  
Let
$$
q_1 := \frac{1}{16}\left(
\ln  \left( 1-i \right) {\pi }^{2}+16\,\zeta  \left( 3 \right) -4\,i
\ln  \left( 1+i \right) \pi \,\ln  \left( 2 \right) +i{\pi }^{3}+4\,i
\ln  \left( 1-i \right) \pi \,\ln  \left( 2 \right) \\
-2\,\ln  \left( 1+
i \right) {\pi }^{2}-4\,i \left( \ln  \left( 1-i \right)  \right) ^{2}
\pi -16\,i\ln  \left( 1+i \right) {\it \Catalan}+10\,i \left( \ln 
 \left( 2 \right)  \right) ^{2}\pi 
\\
+8\,\pi \,{\it \Catalan}-2\,{\pi }^{2}\ln  \left( 2 \right) +{\pi }^{2}\ln  \left( i\sqrt {2}+\sqrt {2}+2 \right) +{\pi }^{2}\ln  \left( 2-\sqrt {2}-i\sqrt {2} \right)
\\
 +20\,\ln  \left( 2 \right) {\rm Li}_2 \left(2 \right) -20\,{\rm Li}_3 \left(2 \right) -8\,{\rm Li}_3 \left(-i \right) -8\,
{\rm Li}_3 \left(i \right) +16\,i\ln  \left( 1-i \right) {\it 
\Catalan}
\\
+4\,i \left( \ln  \left( 1+i \right)  \right) ^{2}\pi -2\,{
\pi }^{3}\right) \approx −0.4990969
$$
and
$$
q_2 := 
\sum _{m=1}^{\infty }{\frac {\Psi \left( (m+1)/2\right) -\Psi
 \left(m/2 \right) }{ 2\left( 2\,m-1 \right) ^{2}}} \approx 0.7416483,
$$
Then
$$
\int_0^1({\rm arctanh}\; x - \arctan x)^2\frac{dx}{x} = q_1+q_2 \approx 0.2425514
$$  
added 
Combining the above with Eckhard's alternate version, we get the interesting equation
$$
q_2 =
\frac{\left( 
\ln  \left( 2 \right)  \right) ^{2}\pi}{16} +{\frac {5}{64}}\,{\pi }^{3}
  -{ \Catalan}\,\ln  \left( 2 \right)
-2
\,{\rm Im} \; {\rm Li_3} \left( \frac{1+i}{2} \right)
$$
A: Here is a possible approach toward proving (1). Let $i=\sqrt{-1}$. Let $g(x)=f(x) +f(ix) +f(-x)+f(-ix)$. We need to
show that $g(x)=0$. Unfortunately, Maple is unable to do this directly. Thus write each
$\arctan u$ as $\frac i2\log\frac{1-iu}{1+iu}$ and $\mathrm{arctanh}\,u$ as $\frac 12\log\frac{1+u}{1-u}$
and simplify. Every time you see a $\log \frac ab$, replace with $\log a-\log b$. Perhaps the
16 terms will cancel out in pairs. I could not get Maple to do this. You also might need to replace
expressions like $\log(-i(1-x))$ with $\log(-i)+\log(1-x)$. Perhaps Mathematica will be smarter than Maple in
showing $g(x)=0$.
A: Here is a simple dérivation of the Taylor expansion of $~\arctan(\frac{x}{1+x})~:$
Since $$~\arctan(u)=\dfrac{i}{2}\ln\big(\dfrac{1-iu}{1+iu}\big),~~\arctan(\frac{x}{1+x})=\dfrac{i}{2}\ln\Big(\dfrac{1-i\frac{x}{1+x}}{1+i\frac{x}{1+x}}\Big)$$
$$=
\dfrac{i}{2}\ln\Big(\dfrac{1+(1-i)x}{1+(1+i)x}\Big)=\dfrac{i}{2}\ln\Big(\dfrac{1+\sqrt{2}\exp(-i\frac{\pi}{4}) x}{1+\sqrt{2}\exp(i\frac{\pi}{4})x}\Big).~$$
So, for $~|x|<\frac{1}{\sqrt{2}},$
$$\arctan(\frac{x}{1+x})=\dfrac{i}{2}\sum\limits_{n=1}^{\infty}\frac{(-1)^{n-1}2^{n/2}}{n}(e^{-in\frac{\pi}{4}}
-e^{in\frac{\pi}{4}})x^n$$
$$=\sum\limits_{n=1}^{\infty}\frac{(-1)^{n-1}2^{n/2}}{n}\sin(n\frac{\pi}{4})x^n,$$
and, for $~|w|<\frac{\pi}{\sqrt{2}},$
$$(1)~~~~~~\arctan(\frac{w}{\pi+w})=\sum\limits_{n=1}^{\infty}\frac{(-1)^{n-1}2^{n/2}}{n}\sin(n\frac{\pi}{4})(\frac{w}{\pi})^n.$$
But I'm a bit worried about the following detail : if $$~S(x)=2\sum\limits_{n=0}^{\infty}\dfrac{x^{4n+3}}{4n+3},
~~~~~~~~~~~~\lim\limits_{x\rightarrow1^{-}}S(x)=+\infty,~$$
 so it seems a bit dangerous to substitute $~S(x)~$ for $~w~$ into $~(1)~$ (since this series diverges for $~|w|>\frac{\pi}{\sqrt{2}})$ (and even more dangerous to interchange summation and integral...)
Am I wrong ?
