Integrate[Piecewise] Confusion
- To: mathgroup at smc.vnet.net
- Subject: [mg105817] Integrate[Piecewise] Confusion
- From: Derek Yates <yatesd at mac.com>
- Date: Sun, 20 Dec 2009 06:54:52 -0500 (EST)
I expected to get the same result from the following two expressions: (1) Integrate[Piecewise[{{20, 0 < x <= 2}, {40, 2 < x}}], x] which results in Piecewise[{{0, x <= 0}, {20 x, 0 < x <= 2}}, -40 + 40 x] (2) Change the 2 to be the variable a, and then replace it in the subsequent result Integrate[Piecewise[{{20, 0 < x <= a}, {40, a < x}}], x] /. a -> 2 which results in Piecewise[{{20 x, x > 0 && 2 - x >= 0}, {40 x, 2 - x < 0}}] So for the case when x > 2, version (1) gives 40x - 40 (which seems to be the right answer to me), but version (2) gives 40x. I presume I have overlooked something obvious here, but would be most grateful if somebody could enlighten me.