defint1 abs trouble
- Subject: defint1 abs trouble
- From: Edwin Woollett
- Date: Sun, 18 Mar 2012 11:43:02 -0700
On Mar. 18, Barton Willis wrote:
-----------------------------
>(%i155) assume(x>0)$
>
> (%i156) mydefint1(abs(x),x,-1,1);
> (%o156) 0
-------------------------------------
Thanks for pointing out this further problem
with mydefint1, an effort to ignore global
assumptions and use local assumptions.
With my code I get:
------------------------------
(%i1) mydefint1 (e78, x78, a78, b78) :=
block( [domain : complex, res1, _ans,e781],
_ans : assume (x78 > min(a78,b78), x78 < max(a78,b78)),
e781 : expand (e78,0,0),
res1 : ratsimp (integrate (e781, x78, a78, b78 ) ),
apply ('forget, _ans),
res1)$
(%i2) assume(x>0);
(%o2) [x > 0]
(%i3) mydefint1(abs(x),x,-1,1);
(%o3) 0
(%i4) facts();
(%o4) [x > 0]
---------------------------------------
which is trouble with a capital T.
If I try to explicitly save and forget global
assumptions, restoring them at the end,
I still get the wrong answer:
---------------------------------------------------
(%i1) mydefint1 (e78, x78, a78, b78) :=
block( [domain : complex,glob_assume, res1, loc_assume,e781],
glob_assume : facts(),
display(glob_assume),
apply('forget,glob_assume),
loc_assume : assume (x78 > min(a78,b78), x78 < max(a78,b78)),
e781 : expand (e78,0,0),
res1 : ratsimp (integrate (e781, x78, a78, b78 ) ),
apply ('forget, loc_assume),
apply ('assume, glob_assume),
res1)$
(%i2) assume(x>0);
(%o2) [x > 0]
(%i3) mydefint1(abs(x),x,-1,1);
glob_assume = [x > 0]
(%o3) 0
(%i4) facts();
(%o4) [x > 0]
----------------------------------------------
Ted