# Solve the integral: $\int \frac{\cos^2x-\sin^2x}{\sin x+\sin^3 x}dx$

Here's what I tried:

$$\int \frac{\cos^2x-\sin^2x}{\sin x(1+\sin^2 x)}dx = \int \frac{\cos^2x}{\sin x (1+\sin^2x)}dx - \int \frac{\sin^2x}{\sin x (1+\sin^2x)}dx$$ I tried then to divide with $\sin x$ and $\cos x$. Tried to use some trigonometric identities, but it didn't work, I just complicated it more.

And I can't see something that I can substitute.

• Did you consider that you can cancel one "sin(x)" in the second integral ? – Peter Oct 16 '16 at 15:28
• The substitution $t=\tan(\frac{x}{2})$ will work, but the resulting rational function could be difficult to integrate. – Peter Oct 16 '16 at 15:30
• Yes, I tried to cancel one $\sin x$. – Gjekaks Oct 16 '16 at 15:33
• An usual idea, but have you tried $t=\sin^2(x)$ ? – Peter Oct 16 '16 at 15:34
• This expression could be integrated very easily! But only without $\sin$ and $\cos$ , of course. – Peter Oct 16 '16 at 15:36

Hint. One may write, with the change of variable $u=\cos x$, $$\int \frac{\cos^2x}{\sin x (1+\sin^2x)}dx=\int \frac{\cos^2x\:\sin x}{\sin^2 x (1+\sin^2x)}dx=-\int \frac{u^2}{(1-u^2) (2-u^2)}du$$ and $$\int \frac{\sin^2x}{\sin x (1+\sin^2x)}dx=\int \frac{\sin x}{ 1+\sin^2x}dx=-\int \frac{du}{2-u^2}$$ then the new integrals are easier to evaluate.