Re: Double integral of a piecewise-constant function

*To*: mathgroup at smc.vnet.net*Subject*: [mg61515] Re: Double integral of a piecewise-constant function*From*: Chris Rodgers <rodgers at physchem.NOSPAMox.aREMOVEc.uk>*Date*: Fri, 21 Oct 2005 00:38:00 -0400 (EDT)*Organization*: Oxford University, England*References*: <200510180644.CAA11181@smc.vnet.net> <dj4q2v$ipv$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

OK. Here is a simpler example where I try to integrate a piecewise-constant function in two dimensions. I define a very simple function ("testfunc") with constant values in 1x1 squares over the domain t[1] = 0 to 3 and t[2] = 0 to 3 with value zero elsewhere. I then proceed to integrate a triangular region of this surface, whose integral should be 1+2+3=6. I tried three different approaches: 1) Integrate[Integrate[testfunc, {t[2], 0, t[1]}], {t[1], 0, 3}] 2) Integrate[testfunc, {t[1], 0, 3}, {t[2], 0, t[1]}] 3) Integrate[ Integrate[testfunc, {t[2], 0, t[1]}, Assumptions -> t[1] \[Element] Reals], {t[1], 0, 3}] In (2) and (3), Mathematica succeeds, but in case (1) it doesn't. Why does Mathematica not understand that the dummy variable t[1] is Real in case (1)? Although this example is trivial, in the work that I am trying to do, it will be much more difficult to collect all the integrals together into a single term. Is there any way to make the inner Integrate(s) realise that t[1] is Real automatically? Can this be scaled up to the case where I have more than two Integrate's within one-another? Yours, Chris Rodgers. P.S. A workbook containing these formulae and a plot of "testfunc" is available at http://physchem.ox.ac.uk/~rodgers/MMA/Problem1.nb and a PDF showing the output is available at http://physchem.ox.ac.uk/~rodgers/MMA/Problem1.pdf

**Follow-Ups**:**Re: Re: Double integral of a piecewise-constant function***From:*Chris Chiasson <chris.chiasson@gmail.com>

**References**:**Double integral of a piecewise-constant function***From:*Chris Rodgers <rodgers@physchem.NOSPAMox.aREMOVEc.uk>