Spivak, Ch. 20, Problem 10c: How to compute the Taylor polynomial of $\frac{1}{\cos}$? 


*(c) Find $P_{5,0,\tan}(x)$. Hint: first use Problem $9$(f) and the value of $P_{5,0,\cos}(x)$ to find $P_{5,0,1/\cos}(x)$.


As a note on notation, $P_{5,0,\tan}(x)$ is the fifth order Taylor polynomial at $0$ of $\tan$.
For this question, I am interested in the computation of $P_{n,0,\frac{1}{1-\cos}}(x)$ specifically.
In Problem $9$(f), it was shown that if $g(a)=0$ then
$$P_{n,a,\frac{1}{1-g}}(x)=\left [ \sum_{i=0}^n \left ( P_{n,a,g}(x) \right )^i \right ]_n$$
where $[P]_n$ denotes the truncation of a polynomial $P$ to degree $n$, that is, it is the sum of all terms of $P$ of degree $\leq n$.
The solution manual does the following
$$P_{n,0,\frac{1}{1-\cos}}(x)=\left [ \frac{1}{1-(\frac{x^2}{2!}-\frac{x^4}{4!})} \right ]_5\tag{1}$$
$$=\left [ 1+\left (\frac{x^2}{2!}-\frac{x^4}{24}\right ) +\left (\frac{x^2}{2!}-\frac{x^4}{24}\right )^2  \right ]_5$$
$$=1+\frac{x^2}{2}+\frac{5x^4}{24}\tag{2}$$
My question is simply: where does $(1)$ come from?
I will also add my own two attempts below.
In my first attempt, I tried letting $f(x)=\frac{1}{x}$ and $g(x)=\cos{x}$ and using the relationship
$$P_{n,a,f\circ g}(x)=[ P_{n,g(a),f}\circ P_{n,a,g}]_n=[ P_{n,g(a),f}(P_{n,a,g}(x))]_n$$
which was proved in the problem $9$(e) just before.
Then, computing the Taylor polynomial of $f$ we have
$$P_{n,a,f}(x)=\sum\limits_{i=0}^n \frac{(x-a)^i}{a^{i+1}}$$
And since $a=0$ in this problem, we have $g(a)=g(0)=1$. Thus
$$P_{n,1,f}(x)=\sum\limits_{i=0}^n (x-1)^i$$
$$P_{n,0,g}(x)=\sum\limits_{i=0}^n (-1)^i \frac{x^{2i}}{(2i)!}$$
and
$$P_{n,0,f\circ g}(x)=[ P_{n,1,f}(P_{n,0,g}(x))]_n$$
$$=\left [ \sum\limits_{i=0}^n \left ( \sum\limits_{j=1}^n (-1)^j \frac{x^{2j}}{(2j)!} \right )^i \right ]_n\tag{3}$$
Thus
$$P_{5,0,f\circ g}(x)=P_{5,0,\frac{1}{\cos}}(x)=\left [ \sum\limits_{i=0}^5 \left ( \sum\limits_{j=1}^5 (-1)^j \frac{x^{2j}}{(2j)!} \right )^i \right ]_5\tag{4}$$
$(2)$ is quite a complicated expression.
In my second attempt, I used $\cos{x}=1-g(x)$, so $g(x)=1-\cos{x}$ and
$$P_{2n+1,0,g}(x)=1-\sum\limits_{i=0}^n (-1)^i \frac{x^{2i}}{(2i)!}$$
$$=1-\left [ 1+\sum\limits_{i=1}^n (-1)^i \frac{x^{2i}}{(2i)!}\right ]$$
$$=-\sum\limits_{i=1}^n (-1)^i \frac{x^{2i}}{(2i)!}$$
$$=\sum\limits_{i=1}^n (-1)^{i+1} \frac{x^{2i}}{(2i)!}$$
Thus
$$P_{5,0,\frac{1}{\cos}}(x)=P_{5,0,\frac{1}{1-g}}(x)=\left [ \sum\limits_{i=0}^5[P_{5,0,g}(x) ]^i \right ]_5$$
$$=\left [ \sum\limits_{i=0}^5\left ( \sum\limits_{j=1}^2 (-1)^{j+1} \frac{x^{2j}}{(2j)!} \right )^i \right ]_5\tag{5}$$
Now, $(4)$ and $(5)$ seem to be different expressions, both involving lots of complicated terms. I asked a question on MaplePrimes about how to truncate polynomials in Maple, but for now I can't tell if they are different, or indeed if one of them is equal to what Spivak has as the correct answer for the Taylor polynomial of $\frac{1}{\cos}$ that we see in $(2)$.
In addition to my first question, it would be nice to get feedback on these two attempts. It seems at least one of them is incorrect.


My question is simply: where does (1) come from?

(1) comes from an error in notation. Look back at the problem and you see that it is $P_{5,0,\frac 1{\cos}}$ you need to calculate for the hint, not $P_{5,0,\frac 1{1-\cos}}$. You cannot calculate $P_{5,0,\frac 1{1-\cos}}$ at all, as $\frac 1{1-\cos x}$ is not even defined at $x = 0$, much less differentiable. And the singularity is a pole, not removable. Someone accidently replaced $g$ with $\cos$ in the Taylor polynomial notation, when they meant to replace $\frac 1{1-g}$ with $\frac 1\cos$.
A further issue is that (1) also doesn't quite follow the hint, but instead follows pretty much the same path you did in your first attempt, except they shortcutted a bit, and most importantly instead of writing out frightening summation notations, they substituted in the much less frightening simple expressions those summations represent:
$$P_{5,0,\cos}(x) = \sum_{j=0}^2 (-1)^{j+1} \frac{x^{2j}}{(2j)!} = 1 - \frac{x^2}{2!}+\frac{x^4}{4!}$$
(In writing up your first attempt here, you incorrectly have $5$ as the upper limit of the sum, but in the second attempt, you wrote the correct upper limit of $2$, so I assume the first was a typo.)
So the final formula of your first attempt can be expressed more simply as
$$P_{5,0,\frac1{\cos}}(x) = \left[1 + \left(\frac{x^2}{2!}-\frac{x^4}{4!}\right) + \left(\frac{x^2}{2!}-\frac{x^4}{4!}\right)^2 +\  \dots\right]_5$$
Which is also what they would have gotten by directly applying 9(f) instead of reverting to earlier formulas. The next thing to notice is that the "$+\ \dots$" at the end can be dropped (which is why I didn't bother to write it out). Any power $\left(\frac{x^2}{2!}-\frac{x^4}{4!}\right)^i$ for $i>2$ will, when multiplied out, consist only of terms of degree $6$ or greater, and we are throwing out anything with a degree greater than $5$. Thus your "quite a complicated expression" actually isn't that complicated after all. Even the $\left(\frac{x^2}{2!}-\frac{x^4}{4!}\right)^2$ only contributes $\left(\frac{x^2}{2!}\right)^2$ to the Taylor polynomial, the other terms being of too high degree. So
$$P_{5,0,\frac1{\cos}}(x) = 1 + \frac{x^2}{2!}-\frac{x^4}{4!} + \frac{x^4}{2!^2} = 1 + \frac 12 x^2 +\frac 5{24}x^4$$
