$$ \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?