Please review the section 4.3 on the book before going through the solution.
Let us put u = ln(tan(x)) and dv = sin(x)
whence
and v = -cos(x)
Doing integration by parts:
Let I₂ = ∫1/sin(x)dx. This can be integrated as follows:
Make the substitution cos(x) = t:
Note that we use formula (10) of section 4.1 on the book to integrate 1/(u^2-a^2) form below.
Using
We can simplify I₂ as:
Now we can get the result as I = -cos(x)ln(tan(x)) + I₂