Difference between the following integrals....

*To*: mathgroup at smc.vnet.net*Subject*: [mg66134] Difference between the following integrals....*From*: "ashesh" <ashesh.cb at gmail.com>*Date*: Sun, 30 Apr 2006 04:21:59 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Hi all, Would like to integrate Abs[x]*(x+3y^2) for {x,-2,2} and {y,-1,2}. Have four different ways of doing this integration as follows: f1 = Abs[x](x + 3y y); Integrate[f3, {x, -2, 2}, {y, -1, 2}] f2[a_, b_] := Piecewise[{{a*(a + 3*b*b), a > 0}, {-a*(a + 3*b*b), a < 0}}] ii = Integrate[f2[a, b], {a, -2, 2}, {b, -1, 2}] f3[p_, q_] := Which[p < 0, -p*(p + 3*q*q), p > 0, p*(p + 3*q*q)] Integrate[f3[p, q], {p, -2, -2}, {q, -1, 2}] f4 = int_m_-2^0 int_n_-1^2 (-m*(m+3n^2)) dn dm + int_m_-2^0 int_n_-1^2 (m*(m+3n^2)) dn dm Answers: f1 = 36 f2 = 36 f3 = 0 f4 = 36 As I understand all these 4 are performing the same operation, but why does f3 become = 0. Hope some one can give me an insight into the mistake (please identify the mistake too for me) I am making here. Regards.