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$$

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.
