The problem seems to lie on Sage's side. In the "native" version of sage :

Maxima 5.30.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (a.k.a. GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) define(g(a),integrate(f(t),t,0,a^2));
                                        2
                                       a
                                      /
                                      [
(%o1)                         g(a) := I   f(t) dt
                                      ]
                                      /
                                       0
(%i2) diff(g(a),a);
                                          2
(%o2)                              2 a f(a )

which looks reasonable.

In Sage's version of maxima :

charpent@portable-ec:~$ sage -maxima
;;; Loading #P"/usr/local/sage-5.10/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/usr/local/sage-5.10/local/lib/ecl/sockets.fas"
;;; Loading #P"/usr/local/sage-5.10/local/lib/ecl/defsystem.fas"
;;; Loading #P"/usr/local/sage-5.10/local/lib/ecl/cmp.fas"
Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp ECL 12.12.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) define(g(a),integrate(f(t),t,0,a^2));
                                        2
                                       a
                                      /
                                      [
(%o1)                         g(a) := I   f(t) dt
                                      ]
                                      /
                                       0
(%i2) diff(g(a),a);
                                          2
(%o2)                              2 a f(a )

which is the same. Therefore, neither native maxima nor Sage's maxima  seem 
to be the culprit.

The same behaviour is observed on Sage 5.4 as running on www.sagenb.org ; 
its maxima gives sane answers (checked by a %maxima cell in the notebook), 
its "native answer is the same error.

Therefore, this bug is old...

HTH

                                                          Emmanuel 
Charpentier

Le jeudi 25 juillet 2013 18:16:01 UTC+2, Victor Miller a écrit :
>
> In the latest version of sage (at least what cloud.sagemath.org is 
> running), there is a problem with substituting constants into the formal 
> integrals of formal functions.  See the examples below.
>
> Victor
>
> sage: var('a'); function('f',a)
> sage: g = f(a).integrate(a,0,a^2)
> sage: g
> integrate(f(a),0,a^2)
>
> sage: g.derivative(a)
>
> Error in lines 1-1
> Traceback (most recent call last):
>   File "/mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py", line 498, in 
> execute
>     exec compile(block+'\n', '', 'single') in namespace, locals
>   File "", line 1, in <module>
>   File "expression.pyx", line 3006, in 
> sage.symbolic.expression.Expression.derivative 
> (sage/symbolic/expression.cpp:15855)
>   File "derivative.pyx", line 216, in sage.misc.derivative.multi_derivative 
> (sage/misc/derivative.c:2715)
>   File "expression.pyx", line 3078, in 
> sage.symbolic.expression.Expression._derivative 
> (sage/symbolic/expression.cpp:16245)
>   File 
> "/usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  line 224, in _tderivative_
>     - f.subs(x==a)*a.diff(diff_param)
>   File "element.pyx", line 344, in sage.structure.element.Element.__getattr__ 
> (sage/structure/element.c:3871)
>   File "misc.pyx", line 257, in sage.structure.misc.getattr_from_other_class 
> (sage/structure/misc.c:1696)
> AttributeError: 'sage.rings.integer.Integer' object has no attribute 'diff'
>
> sage: g1 = f(a).integrate(a)
> sage: g1(0)
> Error in lines 1-1
> Traceback (most recent call last):
>   File "/mnt/home/lQoU8m2s/.sagemathcloud/sage_server.py", line 498, in 
> execute
>     exec compile(block+'\n', '', 'single') in namespace, locals
>   File "", line 1, in <module>
>   File "expression.pyx", line 3973, in 
> sage.symbolic.expression.Expression.__call__ 
> (sage/symbolic/expression.cpp:19900)
>   File "ring.pyx", line 685, in 
> sage.symbolic.ring.SymbolicRing._call_element_ (sage/symbolic/ring.cpp:7672)
>   File "expression.pyx", line 3824, in 
> sage.symbolic.expression.Expression.substitute 
> (sage/symbolic/expression.cpp:19177)
>   File 
> "/usr/local/sage/sage-5.10.rc1/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.py",
>  line 75, in _eval_
>     if len(x.variables()) == 1:
>   File "element.pyx", line 344, in sage.structure.element.Element.__getattr__ 
> (sage/structure/element.c:3871)
>   File "misc.pyx", line 257, in sage.structure.misc.getattr_from_other_class 
> (sage/structure/misc.c:1696)
> AttributeError: 'sage.rings.integer.Integer' object has no attribute 
> 'variables'
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to