By the way, the problem *might* be larger than that. In Maxima, one can do :
(%i1) display2d:false; (%o1) false (%i2) define(h(x),integrate(f(t),t,g1(x),g2(x))); defint: lower limit of integration must be real; found g1(x) -- an error. To debug this try: debugmode(true); (%i3) declare(g1,real,g2,real); (%o3) done (%i4) define(h(x),integrate(f(t),t,g1(x),g2(x))); (%o4) h(x):='integrate(f(t),t,g1(x),g2(x)) (%i5) diff(h(x),x); (%o5) f(g2(x))*'diff(g2(x),x,1)-f(g1(x))*'diff(g1(x),x,1) which is both correct and useful. As far as I know, one cannot declare a function as real-valued in Sage : sage: g1=function("g1",x,domain="real") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-43-ab6717b797c7> in <module>() ----> 1 g1=function("g1",x,domain="real") /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/calculus/var.so in sage.calculus.var.function (sage/calculus/var.c:1253)() /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/calculus/var.so in sage.calculus.var.function (sage/calculus/var.c:1299)() /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/function_factory.pyc in function(s, *args, **kwds) 310 names = [s] 311 --> 312 funcs = [function_factory(name, **kwds) for name in names] 313 314 if len(args) > 0: TypeError: function_factory() got an unexpected keyword argument 'domain' But also : sage: g1=function("g1",x) sage: assume(g1,"real") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-45-bd761ce74d13> in <module>() ----> 1 assume(g1,"real") /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/assumptions.pyc in assume(*args) 410 else: 411 try: --> 412 x.assume() 413 except KeyError: 414 raise TypeError, "assume not defined for objects of type '%s'"%type(x) /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.assume (sage/symbolic/expression.cpp:8750)() TypeError: self (=g1(x)) must be a relational expression but also : sage: assume(g1(x),"real") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-46-0d7aa50473b1> in <module>() ----> 1 assume(g1(x),"real") /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/assumptions.pyc in assume(*args) 410 else: 411 try: --> 412 x.assume() 413 except KeyError: 414 raise TypeError, "assume not defined for objects of type '%s'"%type(x) /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.assume (sage/symbolic/expression.cpp:8750)() TypeError: self (=g1(x)) must be a relational expression hence : sage: g2(x)=function("g2",x) sage: h(x)=integrate(f(t),t,g1(x), g2(x)) --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-48-fdf29d67d922> in <module>() ----> 1 __tmp__=var("x"); h = symbolic_expression(integrate(f(t),t,g1(x), g2(x))).function(x) /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/misc/functional.pyc in integral(x, *args, **kwds) 738 """ 739 if hasattr(x, 'integral'): --> 740 return x.integral(*args, **kwds) 741 else: 742 from sage.symbolic.ring import SR /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/expression.so in sage.symbolic.expression.Expression.integral (sage/symbolic/expression.cpp:39592)() /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc in integrate(expression, v, a, b, algorithm) 686 return indefinite_integral(expression, v) 687 else: --> 688 return definite_integral(expression, v, a, b) 689 690 integral= integrate /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/function.so in sage.symbolic.function.Function.__call__ (sage/symbolic/function.cpp:5114)() /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc in _eval_(self, f, x, a, b) 171 for integrator in self.integrators: 172 try: --> 173 return integrator(*args) 174 except NotImplementedError: 175 pass /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/symbolic/integration/external.pyc in maxima_integrator(expression, v, a, b) 19 result = maxima.sr_integral(expression,v) 20 else: ---> 21 result = maxima.sr_integral(expression, v, a, b) 22 return result._sage_() 23 /usr/local/sage-5.10/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc in sr_integral(self, *args) 745 raise ValueError, "Computation failed since Maxima requested additional constraints; using the 'assume' command before integral evaluation *may* help (example of legal syntax is 'assume(" + s[4:k] +">0)', see `assume?` for more details)\n" + s 746 else: --> 747 raise error 748 749 def sr_sum(self,*args): RuntimeError: ECL says: Error executing code in Maxima: defint: lower limit of integration must be real; found g1(x) Should this problem be added to Trac#14976<http://trac.sagemath.org/ticket/14976>or reported elsewhere ? Emmanuel Charpentier [ Snip... ] -- 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 sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support. For more options, visit https://groups.google.com/groups/opt_out.