The function (sqrt(1-sin(x)*sin(x)) is really the absolute value of cosine (certainly over 0 to $\pi/2$ they're the same); maybe that's why we get the strange antiderivative. I tried integrate(abs(cos(x)),(x,0,pi)) in a sage notebook and got -1 which is definitely wrong. I couldn't get an answer in the Sage Cell server. The Fundamental Theorem of Calculus expects the antiderivative to be defined on the closed interval $[0,\pi/2]$, but $\tan(x)/\sqrt{(\tan(x)^2 + 1)}$ isn't defined when x is a multiple of $\pi/2$. You'll find Sage gives the same error message if you integrate from 0 to $\pi$. In summary, $\tan(x)/\sqrt{(\tan(x)^2 + 1)}$ looks incorrect to me because the domain is not all real numbers but maybe using the simplify commands will let you get your work done.