<s>[INST] Series representation of function with fractions, logarithms, squares and cosines. I'm looking for a series representation for
$$\dfrac x{x^2+(\log \cos x)^2}$$
Where $x\in(0,\pi/2)$
Note: Both finite and infinite series are accepted.
I have tried taylor series, but it requires the $n$th derivative, which is not trivial. But since it can be used in the taylor series, a formula for $n$th derivative would also be a valid answer.
I know that the $n$th derivative can be found with Faà di Bruno's formula, however I would like to avoid using this formula because of it's complexity. (If you can shorten a Faà di Bruno formula, that would be fine too)
 [/INST] For a truncated series, I suppose that we could use $$\cos(x) \simeq 1-\frac{x^2}{2}+\frac{x^4}{24}-\frac{x^6}{720}$$ then use $$\log(1+y)\simeq y-\frac{y^2}{2}+\frac{y^3}{3}-\frac{y^4}{4}$$ Replace $$y=-\frac{x^2}{2}+\frac{x^4}{24}-\frac{x^6}{720}$$ to get $$\log(\cos(x))\simeq-\frac{x^2}{2}-\frac{x^4}{12}-\frac{x^6}{45}$$ $$\Big(\log(\cos(x))\Big)^2\simeq\frac{x^4}{4}+\frac{x^6}{12}+\frac{7 x^8}{240}+\frac{79
   x^{10}}{7560}$$ $$x^2+\Big(\log(\cos(x))\Big)^2\simeq x^2+\frac{x^4}{4}+\frac{x^6}{12}+\frac{7 x^8}{240}+\frac{79
   x^{10}}{7560}$$ $$x^2+\Big(\log(\cos(x))\Big)^2\simeq x^2\Big(1+\frac{x^2}{4}+\frac{x^4}{12}+\frac{7 x^6}{240}+\frac{79
   x^{8}}{7560}\Big)$$ and now perform the long division to arrive to $$\dfrac x{x^2+(\log \cos x)^2} \simeq \frac{1}{x}-\frac{x}{4}-\frac{x^3}{48}-\frac{x^5}{320}-\frac{31
   x^7}{48384}$$
May be, a faster solution could use what Greg Martin suggested and write $$\frac {x}{x^2+y^2} = x^{-1} + x^{-3}y^2 + x^{-5}y^4 + \cdots=\frac{1}{x} \Big(1-\frac{y^2}{x^2}+\frac{y^4}{x^4}-\frac{y^6}{x^6}+ \cdots\Big)$$ in which $y$ should be replaced by the development of $\log(\cos(x))$ given above and noticing that $$\frac{y^2}{x^2}=\frac{x^2}{4}+\frac{x^4}{12}+\frac{7 x^6}{240}+\frac{79 x^8}{7560}+O\left(x^9\right)\simeq x^2 \Big(\frac{1}{4}+\frac{x^2}{12}+\frac{7 x^4}{240}+\frac{79 x^6}{7560}\Big)$$
</s>