I want to do a series expansion of the function given below around $a=0$ and keep the terms only upto $O(a)$. The function is
$$ f(a)=\frac{a \pi^2\sin^2\theta}{a^2-\pi^2\cos^2\theta} $$ Using $f(0)+f'(0)a$, I would get the expansion as $f(a)=-\tan^2\theta ~a$. I suspect whether this expansion would be correct near $\theta$ equal to $\pi/2$. Any help, how should I proceed in that case. Should I take $\lim~\theta\rightarrow \pi/2$ first and then do the expansion or should I do something else?
We know that near $X=0$,
$$\frac{1}{1-X}=1+X+X^2+...$$ $$=1+O(X)$$
thus
$$f(a)=-\frac{a\pi^2\sin^2(\theta)}{\pi^2\cos^2(\theta)}\frac{1}{1-\frac{a^2}{\pi^2\cos^2(\theta)}}$$ $$=-a\tan^2(\theta)\Bigl(1+O(a^2)\Bigr)$$ $$=-a\tan^2(\theta)+O(a)$$