Re: Integrate not very aggressive about taking constants out of integrals
- To: mathgroup at smc.vnet.net
- Subject: [mg81427] Re: Integrate not very aggressive about taking constants out of integrals
- From: dimitris <dimmechan at yahoo.com>
- Date: Sun, 23 Sep 2007 04:30:02 -0400 (EDT)
- References: <fd2g2d$s61$1@smc.vnet.net>
On 22 , 10:26, "Darryl Yong" <darryly... at gmail.com> wrote:
> Try the following three few lines of code in Mathematica:
>
> temp1 = Integrate[-Exp[p[s]] , {s,0,t}];
> temp2 = Integrate[Exp[p[s]] , {s,0,t}];
> temp1+temp2
>
> Out[3] = Integrate[-E^p[s], {s, 0, t}] + Integrate[E^p[s], {s, 0, t}]
>
> FullSimplify[temp1+temp2]
>
> Out[4] = Integrate[-E^p[s], {s, 0, t}] + Integrate[E^p[s], {s, 0, t}]
>
> You'll notice that Mathematica doesn't take the negative sign out of
> the integral in temp1, so the result of temp1+temp2 is not zero unless
> you define something for p[s] and let it actually work out both
> integrals.
>
> Does anyone know of a way to help Mathematica be more aggressive about
> taking constants out of integrals?
>
> Thanks, Darryl
Hi.
How about?
In[42]:=
temp1 = Integrate[-Exp[p[s]], {s, 0, t}];
temp2 = Integrate[Exp[p[s]], {s, 0, t}];
In[49]:=
temp1 + temp2 /. t -> 0
Out[49]=
0
and
In[45]:=
D[temp1 + temp2, t]
Out[45]=
0
Cheers
Dimitris