1
$\begingroup$

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}]

Simple sinc integration

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}]

Analytic sinc integration

The singularity at zero seems to be a problem. There is a phase jump of $\pi$.

My question is twofold now:

  1. How to obtain the correct result?
  2. 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).

$\endgroup$
  • $\begingroup$ 1. You are aware that Sinc[] is built-in, right? 2. If you set t > 0 in the assumptions, then t ∈ Reals is implied, and superfluous. $\endgroup$ – J. M. is away Dec 9 '15 at 5:59
  • $\begingroup$ I do, but Mathematica uses $\sin(t)/t$ instead of $\sin(\pi t)/(\pi t)$ ... $\endgroup$ – divB Dec 9 '15 at 7:05
  • $\begingroup$ I actually suspect it has something to do with integrating over the singularity. I can derive a function $\operatorname{E_1'}(z) = \operatorname{E_1}(z) + j\pi(\operatorname{sgn}(\Im\{z\})-1)/2 - j\pi(\operatorname{sgn}(\Re\{z\})+1)/2$ which seems to give the right result always. I suspect 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$ – divB Dec 9 '15 at 8:09
  • $\begingroup$ @divB If $\sinc(t)=\sin(t)/t$ then $\sinc(\pi t)=\sin(\pi t)/(\pi t)$ is what you want. $\endgroup$ – QuantumDot Dec 9 '15 at 8:18
2
$\begingroup$

This is an extended comment, not a solution. If you evaluate

Integrate[Sin[τ π]/(τ π), {τ, -n, t - n}] /. n -> 1

you get

(* SinIntegral[π]/π + SinIntegral[π (-1 + t)]/π *)

so I'm a little unclear what you're actually trying to do here? Isn't SinIntegral just as "analytic" as the ExpIntegralEi's?


Nonetheless, I'm not sure what the problem is in your code, exactly. I suspect that it's the way you are trying to do the integral, in the sense that you might have to choose different choices for the exponential function to integrate against before you set a to 0.

Let's do some investigations, anyway. First of all, if we collapse all of your Assumptions into 1, we do get a ConditionalExpression:

SincInt = 
  Assuming[{n ∈ Reals, τ ∈ Reals, a ∈ Complexes, t ∈ Reals, t > 0}, 
    Integrate[Sin[π*τ]/(π*τ)*Exp[a*τ], {τ, -n, t - n}]
   ] /. a -> 0

enter image description here

Setting n == 1, we can see that when t hits 1, there is a problem. If I just naively plot this function versus plotting the innards without the ConditionalExpression, I get this:

GraphicsRow@{
  Plot[SincInt /. n -> 1, {t, -10, 10}, PlotRange -> All], 
  Plot[First@SincInt /. n -> 1, {t, -10, 10}, PlotRange -> All]
 }

enter image description here

We can see that the plot stops at n == 1, as it should, but if we extract the function from the ConditionalExpression, we get the π-phase jump, as you noticed.

Finally, let's note that

Limit[SincInt, n -> 1] // Expand
(* ConditionalExpression[SinIntegral[π]/π - SinIntegral[π - π t]/π, t <= 1] *)

and

Plot[Evaluate[Limit[SincInt, n -> 1]], {t, -10, 10}, PlotRange -> All]

yields

enter image description here

The SinIntegral is of course the solution, as we mentioned before.

$\endgroup$
  • $\begingroup$ Hmm the main reason why I need to use complex exponentials (instead of SinIntegral) is that generally $a \neq 0$ (I just set $a=0$ here to have a simple example). Second, what is the difference between my nested assumptions and the collapsed version? Third, the expression does not give enough conditions... $\endgroup$ – divB Dec 9 '15 at 7:13
  • $\begingroup$ @divB. As far as I can tell nothing is different, other than that it's nicer looking: it still spits out the `ConditionalExpression1. What do you mean that it doesn't give enough conditions? $\endgroup$ – march Dec 9 '15 at 7:20
  • $\begingroup$ But that's exactly the thing, with my cascaded Assumptions I do not get a conditional expression! What I mean with enough conditions: The conditional expression above is only valid for $n>t$ or $n<0$. Say $n=2$. Then it is only valid for $t < 2$. What what for $t \geq 2$? $\endgroup$ – divB Dec 9 '15 at 7:32
  • $\begingroup$ As for you first point: I copy-and-pasted your code directly into my copy of Mathematica 10.0, and it spit out the same ConditionalExpression as the version I used in my "answer", so maybe you have lingering definitions or something? As for the second, all I can say is that dealing with complex-valued functions in a computer algebra system is hard (which is to say, I don't know what the problem is). $\endgroup$ – march Dec 9 '15 at 7:37
  • $\begingroup$ Interesting. How can that be? Just opened a new instance and: snag.gy/jkn5L.jpg (without setting $a=0$: snag.gy/UqfKn.jpg) $\endgroup$ – divB Dec 9 '15 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.