Re: Boole does not work with symbolic limits in Integrate ?
- To: mathgroup at smc.vnet.net
- Subject: [mg73148] Re: Boole does not work with symbolic limits in Integrate ?
- From: "dimitris" <dimmechan at yahoo.com>
- Date: Sun, 4 Feb 2007 08:19:34 -0500 (EST)
- References: <eq1ihd$2ug$1@smc.vnet.net>
On Feb 3, 10:53 am, Mitch Murphy <m... at mix5.com> wrote: > hey hey > > use of the boole indicator function inside integrate only works for > numerical arguments, symbolic limits of integration just returns the > unevaluated integral. > > simple example ... > > Integrate[2 u Boole[a < u], {u, 0, x}] > > out[] = Integrate[2 u Boole[a < u], {u, 0, x}] > > i would expect ... > > Integrate[2 u , {u, a, x}] > > out[] = x^2 - a^2 > > but it does work with numerical limits of integration ... > > Integrate[2 u Boole[a < u], {u, 0, 2}] > > out[] = Piecewise[{{4, a <= 0}, {4 - a^2, 0 < a < 2 }] > > anybody know a trick to make this work ? i've tried a bunch of > variations using evaluate[], logicalexpand[], piecewiseexpand[], > assumptions->x Reals, ..., but nothing works. > > cheers, > Mitch Hello Martin. Try In[8]:= Assuming[x > 0, Integrate[2*u*Boole[a < u], {u, 0, x}]] Out[8]= Piecewise[{{x^2, a <= 0 && x > 0}, {-a^2 + x^2, a > 0 && a - x < 0}}] or In[9]:= Integrate[2*u*Boole[a < u], {u, 0, x}, Assumptions -> x > 0] Out[9]= Piecewise[{{x^2, a <= 0 && x > 0}, {-a^2 + x^2, a > 0 && a - x < 0}}] or In[10]:= Block[{$Assumptions = x > 0}, Integrate[2*u*Boole[a < u], {u, 0, x}]] Out[10]= Piecewise[{{x^2, a <= 0 && x > 0}, {-a^2 + x^2, a > 0 && a - x < 0}}] (*check*) In[13]:= Plot[Evaluate[% /. x -> 2], {a, -3, 3}] (*plot to be displayed*) In[14]:= Integrate[2*u*Boole[a < u], {u, 0, 2}] Out[14]= Piecewise[{{4, a <= 0}, {4 - a^2, 0 < a < 2}}] In[15]:= Plot[Evaluate[%], {a, -3, 3}] (*plot to be displayed*) Best Regards Dimitris