# Taylor Series Extpansion 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

• You could do using long division. Otherwise, as usual. – Claude Leibovici Dec 5 '14 at 11:46

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.

• What does $O$ stand for? – TheLast Cipher Oct 24 '18 at 9:12
• @TheLastCipher: See "Big O notation". For example $\;f(x)=O\left(x^2\right)\;$ means that there exist $M$ and $x_0$ in $\mathbb{R}$ such that $\;|f(x)| \le \; M x^2\;$ for $x\ge x_0$ (it is not really important here and this answer would probably be clearer without it!). – Raymond Manzoni Oct 24 '18 at 21:37

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).$$

• (+1) Nice solution but I cannot follow each step as it seems some parts are summarized. Where the first identity come from? Also, what does the bracket $[]$ mean here (4th equation)? and also how the function $\zeta$ appeared? – H. R. Jun 26 '17 at 9:38
• @H.R.: the first identity is Weierstrass product, $[z^k]\,f(z)$ stands for the coefficient of $z^k$ in the Laurent series of $f(z)$ around the origin and $\zeta$ comes from $\sum_{n\geq 0}\frac{1}{(2n+1)^{2k+2}}$. – Jack D'Aurizio Jun 26 '17 at 10:08
• I think that would be nice to mention these in the answer. :) Would you please take look at this post which indeed lead me here. – H. R. Jun 26 '17 at 10:28
• You are an excellent mathematician, but by reworking the calculations here, I saw that you omitted many passages. – Mathsource Aug 5 '18 at 20:08

\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 $$B_m(n) = \sum_{k=0}^m\sum_{v=0}^k(-1)^v\binom kv\frac{\left( n+v\right) ^m}{k+1}$$

• Yes but where does the Bernoulli number come from, why is it here? – user2250537 Dec 5 '14 at 11:58
• See next comment – Autolatry Dec 5 '14 at 12:01
• (+1) Can you explain the derivation of the formula? :) – H. R. Jun 26 '17 at 9:41

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.)

• Hi I am a high school student in 12th grade, I probably should have mentioned this, is there anyway you could simplify your explanation, for example I am unsure what a difference operator is, do you mind explaining? – user2250537 Dec 5 '14 at 12:08