# Integrate the function$\frac{1}{1-\ tanx}$

$\begin{array}{1 1} x+\log(\sin x+\cos x)+c \\ x+\log(\sin x-\cos x)+c \\ x-\log(\sin x+\cos x)+c \\ x-\log(\sin x-\cos x)+c\end{array}$

Toolbox:
• Method of substitution :
• Given f(x)dx can be transformed into another form by changing independent variable x to t by substituting x=g(t).
• Consider $I=\int f(x)dx.$
• Put x=g(t) so that $\frac{dx}{dt}=g'(t).$
• $\Rightarrow$dx=g'(t)dt.
• Thus $I=\int f(g(t).g'(t))dt.$
Given $I=\int \frac{1}{1+\tan x}dx=\int\frac{1}{1+\frac{\sin x}{\cos x}}dx.$

$I=\int\frac{\cos x}{\sin x+\cos x}dx.$

Multiply and divide by 2

$I=\int\frac{2\cos x}{\sin x+\cos x}dx.$

Add and subtract sinx in the numerator,

$I=\int\frac{(\sin x+\cos x)+(\cos x-\sin x)}{\sin x+\cos x}dx$.

separating terms we get,

$I=\int dx+\int\frac{(\cos x-\sin x)}{\sin x+\cos x}dx.$

Put $\sin x+\cos x=t.$

$(\cos x-\sin x)dx=dt.$

$I=\int dx+\int\frac{dt}{t}.$

On integrating we get,

x+log|t|+c.

Substituting back for t we get,

$\int\frac{1}{1+\tan x}dx=x+log(\sin x+\cos x)+c.$