Integration by Euler's formula How do you integrate the following by using Euler's formula, without using integration by parts? $$I=\displaystyle\int \dfrac{3+4\cos {\theta}}{(3\cos {\theta}+4)^2}d\theta$$
I did integrate it by parts, by writing the $3$ in the numerator as $3\sin^2 {\theta}+3\cos^2{\theta}$, and then splitting the numerator.
But can it be solved by using complex numbers and the Euler's formula?
 A: Hint
When you have an expression with a squared denominator, you could think that the solution is of the form $$I=\displaystyle\int \dfrac{3+4\cos {\theta}}{(3\cos {\theta}+4)^2}~d\theta=\frac{a+b\sin \theta+c\cos \theta}{3\cos {\theta}+4}$$ Differentiate the rhs and identify terms. You will get very simple results.
A: By remembering that $e^{i\theta}=\cos(\theta) + i\sin(\theta)$ it is then easy to see that 
$$\cos(\theta) = \frac{e^{i\theta} + e^{-i\theta}}{2}$$
and
$$\sin(\theta) = \frac{e^{i\theta} - e^{-i\theta}}{2i}$$
Perform your substitutions, and carry out your integration. Does that help?
Edit, the substitution yields
$$\frac{3+2(e^{i\theta} + e^{-i\theta})}{(4+\frac{3}{2}(e^{i\theta} + e^{-i\theta}))^2}$$
Now you need to expand that expression, and apply the rules you learned from your first course in integral calculus to then solve in terms of $e^{i\theta}$. You then need to play with adding fun values of zero and multiplying by fun values of 1 to repackage into sin and cosine, or, simply just forward apply Euler's magnificent formula to translate back.
A: Hint:
$$ \frac{d}{dx}\frac{\sin x}{3\cos x+4}=\frac{3+4\cos x}{(3\cos x+4)^2}.$$
