We know that,
√1+sinx=√sin2x2+cos2x2+2sinx2cosx2
=√(cosx2+sinx2)2
=∣∣∣cosx2+sinx2∣∣∣
=cosx2+sinx2 for 0<x<π
And
√1−sinx=√sin2x2+cos2x2−2sinx2cosx2
=√(cosx2−sinx2)2
=∣∣∣cosx2−sinx2∣∣∣
√1−sinx=⎧⎪⎨⎪⎩cosx2−sinx2,if 0<x<π2sinx2−cosx2,if π2<x<π
Thus,
Case 1: when 0<x<π2
y=tan−1⎡⎢
⎢
⎢
⎢⎣(cosx2+sinx2)+(cosx2−sinx2)(cosx2+sinx2)−(cosx2−sinx2)⎤⎥
⎥
⎥
⎥⎦
=tan−1(cotx2)
=tan−1[tan(π2−x2)]
=π2−x2
⇒dydx=−12
Case 2: when π2<x<π
y=tan−1⎡⎢
⎢
⎢
⎢⎣(cosx2+sinx2)+(sinx2−cosx2)(cosx2+sinx2)−(sinx2−cosx2)⎤⎥
⎥
⎥
⎥⎦
=tan−1(tanx2)
=x2
⇒dydx=12