Some insight can be gained by plotting Sqrt[Exp[I*t]^2 - 1]
in the complex plane.
Plot3D[Evaluate[ReIm[Sqrt[Exp[I*t]^2 - 1] /. t -> tr + I ti]], {tr, 0, Pi},
{ti, -1, 1}, AxesLabel -> {tr, ti, f}]

Branch points occur at t == n Pi
, n
an integer, with branch cuts extending from the branch points to t == n Pi + I ∞
. Visibly, there also are branch cuts at t
an odd half-integer of Pi
, even though there are no corresponding branch points. They are, in other words, simply an artifact of Mathematica's definition of Sqrt[]
. Nonetheless, they must be taken into account.
The impact of the branch cut at t == Pi/2
is apparent from the following plot of the integrand.
Plot[Evaluate[ReIm[Sqrt[Exp[I*t]^2 - 1]]], {t, 0, Pi}]

The real part of the integrand is symmetric, the imaginary part antisymmetric, which is consistent with the result of NIntegrate
in the Question. So, what does Integrate
do as it crosses the branch cut?
Integrate[Sqrt[Exp[I*t]^2 - 1], {t, Pi/2, Pi/2 + 10^-10}]
(* Sqrt[2] - I π + I (-Sqrt[-1 - E^(I/5000000000)] +
ArcTan[Sqrt[-1 - E^(I/5000000000)]]) + ArcTanh[Sqrt[2]] *)
% // N
(* 1.76275 - 3.14159 I *)
Evidently, integrating an infinitesimal distance produces a finite value. Because the contour cannot be distorted around this branch cut, Integrate
must have some built-in rule to add this value as the branch cut is crossed. In any case, Integrate
can be made to give the correct value by excluding the region at t == Pi/2
.
Integrate[Sqrt[Exp[I*t]^2 - 1], {t, 0, Pi/2 - 10^-10}] +
Integrate[Sqrt[Exp[I*t]^2 - 1], {t, Pi/2 + 10^-10, Pi}]
(* I (-Sqrt[-1 - E^(-(I/5000000000))] + ArcTan[Sqrt[-1 - E^-(I/5000000000))]]) +
I (Sqrt[-1 - E^(I/5000000000)] - ArcTan[Sqrt[-1 - E^(I/5000000000)]]) *)
% // N
(* 1.06568 + 0. I *)
which is the same value as obtained from NIntegrate
, up to roundoff.
Version 11.1.0 update.
Version 11.1.0 returns the correct answer.
Integrate[Sqrt[Exp[I*t]^2 - 1], {t, 0, Pi}]
(* 1/2 (4 Sqrt[2] + Log[17 - 12 Sqrt[2]]) *)
% // N
(* 1.06568 *)
1/2 (4 Sqrt[2] + Log[17 - 12 Sqrt[2]])
in v8.0.4, which is correct. I think it's safe to say it's a bug. $\endgroup$2 (Sqrt[2] - ArcSinh[1])
. So, something went wrong in between 5.2 and 9. $\endgroup$