1
$\begingroup$

Integrate[Integrate[Abs[Exp[2*Pi*I*x] + Exp[2*Pi*I*y]], {x, 0, 1}], {y, 0, 1}] yields 0 as result.

This cannot be correct, because the integrand is positive and nonzero in the indicated region.

Wolfram Alpha sais: Standard computation time exceeded, so I do not know if there the same comes out.

Any idea what is going on?

$\endgroup$
2
$\begingroup$

You can express the integrand in a different way :

FullSimplify[ComplexExpand[Abs[Exp[2*Pi*I*x] + Exp[2*Pi*I*y]], TargetFunctions -> {Re, Im}]]
(* 2 Sqrt[Cos[\[Pi] (x - y)]^2] *)

Now

Integrate[2 Sqrt[Cos[\[Pi] (x - y)]^2], {x, 0, 1}]
(* 0 *)

but

Integrate[2 Abs[Cos[\[Pi] (x - y)]], {x, 0, 1}, {y, 0, 1}]
(* 4/\[Pi] *)

NIntegrate[Abs[Exp[2*Pi*I*x] + Exp[2*Pi*I*y]], {x, 0, 1}, {y, 0, 1}]
(* 1.27324 *)

So the square root seems to be the root of the problem.

$\endgroup$
  • 1
    $\begingroup$ Since the integral is on the unit square, just include the assumptions {0<=x<=1, 0<=y<=1} in Simplify. expr = Abs[Exp[2*Pi*I*x] + Exp[2*Pi*I*y]] // ComplexExpand // Simplify[#, {0 <= x <= 1, 0 <= y <= 1}] & gives 2*Abs[Cos[Pi*(x - y)]] and, as you showed, Integrate[expr, {x, 0, 1}, {y, 0, 1}] gives 4/Pi. $\endgroup$ – Bob Hanlon Oct 31 '14 at 14:23
  • $\begingroup$ @BobHanlon Thanks. $\endgroup$ – b.gates.you.know.what Oct 31 '14 at 14:34
  • 1
    $\begingroup$ you need only the assumption Element[{x, y}, Reals] ( adding that assumption to Integrate does not fix the original anomaly though ) $\endgroup$ – george2079 Oct 31 '14 at 16:08
  • 1
    $\begingroup$ Integrate[ Simplify[ComplexExpand[ Abs[Exp[2*PiIx] + Exp[2*PiIy]]], {x, y} [Element] Reals], {x, 0, 1}, {y, 0, 1}] -> 4/pi $\endgroup$ – Dr. Wolfgang Hintze Oct 31 '14 at 21:14

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.