Need help with the integral $\int \frac{2\tan(x)+3}{5\sin^2(x)+4}\,dx$ I'm having a problem resolving the following integral, spent almost all day trying.
Any help would be appreciated.
$$\int \frac{2\tan(x)+3}{5\sin^2(x)+4}\,dx$$
 A: Hint:


*

*Multiply the numerator and denomiator by $\sec^{2}(x)$. Then you have $$\int \frac{2 \tan{x} +3}{5\sin^{2}(x)+4} \times \frac{\sec^{2}(x)}{\sec^{2}{x}} \ dx$$

*Now, the denomiator becomes $5\tan^{2}(x) + 4\cdot \bigl(1+\tan^{2}(x)\bigr)$, and  you can put $t=\tan{x}$.

*So your new integral in terms of $t$ is : $\displaystyle \int \frac{2t+3}{9t^{2}+4} \ dt = \int\frac{2t}{9t^{2}+4} \ dt + \int\frac{3}{9t^{2}+4} \ dt$.
A: If you convert everything to sines and cosines, you get $$\frac{2\tan x+3}{5\sin^2x+4}=\frac{2\sin x+3\cos x}{5\sin^2x\cos x+4\cos x}\;,\tag{1}$$ which probably doesn’t look very promising. However, you can rewrite it as $$\frac{2\sin x+3\cos x}{\cos x(9-5\cos^2x)}=\frac{2\sin x}{\cos x(9-5\cos^2x)}+\frac3{9-5\cos^2x}\;.$$ The first term of this is nice: apart from a factor of $-1$, $\sin x$ is the derivative of $\cos x$, so it can be integrated by substituting $u=\cos x$ and using partial fractions. The second term still requires a bit of work. When sines and cosines don’t do the job, try secants and tangents:
$$\frac3{9-5\cos^2x}=\frac3{9-\frac5{\sec^2x}}=\frac{3\sec^2x}{9\sec^2x-5}=\frac{3\sec^2x}{9(\tan^2x+1)-5}=\frac{3\sec^2x}{9\tan^2x+4}\;,$$ which can be integrated by substituting $u=\tan x$.
If you don’t see any way forward from $(1)$, you can always jump directly to the stage of trying to get secants and tangents.
$$\frac{2\tan x+3}{5\sin^2x+4}=\frac{2\tan x+3}{5\tan^2x\,\cos^2x+4}=\frac{2\tan x+3}{5\frac{\tan^2x}{\sec^2x}+4}=\frac{2\sec^2x\tan x+3\sec^2x}{5\tan^2x+4\sec^2x}\;,$$
and after converting the $4\sec^2x$ in the denominator to $4\tan^2x-4$, we have 
$$\frac{(2\tan x+3)\sec^2x}{9\tan^2x+4}\;;$$
$\sec^2x$ being the derivative of $\tan x$, the substitution $u=\tan x$ will turn this into a nice rational function of $u$. This is exactly what Chandrasekhar achieved directly in his solution by multiplying the fraction by $\dfrac{\sec^2x}{\sec^2x}$. That’s a nicer, more efficient way to go. My purpose in writing out this more roundabout route is to show that you often don’t have to see the really clever tricks if you can put together enough more routine manipulations.
A: Try $t=\tan(x/2)$. This leads to $\sin(x)=\frac{2t}{1+t^2}$, $\tan(x)=\frac{2t}{1-t^2}$ and finally $dx = \frac{2\,dt}{1+t^2}$. Then use a classical partial fraction expansion.
A: You can use the standard way for such cases (trigonometric): http://en.wikibooks.org/wiki/Calculus/Integration_techniques/Tangent_Half_Angle and you get to integrate the ratio of two polynomials (you can do also standard way). 
A: $$
\begin{aligned}
& \int \frac{2 \tan x+3}{5 \sin ^{2} x+4} d x \\
=& \int \frac{2 \sec ^{2} x \tan x+3 \sec ^{2} x}{5 \tan ^{2} x+4 \sec ^{2} x} d x \\
=& 2 \int \frac{\sec ^{2} x \tan x}{5 \tan ^{2} x+4 \sec ^{2} x} d x+3 \int \frac{\sec ^{2} x}{5 \tan ^{2} x+4 \sec ^{2} x} d x \\
=& \int \frac{2sd s}{9 s^{2}-5}+\int \frac{3d t}{9 t^{2}+4} \quad \textrm{ where }s=\sec x \textrm{ and }t=\tan x.\\
=& \ln \left|9 s^{2}-5\right|+\frac{1}{2} \arctan\left(\frac{3 t}{2}\right)+C  \\
=& \ln \left|9 \sec ^{2} x-5\right|+\frac{1}{2} \arctan \left(\frac{3 \tan x}{2}\right)+C
\end{aligned}
$$
