Integration of $\int \frac{dx}{a+f^2(x)}$ I want to solve a integral of the form:
$$
\int \frac{dx}{a+f^2(x)}  
$$
in my particular case I got
$$
\int \frac{dx}{5+\cos^2(x)}
$$
in my case I followed this process:
$$
\int \frac{dx}{5+\cos^2(x)} \\
let \ t = tg(\frac{x}{2}) => 
dx = \frac{2dt}{1+t^2}\\
\int \frac{dx}{5+\cos^2(x)} = \int \frac{\frac{2\,dt}{1+t^2}}{5+(\frac{1-t^2}{1+t^2})^2}\\
$$
Expanding the denominator
$$
5+(\frac{1-t^2}{1+t^2})^2 = \frac{5(1+t^2)^2+(1-t^2)^2}{(1+t^2)^2}
$$
Rewriting all:
$$
\int \frac{2\,dt}{1+t^2} \frac{(1+t^2)^2}{5(1+t^2)^2+(1-t^2)^2} = \\
2 \int \frac{(1+t^2)}{5(1+t^2)^2+(1-t^2)^2}dt
$$
Now I am stuck, I can try to expand the denominator again, but then I cannot divide it for the numerator, something like this:
$$
2 \int \frac{1+t^2}{5(1+2t^2+t^4)+(1-2t^2+t^4)} \,dt = \\
2 \int \frac{1+t^2}{5+10t^2+5t^4+1-2t^2+t^4} \,dt = \\
2 \int \frac{1+t^2}{6t^4+8t^2+6} \,dt = \\
\int \frac{1+t^2}{3t^4+4t^2+3}\, dt
$$
But now I really don't know how to move next...

I you want a solution of $\displaystyle \int\frac{1}{5+\cos^2 x}dx$
$\bf{Solution::}$ Divide both $\bf{N_{r}}$ abd $\bf{D_{r}}$ by $\cos^2 x$, we get $\displaystyle \int\frac{\sec^2 x}{5\sec^2 x+1}dx = \int\frac{\sec^2 x}{6+5\tan^2 x}dx$
Now Let $\sqrt{5}\tan x= t$, Then $\displaystyle \sec^2 xdx = \frac{1}{\sqrt{5}}dt$
So $\displaystyle \int\frac{1}{\left(\sqrt{6}\right)^2+t^2}dt = \frac{1}{\sqrt{30}}\tan^{-1}\left(\frac{t}{\sqrt{6}}\right)+\mathbb{C}$
So $\displaystyle \int\frac{1}{5+\cos^2 x}dx = \frac{1}{\sqrt{30}}\tan^{-1}\left(\frac{\sqrt{5}\tan x}{\sqrt{6}}\right)+\mathbb{C}$
