[Math] How to derive the Maclaurin series for $\tanh(x)$

hyperbolic-functionstaylor expansion

I've thought of doing it by writing $\tanh(x)$ as $(1-e^{-2x})/(1+e^{-2x})$ and then using the Maclaurin series for $e^{x}$ or just as $\sinh(x)/\cosh(x)$ and using the Maclaurin series for $\sinh(x)$ and $\cosh(x)$ but I don't get the same results. I can do it by evaluating the derivatives but I'm not sure if that's the most efficient way, which is what I need.
$$
\tanh(x)=\frac {\sinh(x)} {\cosh(x)}=\frac {1-e^{-2x}} {1+e^{-2x}}
$$
I get:
$$
\tanh(x)=\frac {\sinh(x)} {\cosh(x)}=\frac {x+\frac {x^3} {3!}+\frac {x^5} {5!}+\dots} {1+\frac {x^2} {2!}+\frac {x^4} {4!}+\dots}
$$
and
$$
\tanh(x)=\frac{1-e^{-2x}} {1+e^{-2x}}=\frac{1-(1-2x+\frac{4x^2}{2!}+\dots)} {1+(1-2x+\frac{4x^2}{2!}+\dots)}=\dots
$$
which don't look the same to me.

Best Answer

Keep in mind that $$\frac{d}{dx}\tanh x=1-\tanh^2 x$$ and $$f(x)=\sum_{i=0}^\infty \frac{f^{(i)}(a)}{i!}(x-a)^i$$ is the Taylor series where we CAN have in some series $a=0$. With some wowrk you get $$\tanh x=\sum_{i=1}^\infty \frac{B_{2i}4^i(4^i-1)}{(2i)!}x^{2i-1}$$ Where $B_j$ is the Bernoulli numbers