The correct option is
A 12(cosx−sinx)−12√2ln∣∣
∣
∣∣tanx2+√2tanx2+√2∣∣
∣
∣∣+c
Consider,
I=∫1secx+cosecxdx
⇒ ∫11cosx+1sinxdx=∫sinxcosxsinx+cosxdx
⇒ I=12∫2sinxcosxsinx+cosxdx=12∫1+2sinxcosx−1sinx+cosxdx
⇒ I=12∫(sinx+cosx)2sinx+cosxdx−12∫1sinx+cosxdx
⇒ I=12∫(sinx+cosx)dx−12∫12sinx2cosx2+cos2x2−sin2x2dx
⇒ I=12(cosx−sinx)−12∫12sinx2cosx2+cos2x2−sin2x2dx
Let this be I1
⇒ I1=12∫12sinx2cosx2+cos2x2−sin2x2dx
Divide Numberator and denominator by cos2x2
⇒ I1=12∫sec2x22tanx2+1−tan2x2dx
Put tanx2=t ⇒ 12sec2x2dx=dt
⇒ I1=−∫12t+1−t2dt=−∫1t2−2t−1dt
⇒ I1=−∫1(t−1)2−√22dt=−12√2ln∣∣∣t−1−√2t−1+√2∣∣∣+c
⇒ I1=−12√2ln∣∣
∣
∣∣tanx2−1−√2tanx2−1+√2∣∣
∣
∣∣
⇒ I=12(cosx−sinx)−12√2ln∣∣
∣
∣∣tanx2+√2tanx2+√2∣∣
∣
∣∣+c