Any other way to solve $ \int\frac{1}{1+\tan x} \,dx $? $$
\int\frac{1}{1+\tan x} \,dx
$$
One method to solve is to use $ \tan{2 \theta} = \frac{2\tan{\theta}}{1-\tan^2{\theta}}  $
Second is by reducing integrand in terms of $ \sin x $ and  $\cos x$
Third is to put $\tan x = t $, But it is same as the first method.
Is there any other way to solve this ?
 A: There are tons of ways to solve this, you can even use the substitution $\tan x = u$.
This would get you an Integral like this:
$$\int \frac 1 {(1+u^2)(1+u)}du$$ which using partial fraction can get you to
$$\frac 1 2 \int \frac {1-u} {1+u^2}+ \frac 1 {1+u} $$
Re-arranging, substituting and simplifying it a bit would get you the result:
$$\frac {x+\ln(\sin x+ \cos x)} 2 + C$$
A: With the use of $1+\tan^2 x=\frac{1}{\cos^2 x},$ rewrite $$\int\frac{1}{1+\tan x} \,dx= \int\frac{1+\tan^2 x}{(1+\tan^2 x)(1+\tan x)}\,dx=\int \frac{dt}{(1+t^2)(1+t)},$$ then use partial fractions.
A: One way is to note that $\dfrac{1}{1+\tan x}=\dfrac{\cos x}{\cos x+\sin x}$, so let
$$
I_1:=\int\dfrac{\cos x}{\cos x+\sin x}\,\mathrm{d}x,\quad I_2:=\int\dfrac{\sin x}{\cos x+\sin x}\,\mathrm{d}x.
$$
It is obvious that $I_1+I_2=x+C_+$ and $I_1-I_2=\log(\cos x+\sin x)+C_-$.  Adding and divide by $2$ gives $I_1=\frac{1}{2}\left[x+\log(\cos x+\sin x)\right]+C$.
A: Hint: Write $$\frac{1}{1+\tan(x)}=\frac{\cos(x)}{\sin(x)+\cos(x)}$$ and use the Substitution
$$\sin(x)=\frac{2t}{1+t^2}$$
$$\cos(x)=\frac{1-t^2}{1+t^2}$$
$$dx=\frac{2dt}{1+t^2}$$
A: We have that
$$\frac{2}{1+\tan x} =\frac{1+\tan^2 x}{1+\tan x}+1-\tan x.$$
Then
\begin{align}2\int\frac{1}{1+\tan x}dx&=\int\frac{1+\tan^2 x}{1+\tan x}dx+\int 1dx-\int\tan x\, dx\\
&=\int\frac{(1+\tan x)'}{1+\tan x}dx+\int 1dx+\int\frac{(\cos x)'}{\cos x}\, dx\\
&=\ln(|1+\tan x|)+x+\ln(|\cos x|)+c.\end{align}
A: $$\dfrac1{1+\tan x}=\dfrac{\cos x}{\cos x+\sin x}$$
Let $\cos x=a(\cos x+\sin x)+b\dfrac{d(\cos x+\sin x)}{dx}$
$=\cos x\cdot(a+b)+\sin x\cdot(a-b)$
Set $a-b=0,a+b=1$
