# Taylor Series of $\tan x$

I found a nice general formula for the Taylor series of $\tan x$:

$$\tan x = \sum_{n\,=\,1}^\infty \frac {(-1)^{n-1}2^{2n} (2^{2n}-1) B_{2n}} {(2n)!} x^{2n - 1}$$

where $B_n$ are the Bernoulli numbers and $|x| < \dfrac {\pi} 2$.

I've tried Googling for a proof but didn't find anything. Hints would be appreciated too.

I am using the typical definition of the Bernoulli numbers:

$$\frac x {e^x - 1} = \sum_{n\,=\,0}^\infty \frac {B_n x^n} {n!}$$

The only non zero $B_n$ with odd index is $B_1=-1/2$, So $$\sum_{n=0}^\infty\frac{B_{2n}}{(2n)!}x^{2n}=x\left(\frac{1}{e^x-1}+\frac{1}{2}\right) =\frac{x}{2}\coth\left(\frac{x}{2}\right)$$ which is valid for $|x|<2\pi$. Applying this with $x=it$, we get for $|t|<2\pi$: $$\sum_{n=0}^\infty\frac{(-1)^nB_{2n}}{(2n)!}t^{2n}= \frac{t}{2}\cot\left(\frac{t}{2}\right)$$ Now note that $$\cot(t)-2\cot(2t)=\frac{1-\cos^2t }{\sin t\cos t}=\tan t$$ so, for $|t|<\dfrac{\pi}{2}$ we have \eqalign{ t\tan t&=t\cot(t)-2t\cot(2t)\cr &=\sum_{n=0}^\infty\frac{(-1)^nB_{2n}2^{2n}}{(2n)!}t^{2n} -\sum_{n=0}^\infty\frac{(-1)^nB_{2n}4^{2n}}{(2n)!}t^{2n}\cr &=\sum_{n=1}^\infty\frac{(-1)^nB_{2n}2^{2n}(1-2^{2n})}{(2n)!}t^{2n}\cr &=t\sum_{n=1}^\infty\frac{(-1)^{n-1}B_{2n}2^{2n}(2^{2n}-1)}{(2n)!}t^{2n-1} } From this the desired expansion follows.$\qquad\square$.
$$\frac z{e^z-1}+\frac z 2=1+\sum_{n=2}^\infty\frac{B_n}{n!}z^n$$ Replace $z$ with $2iz$ to get $$\color{red}{z\cot(z)}=\frac{iz(e^{iz}+e^{-iz})}{e^{iz}-e^{-iz}}=1+\sum_{n=2}^\infty\frac{B_n}{n!}(2iz)^n=1+\sum_{n=1}^\infty\frac{B_{2n}}{(2n)!}(-1)^n(2z)^{2n}$$ Now use following trigonometric formula $$\tan(z)=\cot(z)-2\cot(2z).$$