Theorem: Power Series Expansion for Cotangent Function

The (real) cotangent function has a Taylor series expansion:
{{begin-eqn}}
{{eqn | l = \cot x
      | r = \sum_{n \mathop = 0}^\infty \frac {\paren {-1}^n 2^{2 n} B_{2 n} \, x^{2 n - 1} } {\paren {2 n}!}
      | c = 
}}
{{eqn | r = \frac 1 x - \frac x 3 - \frac {x^3} {45} - \frac {2 x^5} {945} + \frac {x^7} {4725} - \cdots
      | c = 
}}
{{end-eqn}}
where $B_{2 n}$ denotes the Bernoulli numbers.
This converges for $0 < \size x < \pi$.

Proof:
{{begin-eqn}}
{{eqn | l = \cot x
      | r = i \frac {e^{i x} + e^{- i x} } {e^{i x} - e^{- i x} }
      | c = Euler's Cotangent Identity
}}
{{eqn | r = i \frac {e^{2 i x} + 1 } {e^{2 i x} - 1 }
      | c = multiplying top and bottom by $e^{ix}$
}}
{{eqn | r = i \paren {\frac {e^{2 i x} - 1 + 2 } {e^{2 i x} - 1} }
      | c =
}}
{{eqn | r = i \paren {1 + \frac 2 {e^{2 i x} - 1} }
      | c =
}}
{{eqn | r = i + \frac {2 i} {e^{2 i x} - 1}
      | c =
}}
{{eqn | r = i + \frac 1 x \frac {2 i x} {e^{2 i x} - 1}
      | c = multiplying top and bottom by $x$
}}
{{eqn | r = i + \frac 1 x \sum_{n \mathop = 0}^\infty \frac {B_n \paren {2 i x}^n} {n!}
      | c = {{Defof|Bernoulli Numbers}}
}}
{{eqn | r = i + \frac 1 x \paren { 1 + \frac {-\dfrac 1 2 \paren {2 i x} } {1!} + \sum_{n \mathop = 2}^\infty \frac {B_n \paren {2 i x}^n} {n!} }
      | c = as $B_0 = 1$ and $B_1 = -\dfrac 1 2$
}}
{{eqn | r = \frac 1 x + \frac 1 x \sum_{n \mathop = 2}^\infty \frac {B_n \paren {2 i x}^n} {n!}
      | c = 
}}
{{eqn | r = \frac 1 x + \frac 1 x \sum_{n \mathop = 1}^\infty \frac {B_{2 n} \paren {2 i x}^{2 n} } {\paren {2 n}!}
      | c = Odd Bernoulli Numbers Vanish
}}
{{eqn | r = \frac 1 x \sum_{n \mathop = 0}^\infty \frac {B_{2 n} \paren {2 i x}^{2 n} } {\paren {2 n}!}
      | c = as $B_0 = 1$
}}
{{eqn | r = \frac 1 x \sum_{n \mathop = 0}^\infty \frac {\paren {-1}^n 2^{2 n} B_{2 n} \, x^{2 n}  } {\paren {2 n}!}
      | c = $i^2 = -1$
}}
{{eqn | r = \sum_{n \mathop = 0}^\infty \frac {\paren {-1}^n 2^{2 n} B_{2 n} \, x^{2 n - 1} } {\paren {2 n}!}
      | c = Moving $\dfrac 1 x $ inside the sum
}}
{{end-eqn}}
By Combination Theorem for Limits of Real Functions we can deduce the following.
{{begin-eqn}}
{{eqn | o = 
      | r = \lim_{n \mathop \to \infty} \size {\frac {\frac {\paren {-1}^n 2^{2 n + 2} B_{2 n + 2} \, x^{2 n + 1} } {\paren {2 n + 2}!} } {\frac {\paren {-1}^{n - 1} 2^{2 n} B_{2 n} \, x^{2 n - 1} } {\paren {2 n}!} } }
      | c =
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size {\frac 1 {\paren {2 n + 1} \paren {2 n + 2} } \frac {B_{2 n + 2} } {B_{2 n} } } 4 x^2
      | c =
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size {\frac 1 {\paren {2 n + 1} \paren {n + 1} } \frac {B_{2 n + 2} } {B_{2 n} } } 2 x^2
      | c =
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size{\frac 1 {\paren {2 n + 1} \paren {n + 1} } \frac {\paren {-1}^{n + 2} 4 \sqrt {\pi (n + 1)} \paren {\frac {n + 1} {\pi e} }^{2 n + 2} } {\paren {-1}^{n + 1} 4 \sqrt {\pi n} \paren {\frac n {\pi e} }^{2 n} } } 2 x^2
      | c = Asymptotic Formula for Bernoulli Numbers
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size {\frac {\paren {n + 1}^2} {\paren {2 n + 1} \paren {n + 1} } \sqrt {\frac {n + 1} n } \paren {\frac {n + 1} n}^{2 n} } \frac 2 {\pi^2 e^2} x^2
      | c =
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size {\paren {\frac {n + 1} n}^{2 n} } \frac {x^2} {\pi^2 e^2}
      | c =
}}
{{eqn | r = \lim_{n \mathop \to \infty} \size {\paren {\paren {1 + \frac 1 n}^n}^2} \frac {x^2} {\pi^2 e^2}
      | c =
}}
{{eqn | r = \frac {e^2 x^2} {\pi^2 e^2}
      | c = {{Defof|Euler's Number as Limit of Sequence}}
}}
{{eqn | r = \frac {x^2} {\pi^2} 
      | c =
}}
{{end-eqn}}
This is less than $1$ {{iff}}:
:$\size x < \pi$
Hence by the Ratio Test, the series converges for $\size x < \pi$.
{{qed}}