I need to calculate the following indefinite integral:
I know what the result is (from Mathematica):
but I don't know how to integrate it myself. I have been trying some substitutions to no avail.
Equivalently, I need to know how to compute:
which follows after making the change of variables $z=\tan x$.