derivate(integrate(f(x))) <> f(x)!



Stavros Macrakis wrote:

> On 7/9/07, Patrick Gelin <patrick.gelin at free.fr> wrote:
>>
>> f(x)=sin(x)^2*cos(x)^2
>> F(x)=integrate(f(x),x)=-1/3*cos(x)^3+2/5*cos(x)^5-1/7*cos(x)^7+C
>> and derivate(F(x),x) = cos(x)^6*sin(x) what is different from f(x)!
> 
> 
> Are you sure you are using Maxima?  Maxima does not have a routine
> "derivate", and the syntax you are using (F(x)=...) won't work in Maxima.
> What's more, this is not the result that Maxima gives for integrate/diff
> in this case:
> 
>  (%i1) f: sin(x)^2*cos(x)^2;
> (%o1) cos(x)^2*sin(x)^2
> (%i2) fi: integrate(f,x);
> (%o2) (2*x-sin(4*x)/2)/16
> (%i3) fid: diff(fi,x);
> (%o3) (2-2*cos(4*x))/16
> 
> fid looks different from f, but in fact it is a different formula for the
> same function.  We can use "trigrat" to get a standardized form:
> 
> (%i4) trigrat(f);
> (%o4) -(cos(4*x)-1)/8
> 
> (%i5) trigrat(fid);
> (%o5) -(cos(4*x)-1)/8
> 
> By the way, is it possible to look the differentes step of the calcul ?
> 
> 
> No, sorry.
> 
>                -s

Yes, you are right, Sorry! I've made a mistake about f. This is the maxima
session:
(%i59) f:sin(x)^5*cos(x)^2;
(%o59) cos(x)^2*sin(x)^5(%i60) trigrat(f);
(%o60) (sin(7*x)-3*sin(5*x)+sin(3*x)+5*sin(x))/64
(%i61) integrate(%, x);
(%o61) (-cos(7*x)/7+(3*cos(5*x))/5-cos(3*x)/3-5*cos(x))/64
(%i62) ratsimp(%)
(%o62) -(15*cos(7*x)-63*cos(5*x)+35*cos(3*x)+525*cos(x))/6720

The problem is that the book give:
F(x)=-1/3*cos(x)^3 + 2/5*cos(x)^5 - 1/7*cos(x)^7 + C

which is very different from Maxima result (%o61)

So where is the true?