On Tue, Jul 8, 2008 at 8:52 AM, William Stein <[EMAIL PROTECTED]> wrote:
>
> On Mon, Jul 7, 2008 at 9:12 PM, Elliott Brossard
> <[EMAIL PROTECTED]> wrote:
>> Hi William,
>>
>> I am becoming more familiar with both Linux and Sage now, which makes things
>> much easier. I finished porting the Maxima and Wester integration tests to
>> Sage, though there are many that currently fail...I've attached them, if
>
> You attached only the ones that fail? Where are the ones that succeed?
>
>> you'd like to see. The problem that many of them have results from ambiguity
>> of variables under a radical, in a denominator, or in a function with a
>> restricted domain. As an example, inputting
>
> Can you just make a new test that tests each case?
>
>> var('a')
>> integrate(log(x)/a, x, a, a+1)
>>
>> will throw an error: 'is a positive or negative?' Two assume
>> statements--assume(x+a+1>0) and assume(a-1>0)--render Sage capable of
>> responding, and it outputs
>>
>> ((a + 1)*log(a + 1) - a*log(a) - 1)/a
>>
>> My TI-89 calculator, which uses Derive, gets the same result, though without
>> using 'assume' in any form. Trouble is, I can't imagine there's a quick fix
>> for this, and since most of the failing integrals are from Maxima's own test
>
> It would likely be possible -- though difficult (maybe not too difficult) --
> to have Sage automatically give all possible answers to Maxima and
> construct a conditional integral expression that gives each possible
> answer for given conditions.
Also Gary will probably fix this in his symbolics, currently it gives
me in the sage-symbolics branch:
sage: var("a")
a
sage: integrate(log(x)/a, x)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
/home/gfurnish/sage-3.0.3/<ipython console> in <module>()
NameError: name 'integrate' is not defined
Another option is this:
sage: import sympy
sage: var("a")
a
sage: sympy.integrate(log(x)/a, (x, a, a+1))
-1/a*(-a + a*log(a)) - 1/a*(1 + a - (1 + a)*log(1 + a))
and after merging the ticket #3592 you can then do:
sage: sympy.simplify(_)
1/a*(-1 + a*log(1 + a) - a*log(a) + log(1 + a))
Unfortunately, converting back to sage currently fails:
sage: SR(_)
[boom]
It's a showstopper, sorry about that. I created a new issue for that:
http://code.google.com/p/sympy/issues/detail?id=924
and it will be fixed in the next release. In the 0.6.0 series of
sympy, I will concentrate specifically on these problems and write
thorough tests for them, according to this roadmap:
http://wiki.sympy.org/wiki/Plan_for_SymPy_1.0
Sorry that I didn't work on this earlier, I was just too busy. I only
wrote a very simple tests in sage itself, so now I'll extend them to
cover all cases.
If you don't want to wait for the next release after #3592 is merged,
you can go to
local/lib/python2.5/site-packages/sympy/functions/elementary/exponential.py
and change the line 450 from:
return sage.log(self[0]._sage_())
to
return sage.log(self.args[0]._sage_())
then you could do:
sage: SR(_)
(a*log(a + 1) + log(a + 1) - a*log(a) - 1)/a
sage: a = SR(_)
sage: type(a)
<class 'sage.calculus.calculus.SymbolicArithmetic'>
Ondrej
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---