Integrate ∫tanx+cotxdx.
Find the integral:
Given, ∫tanx+cotxdx
We know that, tanx=sinxcosx and cotx=cosxsinx. Therefore,
∫tanx+cotxdx=∫sinxcosx+cosxsinxdx=∫sin2x+cos2xsinx·cosxdx=∫sinx+cosxsinx·cosxdx...(i)
Let us assume that sinx-cosx=t
On differentiating,
⇒ddxsinx-cosx=dtdx⇒cosx+sinxdx=dt...(ii)
From our assumption,
⇒sinx-cosx2=t2⇒sin2x+cos2x-2sinx·cosx=t2⇒1-2sinx·cosx=t2∵sin2x+cos2x=1⇒sinx·cosx=1-t22...(iii)
Substituting (iii) and (ii) in (i),
∫sinx+cosxsinx·cosxdx=∫11-t22dt=∫21-t2dt=2∫11-t2dt=2sin-1t+C∵∫11-x2=sin-1x
Substituting the value of t in the above equation,
⇒2sin-1t+C=2sin-1sinx-cosx+C
Therefore, ∫tanx+cotxdx=2sin-1sinx-cosx+C.