1
$\begingroup$

I must be doing something wrong.

I define the following integral: enter image description here

The code:

\!\(
\*SubsuperscriptBox[\(\[Integral]\), \(\(-W\)/2\), \(W/2\)]\(
\*SubsuperscriptBox[\(\[Integral]\), \(\(-L\)/2\), \(L/2\)]a[
    x]\ \[DifferentialD]x\ \[DifferentialD]y\)\)

...and I get:W a[x] as a result ??

It should be:

enter image description here

since a[x] is a undefined function of x.

EDIT: If I input it using the "Input Form" and not the "traditional form":

Integrate[Integrate[a[x], {x, -L/2, L/2}], {y, -H/2, H/2}]

Mathematica understands it, and I get the correct result.

Why is that ?

EDIT 2: Putting it into parenthesis does not help:

enter image description here

EDIT 3: Putting the paranthesis around the inner integral, solves the problem, but I don't understand why I have to do that. Mathematica should automatically see that where the integral starts and ends.

enter image description here

$\endgroup$
  • $\begingroup$ put the inner integral in parantheses? $\endgroup$ – kglr Dec 7 '18 at 20:02
  • $\begingroup$ @kglr I tried it. It give the same wrong answer. $\endgroup$ – james Dec 7 '18 at 20:04
  • $\begingroup$ I get the desired result in version 11.3 (windows 10 - 64-bit). $\endgroup$ – kglr Dec 7 '18 at 20:05
  • 1
    $\begingroup$ Integral >> Details and Options: Multiple integrals use a variant of the standard iterator notation. The first variable given corresponds to the outermost integral and is done last. $\endgroup$ – kglr Dec 7 '18 at 20:23
  • 1
    $\begingroup$ Compare Integrate[a[x], {x, -L/2, L/2}, {y, -H/2, H/2}] with Integrate[a[x], {y, -H/2, H/2}, {x, -L/2, L/2}]. $\endgroup$ – bill s Dec 7 '18 at 21:27

Your Answer

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

Browse other questions tagged or ask your own question.