How would I use the Taylor series to show the following?
$$\frac{h}{2}\cdot\frac{e^h+1}{e^h-1}\approx1+\frac{h^2}{12}+\cdots$$
How would I use the Taylor series to show the following?
$$\frac{h}{2}\cdot\frac{e^h+1}{e^h-1}\approx1+\frac{h^2}{12}+\cdots$$
On
$$\frac{h}{2} \left( \frac{e^h+1}{e^h-1} \right) = \frac{h}{2} \, \coth \left( \frac{h}{2} \right) = 1 + \frac{h^2}{12} - \frac{h^4}{720} + \cdots$$
where the Maclaurin expansion for the hyperbolic cotangent was used. Using SymPy instead:
>>> from sympy import *
>>> h = Symbol('h')
>>> f = (h/2) * coth(h/2)
The 4th order expansion is
>>> f.series(h,0,5)
2 4
h h / 5\
1 + -- - --- + O\h /
12 720
The 12th order expansion is
>>> f.series(h,0,13)
2 4 6 8 10 12
h h h h h 691*h / 13\
1 + -- - --- + ----- - ------- + -------- - ------------- + O\h /
12 720 30240 1209600 47900160 1307674368000
$$\dfrac{h}{2}\dfrac{e^h+1}{e^h-1}=\dfrac{h}{2}\dfrac{2+h+\dfrac{h^2}{2!}+\cdots}{h+\dfrac{h^2}{2!}+\cdots}\approx\dfrac{h}{2}\Big[\dfrac{2}{h}+\dfrac{h}{6}+\cdots\Big]\approx 1+\dfrac{h^2}{12}+\cdots$$