Summary
It seems that Integrate[]
cannot handle complicated branch cuts of the integrand properly.
The problem
This integral
i5 = Integrate[(1 - x^(-1/5))/(1 - x), {x, 0, 1}]
(* Out[1682]= 0 *)
returns a wrong result.
The numerical values is
i5n = NIntegrate[(1 - x^(-1/5))/(1 - x), {x, 0, 1}]
(* Out[1683]= -0.387793 *)
The same result holds for higher values:
Table[Integrate[(1 - x^(-1/n))/(1 - x), {x, 0, 1}], {n, 2, 10}]
(* Out[1706]= {-Log[4], 1/6 (Sqrt[3] \[Pi] - 9 Log[3]),
1/2 (\[Pi] - 2 Log[8]), 0, 0, 0, 0, 0, 0} *)
Analysis
1) The antiderivative shows no sign of irregularity like jumps
ia = Integrate[(1 - x^(-1/5))/(1 - x), x]
(* Out[15]= -5 RootSum[
1 + #1 + #1^2 + #1^3 + #1^4 &, (Log[x^(1/5) - #1] #1^3)/(
1 + 2 #1 + 3 #1^2 + 4 #1^3) &] *)
The difference of the values at the borders is ok.
(ia /. x -> 1) - (ia /. x -> 0);
% // N
(* Out[1722]= -0.387793 + 0. I *)
2) The integral with a variable upper limit shows several branch cuts
iy[y_] = Integrate[(1 - x^(-1/5))/(1 - x), {x, 0, y},
Assumptions -> 0 < y < 1]
(*
Out[2]= -(-1)^(1/5) Log[1 + (-y)^(1/5)] +
Log[1 - y^(1/5)] + (-1)^(2/5) Log[1 - (-1)^(2/5) y^(1/5)] - (-1)^(3/5)
Log[1 + (-1)^(3/5) y^(1/5)] + (-1)^(4/5) Log[1 - (-1)^(4/5) y^(1/5)] -
Log[1 - y]
*)
which leads to difficulties with the values at y=1
% /. y -> 1
(* Out[3]= Indeterminate *)
iy[1]
(* Out[4]= Indeterminate *)
But it works with the limit:
Limit[iy[y], y -> 1]
(* Out[12]= -Log[5] - (-1)^(1/5) Log[1 + (-1)^(1/5)] + (-1)^(2/5)
Log[1 - (-1)^(2/5)] - (-1)^(3/5) Log[1 + (-1)^(3/5)] + (-1)^(4/5)
Log[1 - (-1)^(4/5)] *)
% // N
(* Out[14]= -0.387793 - 1.11022*10^-16 I *)
It also works numerically close to 1:
iy[1. - 10^-6]
(* Out[24]= -0.387793 - 3.33067*10^-16 I *)
Integrate[(1 - x^(-1/5))/(1 - x), {x, 0, 1}, PrincipalValue -> True] // Simplify
works. $\endgroup$Integrate
resolve the correct branch(es). I have also observed that it does not always work. So if the integral is meant to be completely real, I thought inserting a real waypoint between 0 and 1 might help. Alternatively, it splits the branch point from the singular point (PrincipalValue
probably does this, too). That might also be the reason. $\endgroup$1/2 Sqrt[1 + 2/Sqrt[5]] \[Pi] - 1/2 Sqrt[5] ArcCoth[Sqrt[5]] - ( 5 Log[5])/4
though $\endgroup$