I would like to analytically integrate the sinc function. First of all, if I just perform the integration the following way, everything is as expected:
Plot[Integrate[
Sin[τ π]/(τ π), {τ, -n, t - n}] /.
n -> 1, {t, -1, 10}]
As a next step I want to analytically perform the integration. The expression will later have an Exp
within the integral. So to avoid that Mathematica expresses the result as sine integral but rather exponential integral, I add the Exp
term and set the exponent to zero afterwards:
SincInt = Assuming[n ∈ Reals,
Assuming[τ ∈ Reals,
Assuming[a ∈ Complexes,
Assuming[t ∈ Reals,
Assuming[t > 0,
Integrate[
Sin[π τ]/(π τ) Exp[a τ] , {τ, -n,
t - n}]]]]]] /. a -> 0
By adding all the assumptions I make sure to get no conditional expression (and hence no ambiguity) which is indeed the case:
(I (ExpIntegralEi[-I n π] - ExpIntegralEi[I n π] -
ExpIntegralEi[-I π (n - t)] +
ExpIntegralEi[I π (n - t)]))/(2 π)
Now I plot the same thing using this expression and get:
Plot[SincInt /. n -> 1, {t, -1, 10}]
The singularity at zero seems to be a problem. There is a phase jump of $\pi$.
My question is twofold now:
- How to obtain the correct result?
- If the result is not unique, why does Mathematica not present some conditional expressions and lets me believe everything is fine?
(At first I thought it has to do with $\operatorname{Ei}(z)$ (ExpIntegralEi
) but after verifying with Convert an expression to use a specific analytic form, I see that the same problem occurs when expressing the result as $\operatorname{E}_1(z)$ (ExpIntegralE
).
Sinc[]
is built-in, right? 2. If you sett > 0
in the assumptions, thent ∈ Reals
is implied, and superfluous. $\endgroup$ExpIntegralE
does select a branch cut to avoid the singularity, hence the residue $j\pi$ needs to be added back somehow. But I do not understand exactly how and why Mathematica gives me an explicit, unconditional expression which is wrong. $\endgroup$