The function is
.
Re-write the function.
\
Multiply and divide the function with 


Consider
.
Apply derivative on each side.
\
Substitute
and
.


Substitute 
.
Therefore
.
\
Consider ln|sec(x)+tan(x)|+C.
\Re-write sec(x) = 1/cos(x) and tan(x)=sin(x)/cos(x)
\


We know that sin(x) = cos(π/2-x) and cos(x) = sin(π/2-x).
\
We know that
then
.
We know that
then
.

Cancel the common terms.
\
We know that cot(x) = tan(π/2-x).
\
Therefore
.