<s>[INST] Evaluating $\int \frac{\cos x}{\sin^3x+\sin x}dx$ Given the function $$g(x)=\frac{\cos x}{\sin^3x+\sin x},$$ by letting $u=\sin x$, show that $$\int g(x) dx=\int\left(\frac{A}{u}+\frac{Bu+C}{u^2+1}\right)du$$ where $A,B$ and $C$ are constants. Hence, find $A,B$ and $C$. Hence, solve $\int g(x)dx$.
My attempt, 
$$g(x)=\frac{\cos x}{\sin^2 x(\sin  x+1)}$$
$$=\frac{\sqrt{1-u^2}}{u^2(u+1)}$$
I'm stuck here.
 [/INST] Method$\#1:$
$\sin x=u\implies $
$\displaystyle\int g(x)\ dx=\int\dfrac{du}{u(u^2+1)}$
Now using Partial Fraction Decomposition let $\dfrac1{u(u^2+1)}=\dfrac Au+\dfrac{Bu+C}{u^2+1}$
$\implies1=A(u^2+1)+u(Bu+C)=u^2(A+B)+Cu+A$
Comparing the coefficients of $u,u^2$ and the constants
$\implies C=0,A=1,A+B=0\iff B=-A=?$
Can you take it from here?
Method$\#2:$
$$I=\int\dfrac{\cos x}{\sin x(\sin^2x+1)}dx=\int\dfrac{\cos x\sin x}{\sin^2x(\sin^2x+1)}dx$$
Set $\sin^2x=v\implies dv=2\sin x\cos x\ dx$
$$2I=\int\dfrac{dv}{v^2(v^2+1)}=\int\dfrac{(v^2+1)-v^2}{v^2(v^2+1)}dv=?$$
</s>