<s>[INST] Taylor expansion of composite functions Suppose one has a function of the form: $$f(x)=\sqrt{1+a\cos^{2}(x)}$$ where $a$ is some parameter. 
Firstly, what is the correct method for Taylor expanding such a composite function? Should one just repeatedly use the chain rule $(f\circ g)'(x)=f'(g(x))g'(x)$ to determine the coefficients of the Taylor expansion, such that it has the form: $$(f\circ g)(x)=(f\circ g)(x_{0})+(f\circ g)'(x_{0})(x-x_{0})+\frac{1}{2}(f\circ g)''(x_{0})(x-x_{0})^{2}+\cdots$$ or is there a different method?
Secondly, although not technically a Taylor expansion, if the parameter $a<<1$ is it reasonable to approximate the function as $$\sqrt{1+a\cos^{2}(x)}\approx 1+\frac{a}{2}\cos^{2}(x)$$ i.e. naively plugging in $a\cos^{2}(x)$ to the Taylor expansion for $\sqrt{1+x}=1+\frac{x}{2}-\frac{x^{2}}{8}+\mathcal{O}(x^{3})$?
 [/INST] $$f(x)=\sqrt{1+a - a\sin^{2}(x)} = \sqrt{1+a}\sqrt{1 - {a\over a+1}\sin^2x}$$
$$ = \sqrt{1+a}\left(1 - {1\over2}{a\over a+1}\sin^2x  + {1\over2!}{1\over2}\left({1\over2}-1\right)\left(-{a\over a+1}\right)^2\sin^4x\right) +O(x^6)$$
$$ = \sqrt{1+a}\left(1 - {1\over4}{a\over a+1}(1-\cos2x) - {1\over32}{a^2\over (a+1)^2}(1-2\cos 2x+\cos^22x)\right)+O(x^6)$$
$$ = \sqrt{1+a}\left(1 - {1\over4}{a\over a+1}(1-\cos2x) - {1\over64}{a^2\over (a+1)^2}(2-4\cos 2x+ 1+\cos4x)\right)+O(x^6)$$
$$ = \sqrt{1+a} - \sqrt{1+a}\left({1\over4}{a\over a+1} + {1\over16}{a^2\over (a+1)^2}\right)(1-\cos2x) +\sqrt{1+a} + {1\over64}{a^2\over (a+1)^2}(1-\cos4x)+O(x^6)$$
$$ = \sqrt{1+a} - \sqrt{1+a}\left({1\over4}{a\over a+1} + {1\over16}{a^2\over (a+1)^2}\right)\left({4x^2\over2!}-{16x^4\over4!}\right)$$
$$ + {\sqrt{1+a}\over64}{a^2\over (a+1)^2}\left({16x^2\over2!}-{256x^4\over4!}\right)+O(x^6)$$
$$ = \sqrt{1+a} - {\sqrt{1+a}\over4}{a\over a+1}x^2 + {\sqrt{1+a}\over4!}\left({4a\over a+1} - {3a^2\over (a+1)^2}\right)x^4+O(x^6).$$
</s>