How to integrate $\int \frac1{(3+4\sin x)^2}\,dx$? 
We are to solve  $$\int \frac1{(3+4\sin x)^2}\,dx.$$

I had tried expanding the denominator and substituting $\sin x$ in terms of $\tan(x/2)$ and then putting $\tan(x/2) =t$. But, this made the integration even more complex. I got a large bi-quadratic  equation in the denominator.
If I am able to get $\cos x$ in the numerator ,then the question can be proceeded from there.
Any ideas or other methods by which I could solve?
Thanks in advance.
 A: If we put $3 + 4 \sin(x) = u$, we get:
$$I = \int\frac{du}{u^2\sqrt{7 +6 u - u^2}}$$
Substituting $u = \frac{1}{t}$ yields:
$$I = -\int\frac{tdt}{\sqrt{7t^2 +6 t - 1}} =  -\frac{1}{14}\int\frac{(14t + 6)dt}{\sqrt{7t^2 +6 t - 1}} +\frac{3}{7}\int\frac{dt}{\sqrt{7t^2 +6 t - 1}}$$
The first term on the r.h.s. yields $-\frac{1}{7}\sqrt{7t^2 + 6 t -1}$, while the second term is easily evaluated by writing the argument of the square root  in terms of a perfect square and then doing a hyperbolic substitution.
A: Let us try this manually. As in usual first we can try the substitution $$\tan\left(\frac x2\right)=t$$ which gives $$dx=\dfrac{2dt}{1+t^2}$$ and $$\sin x=\dfrac{2t}{1+t^2}.$$ Then our integral reduces to $$\int \frac1{(3+4\sin x)^2}\,dx=2\int \dfrac{t^2+1}{(3t^2+8t+3)^2}\,dt.$$ Note that the fact $\dfrac{d}{dx}\Big(\dfrac uv\Big)=\dfrac{vu'-uv'}{v^2},$ lets us to assume our integral should consists some thing of the form $$\dfrac{f(t)}{3t^2+8t+3},$$ where $f$ is a polynomial whose degree is at most $2.$ By inspection we can see that $$\color{Green}{\dfrac{d}{dx}\Big(\dfrac{t^2+3t+1}{3t^2+8t+3}\Big)=\dfrac{-t^2+1}{(3t^2+8t+3)^2}}.$$
Therefore $$\int \dfrac{t^2+1}{(3t^2+8t+3)^2}\,dt=-\Big(\dfrac{t^2+3t+1}{3t^2+8t+3}\Big)+2\color{Red}{\int \dfrac{1}{(3t^2+8t+3)^2}\,dt}.$$ For evaluate the red colored integral, find partial factions and continue as we usually do...
Good Luck with your problem.
A: HINT: $$\displaystyle \int \frac{dx}{(a+4sinx)^2} = -\frac{d}{da}\int \frac{dx}{a+4sinx}$$
$$\int \frac{dx}{a+4sinx}= \frac{2arctan\left(\frac{atan(\frac{x}{2})+4}{\sqrt{a^2-16}}\right)}{\sqrt{a^2 -16}}$$
