# Contour integral does not converge

I have this integral where I want to evaluate it on the imaginary axis. However, it says that it does not converge even though I have introduced a small indentation $$a$$,

function[z_] := 1/(Sinh[z/2] Sqrt[Cosh[z]])
integ[a_] = Integrate[function[z], {z, a I,-a I + Pi I/2}, Assumptions -> a > 0]
Integrate::idiv: Integral of Csch[z/2]/Sqrt[Cosh[z]] does not converge on {I a,-I a+(I \[Pi])/2}.


I believe this should give me an integral as a function of the indentation $$a$$.

• It does give a result in Mathematica 12.3.1. Jul 24, 2021 at 8:33
• 12.3.1 give a result. 2 (-ArcCoth[Csc[1/4 (2 a + \[Pi])] Sqrt[Sin[a]]] + ArcTanh[Cos[a/2] Sqrt[Sec[a]]]) Jul 24, 2021 at 8:36
• @cvgmt Wow, I verified it in 12.3, it indeed produces the result. I only have 12.1, so why does this become an issue? I don't think this is some complicated calculation that should have any difference. Jul 24, 2021 at 9:13

## 1 Answer

\$Version

(* "12.1.1 for Mac OS X x86 (64-bit) (June 19, 2020)" *)

Clear["Global*"]

function[z_] := 1/(Sinh[z/2] Sqrt[Cosh[z]])


Add assumuptions

integ[a_] = Assuming[0 < a < Pi/2,
Integrate[function[z], {z, a I, -a I + Pi I/2}]]

(* 2 (ArcTanh[Cos[a/2] Sqrt[Sec[a]]] -
ArcTanh[Sin[1/4 (2 a + π)]/Sqrt[Sin[a]]]) *)


Verifying that this is equivalent to results from v12.3

integ[a] ==
2*(-ArcCoth[Csc[(1/4)*(2*a + Pi)]*Sqrt[Sin[a]]] +
ArcTanh[Cos[a/2]*Sqrt[Sec[a]]]) // FullSimplify

(* True *)

Plot[integ[a], {a, 0, Pi/2}]


integ[Pi/4]

(* 0 *)
`