Taylor Series Expansion of $\tanh x$ I know how to find the Taylor expansion of both $\sinh x$ and $\cosh x$, but how would you find the Taylor expansion of $\tanh x$. It seems you can't just divide both the Taylor series of $\sinh x$ and $\cosh x$ so how would you do it?
Any suggestions? I saw it contains the Bernoulli series, what is that exactly?
Kind Regards
 A: You may too use the method I used here for the expansion of $\tan$ :
Integrate repetitively $\ \tanh'(x)=1-\tanh(x)^2\ $ starting with $\,\tanh(x)\approx x$ :
\begin{align}
\tanh(x)&\small{=}\ x+O\bigl(x^2\bigr)\\
&\small{=\int 1-\left(x+O\bigl(x^2\bigr)\right)^2\,dx}=x-\frac {x^3}3+O\bigl(x^4\bigr)\\
&\small{=\int 1-\left(x-\frac {x^3}3+O\bigl(x^4\bigr)\right)^2dx=\int 1-x^2+\frac {2x^4}3\,dx-O\bigl(x^6\bigr)}=x-\frac {x^3}3+\frac {2x^5}{15}-O\bigl(x^6\bigr)\\
&= \cdots\\
\end{align}
Every integration gives another coefficient of $\ \displaystyle\tanh(x)=\sum_{n\ge 0} a_n\ (-1)^n\,x^{2n+1}\ $ and we get simply :
$$a_0=1,\; a_{n+1}=\frac 1{2n+3} \sum_{k=0}^n a_k\ a_{n-k},\ \text{for}\;n>0$$
i.e. the sequence (with alternating signs for $\tanh$) : $$(a_n)_{n\in\mathbb{N}}=\left(\frac 11,\frac 13, \frac 2{15}, \frac {17}{315}, \frac {62}{2835}, \frac{1382}{155925},\cdots\right)$$
We may probably deduce the recurrence relation of Bernoulli numbers in function of this one (or vice et versa) but I didn't try that yet.
A: \begin{eqnarray}
\tanh x &=& x - \frac {x^3} {3} + \frac {2x^5} {15} - \frac {17x^7} {315} + \cdots = \sum_{n=1}^\infty \frac{2^{2n}(2^{2n}-1)B_{2n} x^{2n-1}}{(2n)!}, \left |x \right | < \frac {\pi} {2} \\
\end{eqnarray}
Where $B_{m}$ is the $m$-th Bernoulli number defined as
\begin{equation}
B_m(n) = \sum_{k=0}^m\sum_{v=0}^k(-1)^v\binom kv\frac{\left( n+v\right) ^m}{k+1}
\end{equation}
A: An easy way to compute the coefficients of the Taylor series of $\tanh$ is to consider that:
$$\cosh(z)=\prod_{n=0}^{+\infty}\left(1+\frac{4z^2}{(2n+1)^2 \pi^2}\right)$$
hence:
$$ \log\cosh z = \sum_{n=0}^{+\infty}\log\left(1+\frac{4z^2}{(2n+1)^2 \pi^2}\right)$$
and by differentiating:
$$ \tanh z = 2z\sum_{n=0}^{+\infty}\frac{\frac{4}{(2n+1)^2 \pi^2}}{1+\frac{4z^2}{(2n+1)^2 \pi^2}}$$
so:
$$ [z^{2k+1}]\tanh z = 2\frac{(-1)^k}{\pi^{2k+2}}\sum_{n=0}^{+\infty}\frac{1}{(n+1/2)^{2k+2}}=2\frac{(-2)^k}{\pi^{2k+2}}\sum_{n=0}^{+\infty}\frac{1}{(2n+1)^{2k+2}}$$
giving:

$$ [z^{2k+1}]\tanh z = 2\frac{(-1)^k}{\pi^{2k+2}}\left(1-\frac{1}{4^{k+1}}\right)\zeta(2k+2).$$

A: I don't know of a universal theory of all places where Bernoulli numbers arise, but Euler-Maclaurin summation explains many of their more down-to-earth occurrences.
The heuristic explanation (due to Lagrange) is as follows.  The first difference operator defined by $\Delta f(n) = f(n+1)-f(n)$ and summation are inverses, in the same sense in which differentiation and integration are inverses.  This just amounts to a telescoping series: $\sum_{a \le i < b} \Delta f(i) = f(b) - f(a)$.
Now by Taylor's theorem, $f(n+1) = \sum_{k \ge 0} f^{(k)}(n)/k!$ (under suitable hypotheses, of course).  If we let $D$ denote the differentation operator defined by $Df = f'$, and $S$ denote the shift operator defined by $Sf(n) = f(n+1)$, then Taylor's theorem tells us that $S = e^D$.  Thus, because $\Delta = S-1$, we have $\Delta = e^D - 1$.
Now summing amounts to inverting $\Delta$, or equivalently applying $(e^D-1)^{-1}$.  If we expand this in terms of powers of $D$, the coefficients are Bernoulli numbers (divided by factorials).  Because of the singularity at "$D=0$", the initial term involves antidifferentiation $D^{-1}$, i.e., integration.  Thus, we have expanded a sum as an integral plus correction terms involving higher derivatives, with Bernoulli number coefficients.
Specifically,
$$
\sum_{a \le i < b} f(i) = \int_a^b f(x) \, dx + \sum_{k \ge 1} \frac{B_k}{k!} (f^{(k-1)}(b) - f^{(k-1)}(a)).
$$
(Subtracting the values at $b$ and $a$ just amounts to the analogue of turning an indefinite integral into a definite integral.)
