Substitute sin(x) = tan(t) and cos(x) dx = sec²(t) dt. We want this change of variable to be reversible, so let's assume bot x and t are bounded between 0 and π/2.
Then we have
Recall the Pythagorean identity,
1 + tan²(t) = sec²(t)
Then
√(1 + tan²(t)) = √(sec²(t)) = sec(t)
and the integral reduces to
Change the variable back to x, so the antiderivative is