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>