Does the order of the variables in double integral matter?

87 Views Asked by At

Given $\displaystyle\iint_D x \mathrm{d}x \mathrm{d}y$ and D = {$(x,y)\in\mathbb{R}^2: -2 \leq x \leq 2, 0 \leq y \leq 2$}

So I have learned that the order doesn't matter but look here:

$$\iint_D x\; \mathrm{d}x \mathrm{d}y= \int_0^2 \left[\frac{x^2}2 \right]_{x=-2}^{x=2} \mathrm{d}y = \int_0^2 (2-2) \mathrm{d}y = \int_0^2 (0) \mathrm{d}y = c$$

$$\iint_D x\; \mathrm{d}y \mathrm{d}x= \int_{-2}^2 \left[xy \right]_{y=0}^{y=2} \mathrm{d}y = \int_{-2}^2 (2x) \mathrm{d}x = [x^2]_{x=-2}^{x=2} = 4 - 4 = 0$$

So as you can see I get two different answers, I know since c is a constant it can be 0 but it says that the answer is 0, but it is something I can determine by integrating with respect to x first which means the order somewhat matters?. Assuming I did it correctly, if I get a constant c after integrating do I need to change the order and check wether I get something else? In that case why?