Calculation of simple Integrals



This is an old email but I remembered it and the integral in question can be solved with my periodic() function.  e2 is the 
solution.

integrate(abs(sin(x)),x);  /* integral in question */

(%i13) e1:periodic(sin(x),x,0,%pi);  /* same as abs(sin(x)) */
(out13) sin(mod(x,%pi))

(%i14) e2:(x-mod(x,%pi))/(%pi)*integrate(sin(x),x,0,%pi)+periodic(integrate(sin(x),x),x,0,%pi);
(out14) 2*(x-mod(x,%pi))/%pi-cos(mod(x,%pi))

(%i15) plot2d([e1,e2],[x,0,5*%pi]);

I need to get e2 from pwint which I did not do since pwint can't get this answer yet, I think it can be done but I have been wrong 
before.

Rich



----- Original Message ----- 
From: "dlakelan" <dlakelan at street-artists.org>
To: "Lorenzo Isella" <lorenzo.isella at gmail.com>
Cc: <maxima at math.utexas.edu>
Sent: Monday, February 16, 2009 8:35 PM
Subject: Re: [Maxima] Calculation of simple Integrals


Lorenzo Isella wrote:
> Dear All,
> I am quite a newbie (I used maxima only a while several years ago),
> but there is something I find a biut strange:
...
> So, it looks like that maxima (as expected!) has no trouble in
> calculating definite integrals of simple trigonometric functions, but
> if I add an absolute value, even if it has no effect on the sinus in
> the selected interval, then it returns what (according to some reading
> I did) stands for its inability of calculating the integral
> analytically.
> Why is that? Am I misunderstanding anything?
> Kind Regards

When you do abs(sin(x))^2 maxima is able to figure out that the abs
doesn't make a difference, but when you do abs(sin(x)) the abs could
make a difference. Now maxima has to find out where are all the places
that the argument of abs changes sign... Although for some functions
this is easy, in general it is impossible. Maxima doesn't try very hard
on this impossible problem although it could try for some easy sorts of
functions.

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima