# 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?

• I'd probably try splitting it into partial fractions – imulsion Jul 5 '15 at 20:03

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}$$
• The antiderivative of $\tfrac{\sin x}{\tan x + \cos x}$ is complicated wolframalpha.com/input/…, so there probably isn't an easier way to get that asnwer. – JimmyK4542 Jul 5 '15 at 20:10
By replacing $\sin x$ with $u$ we have: $$I=\int\frac{\sin x}{\tan x+\cos x}\,dx = \int \frac{\sin x\cos x}{1+\sin x-\sin^2 x}\,dx = \int \frac{u}{1+u-u^2}\,du\tag{1}$$ but the roots of $1+u-u^2$ occur at $u=\frac{1\pm\sqrt{5}}{2}$, so that: $$\frac{u}{1+u-u^2} = \frac{-\frac{5+\sqrt{5}}{10}}{u-\left(\frac{1+\sqrt{5}}{2}\right)}+\frac{-\frac{5-\sqrt{5}}{10}}{u-\left(\frac{1-\sqrt{5}}{2}\right)}\tag{2}$$ and: $$I = -\frac{1}{10}\left((5+\sqrt{5})\log(1+\sqrt{5}-2u)+(5-\sqrt{5})\log(-1+\sqrt{5}-2u)\right).\tag{3}$$