# Still bug in Integrate. 3

Let us consider in version 13.1 on Windows 10

r = Integrate[1/(x - a)/Sqrt[1 - x^2], {x, -1, 1},
Assumptions -> a \[Element] Reals]


ConditionalExpression[-(( 2 (ArcCot[(1 - a)/Sqrt[-1 + a^2]] - ArcCot[(1 + a)/Sqrt[-1 + a^2]]))/Sqrt[-1 + a^2]), a > 1]

r /. a -> 2


\[Pi]/Sqrt[3]

, but

NIntegrate[1/(x - 2)/Sqrt[1 - x^2], {x, -1, 1}]


-1.8138

That bug was submitted by me in February, 2018, when the output of r

ConditionalExpression[-((\[Pi] Abs[a])/(a Sqrt[-1 + a^2])), a >= 1 || a <= 0]

was incorrect too. Is there a workaround for r?

• MMA v12.2 (Windows10) evaluates both integrals correctly. Nov 15 at 7:22
• @UlrichNeumann: Thank you. Therefore, this is a regression. What is the second one of your "both"? Nov 15 at 7:39
• int[a_?NumericQ] := NIntegrate[1/(x - a)/Sqrt[1 - x^2], {x, -1, 1}] Nov 15 at 7:40
• @UlrichNeumann: That was OK in 2018. Nov 15 at 7:50
• This is a thorny problem. It came about due to a change in the antiderivative that in turn has a parametrized singularity that in turn gives Limit trouble. If one explicitly provides Assumptions->a>1 then Limit will find the appropriate results as it approaches from each side of the parametrized singularity. But at the point where this computation occurs it instead has deduced a<0||a>1 with the further stipulation a>0 (thus a>1) arising later. With the conjunction it does not get the right limit, and fails to recognize this. Nov 15 at 19:24

Workaround:

\$Version
(*"13.1.0 for Microsoft Windows (64-bit) (June 16, 2022)"*)


I

(*Works for: a > 1 || a < -1*)

r = InverseMellinTransform[Integrate[
MellinTransform[1/(x - a)/Sqrt[1 - x^2], a, s], {x, -1, 1},
Assumptions -> {s > 0, a \[Element] Reals}], s, a] // Expand
r /. a -> 2 // N
(*-1.8138*)


II

(*Works for: a > 1*)

r = LaplaceTransform[Integrate[InverseLaplaceTransform[1/(x - a)/Sqrt[1 - x^2], a, s], {x, -1, 1},
Assumptions -> s > 0], s, a]
r /. a -> 2 // N
(*-1.8138*)


III

(*Works for: a > 1 || a < -1*)

r = ZTransform[Integrate[
InverseZTransform[1/(x - a)/Sqrt[1 - x^2], a, s], {x, -1, 1},
Assumptions -> Re[s] > 0], s, a] // FullSimplify
r /. a -> 2 // N
(*-1.8138*)


IV

(*Works for: a > 1*)

r = (IntegrateChangeVariables[
Inactive[Integrate][1/(x - a)/Sqrt[1 - x^2], {x, -1, 1}], t,
t == x - a] // Activate)[[1]]
r /. a -> 2 // N
(*-1.8138 + 0. I*)


V

(*Works for: a > 1 || a < -1*)

r = Sum[Integrate[
SeriesCoefficient[1/(b*x - a)/Sqrt[1 - x^2], {b, 0, j}][[1, 1,
1]], {x, -1, 1}][[1]], {j, 0, Infinity}] // FullSimplify
r /. a -> 2 // N
(*-1.8138*)


VI

(*Works for: a > 1 *)

r = Integrate[1/(x - a)/Sqrt[1 - x^2], {x, -1, 1}, Assumptions -> a > 1]
r /. a -> 2 // N
(*-1.8138*)

• I am out of MMA at the present so I will give my response later. Nov 15 at 16:41
• V. I begin from the end. I see a mistake there: in Sum[Integrate[ SeriesCoefficient[1/(b*x - a)/Sqrt[1 - x^2], {b, 0, j}][[1, 1, 1]], {x, -1, 1}][[1]], {j, 0, Infinity}]  the multiplier b^j is omitted. If you put b==1, then the convergence of the series at this point must be grounded. My conclusion - V fails. Thank you anyway. Nov 16 at 5:57
• IV. It's clear that the change t == x - a does nothing. The command Activate[ IntegrateChangeVariables[ Inactive[Integrate][1/(x - a)/Sqrt[1 - x^2], {x, -1, 1}], t, t == x - a]] produces ConditionalExpression[(2 I (ArcTanh[(-1 + a)/Sqrt[-1 + a^2]] - ArcTanh[(1 + a)/Sqrt[-1 + a^2]]))/Sqrt[-1 + a^2], Re[(-1 - a)/Sqrt[-1 + a^2]] == 0 && Re[(I - a)/Sqrt[-1 + a^2]] == 0 && (Re[a] < -1 || Re[a] > 1 || a \[NotElement] Reals)], The condition is omtted by you. The condition Re[(I - a)/Sqrt[-1 + a^2]] == 0 is not valid for a==2. Conclusion - IV is a fake. Nov 16 at 6:24
• @user64494 (1) Your claim that "@ does not work" is generally nonsense. If it's not working for you, find a new keyboard. (ii) Some or all of the claimed methods should follow from the method of differentiating or integrating an integral with respect to a parameter. Roughly speaking, one has a pair of operators that commute because they operate with respect to distinct variables. Nov 17 at 21:04
• @user64494 you don't need to '@' the OP, Mariusz will be notified. Anyway, I am here because it was auto flagged with too many comments, I am not obliged to check maths here so let me ask, can we compile this discussion to a single comment or an edit with a disclaimer that presented workarounds have different 'assumptions'? With or without a response to that which confirms or denies it? DanielLichtblau what do you think?
– Kuba
Nov 17 at 21:39