15
$\begingroup$

The command

Integrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}]

produces

ConditionalExpression[0, a == 0]

which is not correct in view of

Integrate[1, {x, -Pi, Pi}]

2 π

The result should be equal to $2\pi$ for each complex number $a$. The question arises: is there a workaround for this integral?

$\endgroup$
  • 2
    $\begingroup$ Can we consider this a bug? $\endgroup$ – Αλέξανδρος Ζεγγ Sep 17 '18 at 8:27
  • 1
    $\begingroup$ Integrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}, Assumptions -> a == 0] ? $\endgroup$ – Mariusz Iwaniuk Sep 17 '18 at 9:07
  • $\begingroup$ @Mariusz Iwaniuk: Thank you. Unfortunately, this works only for $a=0$. Tha command Integrate[Exp[aExp[Ix]], {x, -Pi, Pi}, Assumptions -> Re[a] != 0] outputs $0$. $\endgroup$ – user64494 Sep 17 '18 at 11:24
  • $\begingroup$ @Mariusz Iwaniuk:: The parameter $a$ is assumed to be complex, so $a \neq 0 $ is not equivaltnt to $ a>0 \vee a < 0$. $\endgroup$ – user64494 Sep 17 '18 at 15:14
  • $\begingroup$ Rubi returns zero as well. $\endgroup$ – b.gates.you.know.what Sep 18 '18 at 7:12
13
$\begingroup$

One workaround is to shift the main computation from integration to summation. Start from Taylor series for a and get a general SeriesCoefficient, which is much simpler and integrates nicely:

Integrate[SeriesCoefficient[Exp[a Exp[I x]], {a, 0, n}], {x, -Pi, Pi}]

enter image description here

We switched the order of summation and integration. Now what is left is to sum back:

Sum[(2 Sin[n π])/(n n!) a^n,{n,0,∞}]
Out[]= 2 π

This is also quite clear from the fact that for all n>=0 all terms are zero. And the only contributing n=0 term is equal to:

Limit[(2 Sin[n π])/(n n!) a^n,n->0]

Out[]= 2 π

| improve this answer | |
$\endgroup$
  • $\begingroup$ Please notice that your sum has only one contribution, the term corresponding to n=0. $\endgroup$ – b.gates.you.know.what Sep 17 '18 at 10:18
  • $\begingroup$ @b.gatessucks yep, I added it for clarity. I think OP wants Mathematica to figure it out automatically in the least number of steps :-) $\endgroup$ – Vitaliy Kaurov Sep 17 '18 at 11:08
  • $\begingroup$ The only place I dislike is Limit[(2 Sin[n π])/(n n!) a^n,n->0] =2*Pi. $\endgroup$ – user64494 Sep 17 '18 at 11:29
  • $\begingroup$ I find SeriesCoefficient[Exp[a Exp[I x]], {a, 0, 0}] to be a better way. $\endgroup$ – user64494 Sep 17 '18 at 11:35
  • $\begingroup$ It should be noticed that the workaround suggested by you does not fix the bug. $\endgroup$ – user64494 Sep 17 '18 at 11:40
6
$\begingroup$

One can use the fact that:

D[Exp[a Exp[I x]], x ] === I a D[Exp[a Exp[I x]], a ]
(* True *)

to integrate by parts and get zero: $$int(a) \equiv \int_{-\pi}^{\pi} dx\ e^{a\ e^{i\ x}}$$ \begin{eqnarray*} \frac{d}{d a} int(a) & = & \int_{-\pi}^{\pi} dx\ e^{i\ x}\ e^{a\ e^{i\ x}} \\ & = & \frac{1}{i a} \int_{-\pi}^{\pi} dx\ \frac{d}{dx} e^{a\ e^{i\ x}} \\ & = & \frac{1}{i a}\ \left[e^{a\ e^{i\ x}} \right]_{-\pi}^{\pi} \\ & = & 0 \end{eqnarray*}

Therefore, at least to first order in a, the integral is independent of a and equal to the value at a=0, i.e. 2 Pi.

| improve this answer | |
$\endgroup$
  • $\begingroup$ Can you elaborate " the integral is independent of a" in details? $\endgroup$ – user64494 Sep 17 '18 at 11:32
  • $\begingroup$ @user64494 The precedure above proves that the first derivative of the integral with respect to a vanishes. I think it could be proven along the same lines that also higher order derivatives vanish, therefore the integral is a constant function (as you expected). $\endgroup$ – b.gates.you.know.what Sep 17 '18 at 11:50
  • $\begingroup$ @b.gatessucks : Integration by parts gives \!\( \*SubsuperscriptBox[\(\[Integral]\), \(-\[Pi]\), \(\[Pi]\)]\(Exp[ a\ Exp[I\ x]] \[DifferentialD]x\)\) = \!\( \*SubsuperscriptBox[\(\[Integral]\), \(-\[Pi]\), \(\[Pi]\)]\( \*FractionBox[\(1\), \(I\ a\)] \((Exp[ a\ Exp[I\ x]])\)' \[DifferentialD]x\)\) = 1/(I a) (Exp[a Exp[I \[Pi]]] - Exp[a Exp[-I \[Pi]]]) \!\(\*OverscriptBox[\(=\), \(?\)]\) 0 seems to confirm the MMA result? Where is my mistake? $\endgroup$ – Ulrich Neumann Sep 17 '18 at 13:24
  • $\begingroup$ @UlrichNeumann Please see edit. I think that the integral equals 2 \Pi and that Mathematica has a bug. $\endgroup$ – b.gates.you.know.what Sep 17 '18 at 14:06
  • $\begingroup$ @b.gatessucks Thanks for the edit, very tricky, now I got it! But still I cannot find the error in the conclusion of my comment (sorry, I don't know how to bring it in a nicer shape). $\endgroup$ – Ulrich Neumann Sep 17 '18 at 14:14
5
$\begingroup$

The issue here can be identified by evaluating the indefinite integral,

s = Integrate[Exp[a*Exp[I*x]], x]
(* -I ExpIntegralEi[a E^(I x)] *)

Now,

(s /. x -> Pi) - (s /. x -> -Pi)
(* 0 *)

The catch is that ExpIntegralEi[z] has a branch cut, extending along the negative real axis from zero to negative infinity. So, the correct way to apply the limits, at least for a > 0, is

Limit[s, x -> Pi, Direction -> "FromBelow", Assumptions -> a > 0] - 
    Limit[s, x -> -Pi, Direction -> "FromAbove", Assumptions -> a > 0]
(* 2 π *)

as desired. I presume, but have not tried to prove, that employing the proper Limit options will yield the desired result for all a. Certainly,

Integrate[Exp[(-141/10 + 397/100 I) Exp[I*x]], {x, -Pi, Pi}]

and every other specific value of a I have tried yields 2 π.

| improve this answer | |
$\endgroup$
2
$\begingroup$

Strange behavior.

$Assumptions = a \[Element] Reals

Integrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}]
(*ConditionalExpression[0, a >= 0]*)

Integrate[Exp[a*Exp[I*x]] // ExpToTrig, {x, -Pi, Pi}]
ConditionalExpression[2*Pi, a >= 0]

I would think both should be the same, but no. Also

$Assumptions = a > 0

Integrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}]
(*2*Pi*)
| improve this answer | |
$\endgroup$
1
$\begingroup$

A workaround could be the numerical evaluation

int[a_?NumericQ] := NIntegrate[Exp[a*Exp[I*x]], {x, -Pi, Pi}]
{int[0], int[1], int[I]} // Chop
{6.28319, 6.28319, 6.28319}
| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you. However, a symbolic result is requiered. $\endgroup$ – user64494 Sep 17 '18 at 8:38

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.