# Strange Integral Calculation With Traditional Form

I must be doing something wrong.

I define the following integral:

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:

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:

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.

• put the inner integral in parantheses? – kglr Dec 7 '18 at 20:02
• @kglr I tried it. It give the same wrong answer. – james Dec 7 '18 at 20:04
• I get the desired result in version 11.3 (windows 10 - 64-bit). – kglr Dec 7 '18 at 20:05
• 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. – kglr Dec 7 '18 at 20:23
• 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}]. – bill s Dec 7 '18 at 21:27