[Maxima] Calculation of simple Integrals

Alexey Beshenov al at beshenov.ru
Wed Feb 11 07:11:29 CST 2009

```On Wednesday 11 February 2009 15:48:37 Lorenzo Isella wrote:
> (%i5) integrate(abs(sin(x)), x, 0 , %pi);
>                                %pi
>                               /
>                               [
> (%o5)                         I    abs(sin(x)) dx
>                               ]
>                               /
>                                0
>
> 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?

integrate does not handle abs. abs(sin(x)) could be simplified to
sin(x) in this case, but Maxima can't do it:

(%i1) assume(x >= 0 and x <= %pi);
(%o1) [x >= 0,x <= %pi]

(%i2) sign(x);
(%o2) pz

(%i3) abs(x);
(%o3) x

(%i4) sign(sin(x));
(%o4) pnz

(%i5) abs(sin(x));
(%o5) abs(sin(x))

--
Boomtime, Chaos 42 YOLD 3175
Alexey Beshenov  http://beshenov.ru/

```