Let y2=tan(x), 2ydy=sec2(x)dx=(1+tan2(x))dx=(1+y4)dx, dx=2ydy/(1+y4).
Let J=∫√tan(x)dx=2∫y2dy/(1+y4)=2∫dy/(y2+1/y2).
y2+1/y2=(y+1/y)2-2 or (y-1/y)2+2. Let p=y+1/y and q=y-1/y, so:
dp=dy(1-1/y2) and dq=dy(1+1/y2), hence dp+dq=2dy=dy(1-1/y2)+dy(1+1/y2).
And 2dy/(y2+1/y2)=dy(1-1/y2)/(y2+1/y2)+dy(1+1/y2)/(y2+1/y2)=dp/(p2-2)+dq/(q2+2).
J=∫dp/(p2-2)+∫dq/(q2+2).
HYPERBOLIC FUNCTIONS (sinh, cosh, tanh, sech and some derivatives)
Consider cosh2(z)-sinh2(z)=1 where cosh(z)=½(ez+e-z) and sinh(z)=½(ez-e-z), and tanh(z)=sinh(z)/cosh(z)=(ez-e-z)/(ez-e-z).
Also d(sinh(z))=cosh(x), d(cosh(z))=sinh(z), d(tanh(z))=(cosh2(z)-sinh2(z))/cosh2(z)=1/cosh2(z)=sech2(z).
1-tanh2(z)=sech2(z), or tanh2(z)+sech2(z)=1.
INTEGRATE BY SUBSTITUTION
∫dp/(p2-2): Let p=tanh(u)√2, dp=sech2(u)√2du; p2-2=2tanh2(u)-2=-2sech2(u).
∫dp/(p2-2)=-½∫sech2(u)√2du/sech2(u)=-(√2/2)∫du=-(√2/2)u=-(√2/2)tanh-1(p/√2), or -(√2/2)tanh-1(p√2/2).
-(√2/2)tanh-1(p√2/2)=-(√2/2)tanh-1(√2/2(√tan(x)+√cot(x))).
∫dq/(q2+2)=(√2/2)tan-1(q√2/2)=(√2/2)tan-1(√tan(x)-√cot(x)).
J=-(√2/2)tanh-1(√2/2(√tan(x)+√cot(x)))+(√2/2)tan-1(√tan(x)-√cot(x))+C where C is integration constant.
(To integrate dq/(q2+2), from first principles, the substitution is q=tan(u)√2, etc., similar to above for tanh.)