TransWikia.com

Mathematica returns incorrect evaluation of integral

Mathematica Asked by ComptonScattering on June 26, 2021

Consider the integral
$$
begin{equation}
u(x):= lim_{eta to 0^+}int_{-infty}^infty frac{d s}{s^2 + 1} left(
frac{1}{x – i eta – sqrt{s^2 + 1}}

frac{1}{x – i eta + sqrt{s^2 + 1}} right)
.
end{equation}
$$

for $x in mathbb{R}$.

Mathematica will evaluate this integral without complaint

In[] : = Assuming[x [Element] Reals && [Eta] > 0, Limit[Integrate[1/(s^2 + 1) (1/(x - I [Eta] - Sqrt[s^2 + 1]) - 1/(x - I [Eta] + Sqrt[s^2 + 1])), {s, -[Infinity], [Infinity]}], [Eta] -> 0, Direction -> "FromAbove"]]

and returns
$$
u_mathrm{MMA}(x) = -frac{4 arccosleft(sqrt{1-x^2}right)}{left| xright| sqrt{1-x^2} }
$$

However this answer cannot be correct, it is an even function ($u(-x) = u(x)$), whereas the definition manifestly has the propery $u(-x) = u(x)^*$ (this can be confirmed using NIntegrate for small finite values of $eta$). I.e. both the real and imaginary parts of $u_mathrm{MMA}(x)$ are even, when the imaginary part should be odd.

Is there a way of getting Mathematica to return the correct answer for these types of integral?

One Answer

The issue appears to be that Mathematica is handling the assumptions concerning x incorrectly. If you explicitly tell it that $x < -1$, $|x| leq 1$, or $x > 1$, it produces three slightly different functional forms:

ulow[x_] = Assuming[x < -1 && [Eta] > 0, ... ]
umid[x_] = Assuming[1 > x > -1 && [Eta] > 0, ... ]
uhigh[x_] = Assuming[1 < x && [Eta] > 0, ... ]

(* (4 I ([Pi] + ArcSin[x]))/(x Sqrt[-1 + x^2]) *)
(* -((4 ArcCos[Sqrt[1 - x^2]])/Sqrt[x^2 - x^4]) *)
(* (4 I ArcSin[x])/(x Sqrt[-1 + x^2]) *)

So if desired, we can assemble these into a Piecewise function that works for all x:

u[x_] := Piecewise[{{ulow[x], x< -1}, {umid[x], -1 <= x <= 1}, {uhigh[x], x > 1}}] 
Plot[Evaluate[ReIm[u[x]]], {x, -Pi, Pi}]

enter image description here

This does appear to have the property that $Re(u(x))$ is even in $x$ and $Im(u(x))$ is odd in $x$.

Answered by Michael Seifert on June 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP