What did i do wrong with this derivation? $$
\cos(x) = \sum_{n=0}^\infty \frac{(-1)^n x^{2n}}{(2n)!}
$$
Therefore
\begin{align}
\frac{1}{\cos(x)} &= \frac{1}{1-(\frac{x^2}{2} - \frac{x^4}{4!} + \frac{x^6}{6!} - \cdots)}
\\
&= \sum_{n=0}^\infty (\frac{x^2}{2} - \frac{x^4}{4!} + \frac{x^6}{6!} - \cdots)^n
\\
&= \sum_{n=0}^\infty (1-\cos(x))^n
\end{align}
This part i am okay with, but now i will attempt to find a power series of $\tan(x)$ in terms of $\cos(x)$ with the following reasoning:
I realised that by differentiating The secant function i would get $\sec(x) \tan(x)$ and by differentiating the series would also yield a $\sin(x)$, therefore i would end up with $\sec^2(x)$ (which is the derivative of $\tan(x)$) therefore by integration i would find myself a power series for $\tan(x)$ in terms of $\cos(x)$ I will do as i explained below:
$$
\frac{d}{dx}[\sec(x)] = \sum_{n=0}^\infty \frac{d}{dx}(1-\cos(x))^n
$$
$$
\frac{\sin(x)}{\cos^2(x)} = \sin(x) \sum_{n=0}^\infty (n+1) (1-\cos(x))^n
$$
$$
\frac{1}{\cos^2(x)} = \sum_{n=0}^\infty (n+1) (1-\cos(x))^n
$$
Now to redefine $(1-\cos(x))^n$ by using the following identity:
$$
(1+x)^{\alpha} = \sum_{k=0}^\alpha {\alpha \choose k} x^k
$$
Therefore:
$$
(1-\cos(x))^n = \sum_{k=0}^n {n \choose k}(-\cos(x))^k
$$
Now this is where i run into some doubt:
$$
\sec^2(x) = \sum_{n=0}^\infty (n+1) \sum_{k=0}^n {n \choose k}(-\cos(x))^k
$$
Since the following is true for ordinary power series:
$$
fg \longleftrightarrow \left\{\sum_k a_k b_{n-k} \right\}
$$
Therefore by setting $a_k = \frac{(-\cos(x))^k}{k!}$ and $b_{n-k} = \frac{1}{(n-k)!}$
$$
\sum_{n=0}^\infty (n+1) \sum_{k=0}^n {n \choose k}(-\cos(x))^k = \sum_{n=0}^\infty (n+1)! e^{1-\cos(x)}
$$
This is clearly wrong obviously as the series does not converge... What was my error?
 A: $\sum_{n=0}^\infty (n+1) \sum_{k=0}^n {n \choose k}(-\cos(x))^k = \sum_{n=0}^\infty (n+1)! e^{1-\cos(x)}
$
The problem is that,
in your series,
only one of the terms
has the $x^n$.
Here is a more detailed examination
of what happens:
Let
$u = \cos(x)
$.
We have
$\frac1{u}
=\frac1{1-(1-u)}
=\sum_{n=0}^{\infty} (1-u)^n
$.
Differentiating term-by-term,
and then using the binomial theorem,
$$\begin{align}
\frac{-1}{u^2}
&=\sum_{n=1}^{\infty} (-n)(1-u)^{n-1}\\
&=-\sum_{n=0}^{\infty} (n+1)(1-u)^{n}\\
&=-\sum_{n=0}^{\infty} (n+1)\sum_{k=0}^n\binom{n}{k}(-1)^ku^k
\text{  ( you need }u^n \text{ as well as } u^k)\\
&=-\sum_{k=0}^{\infty} \sum_{n=k}^{\infty} (n+1)(\frac{n!}{k!(n-k)!})(-1)^ku^k
\text{ (here is the problem)}\\
&=-\sum_{k=0}^{\infty} \frac{(-1)^ku^k}{k!}\sum_{n=k}^{\infty} \frac{(n+1)!}{(n-k)!}\text{ (the inner sum diverges violently)}\\
&=-\sum_{k=0}^{\infty} \frac{(-1)^ku^k}{k!}\sum_{n=0}^{\infty} \frac{(n+k+1)!}{n!}\\
\end{align}
$$
You can only do the
series multiplication
if the same variable
occurs in both series.
