# Incorrect limit in complex quantity

I have the following quantity

$$f = \frac{\exp(\sqrt{-k^2-i\epsilon}d)}{\sqrt{-k^2-i\epsilon}}$$

and form the limit as $$\epsilon\to0$$. Mathematica does not produce the correct result.

Code:

f = -(E^(Sqrt[-k^2 - I ϵ] d)/Sqrt[-k^2 - I ϵ]);

g1 = Limit[f, ϵ -> 0, Direction -> "FromAbove",
Assumptions -> Element[{k}, Reals] && ϵ >= 0];
g2 = Limit[f, ϵ -> 0, Direction -> "FromAbove",
Assumptions -> Element[{k}, Reals] && ϵ >= 0 && k > 0];


The second one gives the correct result for positive $$k$$, the first one yields the complex conjugate. Of course this is related to various branch cut things, but I am very surprised that the assumption $$k>0$$ would yield any difference, since only $$k^2$$ appears in the equation.

By "correct result" I mean the limit as $$\epsilon\to0^+$$. I can take e.g. $$\epsilon=10^{-10}$$ and get a result that agrees with the $$g_2$$ up to errors of $$\mathcal O(10^{-10})$$, but not with $$g_1$$.

• Remove the assumptions \[Epsilon] >= 0 (because "Limit::alimv: Warning: Assumptions that involve the limit variable are ignored.") The results g1 , g2 are both correct. Mar 23, 2020 at 15:17
• the math formula and the MMA code are different ($k$ vs $k^2$). Also, what is the expected output? what is the "correct result" you are after? Is the limit understood in the sense of distributions? MMA cannot handle that, so don't expect it to. Mar 23, 2020 at 15:26
• Thanks for the comment. It is supposed to be $k^2$ everywhere. I have made more precise what I mean by "correct" result. Mar 23, 2020 at 15:30
• Note that Direction->"FromAbove" is in contradiction with \[Epsilon\>0. Mar 23, 2020 at 15:50
• @DanielLichtblau Maybe that's the origin of my confusion? I was under the impression that "FromAbove" would mean that epsilon is non-negative? In which case epsilon>=0 is true. Mar 23, 2020 at 16:15

This is definitely a bug, apparently Limit is playing fast and loose with exponentials of logs. I will file a bug. But the correct answer is to take the g1 and replace Abs[k] with -Abs[k].

FullSimplify[(g1 /. Abs[k] -> -Abs[k]) == g2, k > 0]
(*True*)


And if you defined g3 for k<0, you also find:

FullSimplify[(g1 /. Abs[k] -> -Abs[k]) == g3, k < 0]
(*True*)


BTW, you don't need the assumption k\[Element]Reals in g2 and g3. If you put an assumption with an inequality, both sides are assumed to be real.

The solution with Conjugate ... takes into acount, that k can be zero.

Let me give you an overview, that all solutions are true.

f = -(E^(Sqrt[-k^2 - I \[Epsilon]] d)/Sqrt[-k^2 - I \[Epsilon]]);

{{" ", " ", "k>0", "k<0"}, {"Direction\[Rule]1,k\[Element]Reals",
g1 = Limit[f, \[Epsilon] -> 0, Direction -> 1,
Assumptions -> Element[{k}, Reals]], Simplify[g1, k > 0],
Simplify[g1, k < 0]}, {"Direction\[Rule]-1,k\[Element]Reals",
g2 = Limit[f, \[Epsilon] -> 0, Direction -> -1,
Assumptions -> Element[{k}, Reals]], Simplify[g2, k > 0],
Simplify[g2, k < 0]}, {"Direction\[Rule]1,k\[Element]Reals,k!=0",
g3 = Limit[f, \[Epsilon] -> 0, Direction -> 1,
Assumptions -> Element[{k}, Reals] && k != 0],
Simplify[g3, k > 0],
Simplify[g3, k < 0]}, {"Direction\[Rule]-1,k\[Element]Reals,k!=0",
g4 = Limit[f, \[Epsilon] -> 0, Direction -> -1,
Assumptions -> Element[{k}, Reals] && k != 0],
Simplify[g4, k > 0], Simplify[g4, k < 0]}, {"Direction\[Rule]1", " ",
g5 = Limit[f, \[Epsilon] -> 0, Direction -> 1,
Assumptions -> k > 0],
g6 = Limit[f, \[Epsilon] -> 0, Direction -> 1,
Assumptions -> k < 0]}, {"Direction\[Rule]-1", " ",
g7 = Limit[f, \[Epsilon] -> 0, Direction -> -1,
Assumptions -> k > 0],
g8 = Limit[f, \[Epsilon] -> 0, Direction -> -1,
Assumptions -> k < 0]}} // Grid[#, Frame -> All] & You deal with a complex-valued function so the Direction->Complexes option does the job:

Limit[Exp[Sqrt[-k^2 - I*\[Epsilon]]*d]/Sqrt[-k^2 - I*\[Epsilon]],
\[Epsilon] -> 0, Direction -> Complexes,GenerateConditions->True]
(* ConditionalExpression[E^(d Sqrt[-k^2])/Sqrt[-k^2], k != 0 && Im[k^2] != 0]*)


Addition. The same result is produced by

Limit[Exp[Sqrt[-k^2 - I*\[Epsilon]]*d]/Sqrt[-k^2 - I*\[Epsilon]], \[Epsilon] -> 0,GenerateConditions->True]

• If the limit exists, then so do the directional limits and the results are equal. Mar 23, 2020 at 19:44
• Direction->Complexes is not relevant to this problem. Limit doesn't show the conditions for by default, but if you add GenerateConditions->True, you'll see that this result is only valid for non-real and non-pure-imaginary k. Mar 24, 2020 at 7:08
• @Itai Seggev: Thank you for your valuable comment. Fixed. Mar 24, 2020 at 7:31
• @Itai Seggev: Maple confirms E^(d Sqrt[-k^2])/Sqrt[-k^2] without any conditions. Maple says there is no branch cut at the origin if $\epsilon=\frac 1 {100}$. See dropbox.com/s/zrz5idxw2xfbg7r/limit.pdf?dl=0 . Mar 24, 2020 at 13:18
• There is a branch cut for $k$ real. You can see this by comparing, for example With[{f = f /. k -> 1 /. d -> 1}, ComplexPlot3D[f, {\[Epsilon], 1}]] and With[{f = f /. k -> 1+1 /. d -> 1}, ComplexPlot3D[f, {\[Epsilon], 1}]]. Also {f, -(E^(d Sqrt[-k^2])/Sqrt[-k^2])} /. d -> 1. /. k -> 1 /. \[Epsilon] -> 10.^-10 shows that the generic result is wrong for real $k$. Mar 24, 2020 at 18:27