MacLaurin series for $9\sec(3x)$ A question I've been given asks me to find the first 3 non-zero terms of the MacLaurin series for the function: $y = 9sec(3x)$
Looking at old questions on this forum, I think that this is supposed to be done using the identities: $tan(A) = \frac {sin(A)}{cos(A)}$ and $tan^2(A)+1 = sec^2(A)$ along with the standard series' for $cos(x)$ and $sin(x)$. Wolfram Alpha gave the answer:
$$9sec(3x) = 9+\frac{81x^2}{2}+\frac{1215x^4}{8}+\cdots$$
The method I first attempted in order to answer the question was to simply take the standard series for $cos(x)$ and use this. Like so:
$$sec(A) = \frac 1{cos(A)}$$
therefore
$$9sec(3x) = 9(cos(3x))^{-1}$$
The standard expansion is:
$$cos(x) = \sum_{n=0}^\infty {(-1)^n \frac {x^{2n}}{(2n)!}} = 1-\frac {x^2}{2!}+\frac {x^4}{4!}-\cdots$$
And if I manipulate this to equal $9(cos(3x))^{-1}$, I get:
\begin{align}
9(cos(3x))^{-1} & = \sum_{n=0}^\infty {9\left((-1)^n \frac {(3x)^{2n}}{(2n)!}\right)^{-1}} \\
& = \sum_{n=0}^\infty {9\left[((-1)^n)^{-1} \left(\frac {(3x)^{2n}}{(2n)!}\right)^{-1}\right]} \\
& = \sum_{n=0}^\infty {9\left[(-1)^{-n} \left(\frac {(3x)^{2n}}{(2n)!}\right)^{-1}\right]} \\
& = \sum_{n=0}^\infty {(-1)^{n} \frac {9(2n)!}{(3x)^{2n}}} \\
\end{align}
Which gives the values:
$$9sec(3x) = \sum_{n=0}^\infty {(-1)^{n} \frac {9(2n)!}{(3x)^{2n}}} = 9-\frac 2{x^2}+\frac 8{3x^4}\cdots$$
Can somebody explain to me where I went wrong?
 A: Here is a tractable way forward to find the coefficients of the series for $\sec(x)$.  It is straightforward to adopt this apply this approach to find the series for $9\sec(3x)$.  
Recall that $\sec(x)\,\cos(x)=1$ and that the series for the cosine function is given by 
$$\sum_{n=0}^\infty \frac{(-1)^nx^{2n}}{(2n)!}$$
Furthermore note that since the secant function is even, its Taylor series will be given by
$$\sum_{n=0}^\infty \frac{a_nx^{2n}}{(2n)!}$$
Then, multiplying the series in $(1)$ with the series in $(2)$ yields
$$\begin{align}
1&=\sec(x)\,\cos(x)\\\\
&=\left(\sum_{m=0}^\infty \frac{a_mx^{2m}}{(2m)!}\right)\left(\sum_{n=0}^\infty \frac{(-1)^nx^{2n}}{(2n)!}\right)\\\\
&=\sum_{p=0}^\infty\left(\sum_{m=0}^p \frac{(-1)^{p-m}a_{m}}{(2m)!(2(p-m))!}\right)x^{2p}
\end{align}$$
Therefore, we must have
$$\sum_{m=0}^p \frac{(-1)^{p-m}a_{m}}{(2m)!(2(p-m))!}=\begin{cases}
1&,p=0\\\\
0&,p>0
\end{cases} \tag 1$$
We can use $(1)$ to find the coefficients $a_m$ recursively.  We see that for $p=0$, $(1)$ reveals that $a_0=1$ and for $p>0$ we have the recursive relationship
$$\bbox[5px,border:2px solid #C0A000]{a_p=-(2p)!\sum_{m=0}^{p-1} \frac{(-1)^{p-m}a_{m}}{(2m)!(2(p-m))!}} \tag 2$$
Let's use $(2)$ to find the first few coefficients of the secant function.  For $p=1$, we have 
$$a_1=-(2)!\frac{(-1)^{1-0}a_0}{(0)!(2)!}=1$$
For $p=2$, we have
$$a_2=-(4)!\left(\frac{(-1)^{2-0}a_0}{(0)!((4)!)}+\frac{(-1)^{2-1}a_1}{(2)!(2)!}\right)=5$$
For $p=3$, we have
$$a_3=-(6)!\left(\frac{(-1)^{3-0}a_0}{(0)!((6)!)}+\frac{(-1)^{3-1}a_1}{(2)!(4)!}+\frac{(-1)^{3-2}a_2}{(4)!(2)!}\right)=61$$
We can continue recursively to obtain coefficients for higher order terms, but are content here to write the series using the firsts few terms as 
$$\bbox[5px,border:2px solid #C0A000]{\sec(x)=1+\frac x2+\frac{5x^2}{24}+\frac{61x^4}{720}+R_8(x)}$$
where the remainder $R_8(x)$ is 
$$R_8(x)=\sum_{p=4}^\infty \left(\sum_{m=0}^p \frac{(-1)^{p-m}a_{m}}{(2m)!(2(p-m))!}\right)x^{2p}=O(x^8)
$$
A: $\sec x=(\cos x)^{-1}=[\sum_{n=0}^{\infty}(-1)^n\frac{x^{2n}}{(2n)!}]^{-1}\neq \sum_{n=0}^{\infty}[(-1)^n\frac{x^{2n}}{(2n)!}]^{-1}$
This is the main error you made.
I think an easier way is to obtain the first three terms by long division, that is, take 
$$1/(9\cos3x)=1/(9-9(3x^2)/2!+9(3x^4)/4!-\dots)$$
