Integrate the following functions.
∫1(1−tanx)dx.
Let I=∫1(1−tanx)dx=∫11−sinxcosxdx=∫1cosx−sinxcosxdx
=12∫2(cosx)dx(cosx−sinx)=12∫cosx+cosx+sinx−sinx(cosx−sinx)dx
[add and subtract cos x in numerator]
=12[∫(cosx−sinx)(cosx−sinx)dx+∫(cosx+sinx)(cosx−sinx)dx]=12[∫1dx+∫(cosx+sinx)(cosx−sinx)dx]
Let cos x -sin x=t
⇒−sinx−cosx=dtdx⇒−[sinx+cosx]=dtdx⇒dx=dt−[sinx+cosx]∴I=12[∫1dx+∫cosx+sinxtdt−[sinx+cosx]]=12[∫1dx−∫1tdt]=12[x−log|t|]+C=12[x−log|cosx−sinx|]+C