How to calculate $\int \frac{\sin x}{\tan x+\cos x} \, dx$ How to calculate $$\int \frac{\sin x}{\tan x+\cos x} \, dx\text{ ?}$$ I got to $$\int \frac{-u}{u^2-u-1} \, du$$ while $u=\sin x$ but can I continue from here? 

First complete the square:
$$
u^2-u-1 = \left(u^2-u+\frac 1 4\right)-\frac 5 4 = \left( u - \frac 1 2 \right)^2 -\frac 5 4 = \left( u - \frac 1 2 - \frac{\sqrt 5} 2 \right)\left( u - \frac 1 2 + \frac{\sqrt 5} 2 \right)
$$
Then use partial fractions.
$$
\frac{-u}{u^2-u-1} = \frac A {u - \frac 1 2 - \frac{\sqrt 5} 2} + \frac B {u - \frac 1 2 + \frac{\sqrt 5} 2}
$$
