Power series of tan(x), cot(x), csc(x)

Here’s a little how-to on figuring out the power series of tan(x), cot(x) and csc(x).

Start with the generating function for the Bernoulli numbers:

\displaystyle \sum_{k=0}^{\infty} B_k \frac{t^k}{k!} = \frac{t}{e^t-1}

Take only the even powers of t on the LHS:

\displaystyle \sum_{k=0}^{\infty} B_k \frac{t^k}{k!} + \sum_{k=0}^{\infty} B_k \frac{(-t)^k}{k!} = \frac{t}{e^t-1} - \frac{t}{e^{-t}-1}

\displaystyle 2 \sum_{k=0}^{\infty} B_{2k} \frac{t^{2k}}{(2k)!} = \frac{t\left(e^{-t}-e^t\right)}{\left(e^t-1\right)\left(e^{-t}-1\right)}

\displaystyle = \frac{t\left(e^{-\frac{1}{2} t}+e^{\frac{1}{2} t}\right)\left(e^{-\frac{1}{2} t}-e^{\frac{1}{2} t}\right)}{e^{\frac{1}{2} t}\left(e^{\frac{1}{2} t}-e^{-\frac{1}{2} t}\right)e^{-\frac{1}{2} t}\left(e^{-\frac{1}{2} t}-e^{\frac{1}{2} t}\right)}

\displaystyle = \frac{t\left(e^{\frac{1}{2} t}+e^{-\frac{1}{2} t}\right)}{e^{\frac{1}{2} t}-e^{-\frac{1}{2} t}}

Put t=2ix:

\displaystyle 2 \sum_{k=0}^{\infty} B_{2k} \frac{(2ix)^{2k}}{(2k)!} = \frac{2ix\left(e^{ix}+e^{-ix}\right)}{e^{ix}-e^{-ix}}

\displaystyle \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k x^{2k-1}}{(2k)!} = \frac{i\left(e^{ix}+e^{-ix}\right)}{e^{ix}-e^{-ix}}

Recall that \sin x = \frac{e^{ix}-e^{-ix}}{2i} and \cos x = \frac{e^{ix}+e^{-ix}}{2}:

\displaystyle \frac{\cos x}{\sin x} = \cot x = \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k x^{2k-1}}{(2k)!}

That was pretty easy. How about tan and csc?

Consider

\displaystyle \cot x - 2\cot 2x = \cot x - \frac{\cot^2 x - 1}{\cot x}

\displaystyle = \frac{1}{\cot x}

\displaystyle = \tan x

\displaystyle \tan x = \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k x^{2k-1}}{(2k)!} - 2\sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k 2^{2k-1} x^{2k-1}}{(2k)!}

\displaystyle \tan x = \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k (1-4^k) x^{2k-1}}{(2k)!}

And finally,

\displaystyle \cot x - \cot 2x = \cot x - \frac{\cot^2 x - 1}{2\cot x}

\displaystyle = \frac{\csc^2 x}{2\cot x}

\displaystyle = \frac{1}{2 \sin x \cos x}

\displaystyle = \csc 2x

\displaystyle \csc x = \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k x^{2k-1}}{2^{2k-1} (2k)!} - \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k 4^k x^{2k-1}}{(2k)!}

\displaystyle \csc x = \sum_{k=0}^{\infty} B_{2k} \frac{(-1)^k (2-4^k) x^{2k-1}}{(2k)!}

Advertisement

2 Responses to Power series of tan(x), cot(x), csc(x)

  1. fyyre says:

    More code, less math.

  2. drac says:

    Thanks, Nice little piece =)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.