Hi everyone, I've got the following behaviour in sage 4.8. 

First I define the following function to calculate the fractional integral 
of a function:

def fracintegral(func,n, x=x,a=0):
>     var('t')
>     assume(t > a)
>     assume(x > a)
>     return integrate((x-t)^n*func(t),t,a,x)/gamma(n)
>

When I test it on polynomials and logarithms, it seems to work fine.

fracintegral(x,1/2)
>
 
>
4/15*x^(5/2)/sqrt(pi)
>>
>>
But when I try it on exponentials or trigonometric functions, I get the 
following weird error.


fracintegral(sin(x),1/2)
>
 
>
 
>>
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File "_sage_input_22.py", line 10, in <module>
>>     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 
>> -*-\\n" + 
>> _support_.preparse_worksheet_cell(base64.b64decode("ZnJhY2ludGVncmFsKHNpbih4KSwxLzIp"),globals())+"\\n");
>>  execfile(os.path.abspath("___code___.py"))
>>   File "", line 1, in <module>
>>     
>>   File "/tmp/tmpeCkAoa/___code___.py", line 3, in <module>
>>     exec compile(u'fracintegral(sin(x),_sage_const_1 /_sage_const_2 )
>>   File "", line 1, in <module>
>>     
>>   File 
>> "/home/joal/bin/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/misc/latex.py",
>>  line 2243, in pretty_print
>>     view(object)
>>   File 
>> "/home/joal/bin/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/misc/latex.py",
>>  line 1969, in view
>>     s = _latex_file_(objects, title=title, sep=sep, tiny=tiny, debug=debug, 
>> **latex_options)
>>   File 
>> "/home/joal/bin/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/misc/latex.py",
>>  line 1624, in _latex_file_
>>     L = latex(x)
>>   File 
>> "/home/joal/bin/sage-4.8-linux-64bit-ubuntu_10.04.3_lts-x86_64-Linux/local/lib/python2.6/site-packages/sage/misc/latex.py",
>>  line 875, in __call__
>>     return LatexExpr(x._latex_())
>>   File "expression.pyx", line 667, in 
>> sage.symbolic.expression.Expression._latex_ 
>> (sage/symbolic/expression.cpp:4121)
>>   File "ring.pyx", line 596, in 
>> sage.symbolic.ring.SymbolicRing._latex_element_ (sage/symbolic/ring.cpp:6461)
>>   File "pynac.pyx", line 433, in sage.symbolic.pynac.py_latex_function 
>> (sage/symbolic/pynac.cpp:4702)
>>   File "pynac.pyx", line 407, in 
>> sage.symbolic.pynac.py_latex_function_pystring (sage/symbolic/pynac.cpp:4328)
>> TypeError: _limit_latex_() takes exactly 4 arguments (5 given)
>>
>>
But if I type in 

> integrate((x-t)^(1/2)*sin(t),t)


it seems to work, but with a really weird result (expintegral_e?)

> -1/2*sqrt(t - x)*(((expintegral_e(-1/2, -I*t + I*x) +
>> expintegral_e(-1/2, I*t - I*x))*t - (expintegral_e(-1/2, -I*t + I*x) +
>> expintegral_e(-1/2, I*t - I*x))*x)*sin(x) - ((-I*expintegral_e(-1/2,
>> -I*t + I*x) + I*expintegral_e(-1/2, I*t - I*x))*x +
>> (I*expintegral_e(-1/2, -I*t + I*x) - I*expintegral_e(-1/2, I*t -
>> I*x))*t)*cos(x))
>>
>>
But the really weird bit, is that if I then enter my original command 
again, I now get a somewhat sensible answer.

> -1/2*(x^(3/2)*sin(x)*expintegral_e(-1/2, -I*x) +
>> x^(3/2)*sin(x)*expintegral_e(-1/2, I*x) +
>> I*x^(3/2)*cos(x)*expintegral_e(-1/2, -I*x) -
>> I*x^(3/2)*cos(x)*expintegral_e(-1/2, I*x) -
>> 2*limit(-1/2*sqrt(-t)*t*sin(x)*expintegral_e(-1/2, -I*t) -
>> 1/2*sqrt(-t)*t*sin(x)*expintegral_e(-1/2, I*t) +
>> 1/2*I*sqrt(-t)*t*cos(x)*expintegral_e(-1/2, -I*t) -
>> 1/2*I*sqrt(-t)*t*cos(x)*expintegral_e(-1/2, I*t), t, 0, minus))/sqrt(pi)
>>
>>
Any ideas? 

>  
>
>

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to