Thanks for the quick reply.
I used the word 'incorrect', which is incorrect :-) As usual,
I have disobeyed Einsteins rule: simplify your problem as much as
you can, but don't simplify more.
The two methods come up with different constants of integration,
without expand it is y^2/2 and with expand it is 0.
I use integrate twice to compute the integration factor for
an ode somewhere and the first time the integration is over x
and the second time over y. If I don't use expand then this goes
wrong.
so in the end I do this:
return(ratsimp(integrate(expand(mu),y) - integrate(expand(mu*phi),x)=%c))
so: if I use expand, it will not manipulate the constant that was already there,
but if I don't use expand, it will manipulate the constant?
Thanks for your patience,
NB
> From: vttoth at vttoth.com
> To: nijso at hotmail.com; maxima at math.utexas.edu
> Subject: RE: [Maxima] integrate and expand
> Date: Wed, 11 Nov 2009 17:43:16 -0500
>
> The two results differ only by a constant (y^2/2). Remember the the
> indefinite integral is undetermined up to an arbitrary constant.
>
>
> Viktor
>
>
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of nijso beishuizen
> Sent: Wednesday, November 11, 2009 5:35 PM
> To: maxima at math.utexas.edu
> Subject: integrate and expand
>
> Hello!
> Just a simple question:
> Do I always need to do an expand before integrating a function?
> If I do for instance
> (%i1) f:exp(x)*(exp(x)-y);
> (%i2) integrate(f,x);
>
> I get the wrong answer: 1/2*(exp(x)-y)^2
>
> but if I do
> (%i3) integrate(expand(f),x);
>
> it is correct. If I always need to do expand anyway, why is it not called
> automatically when I call integrate? Are there instances where you
> should not call expand before calling integrate? I'm puzzled by this
> behavior.
>
> Thanks,
> NB
>
>
> ________________________________
>
> New Windows 7: Simplify what you do everyday. Find the right PC for you.
> <http://windows.microsoft.com/shop>
>
_________________________________________________________________
New Windows 7: Find the right PC for you. Learn more.
http://windows.microsoft.com/shop