Integrate expression involving a formal function

asked 2018-03-06 19:41:49 +0200

envypole gravatar image

I am trying to integrate expressions involving a formal function $f(x)$:

sage: var('x')
sage: function('f')

It works in some simple cases:

sage: integrate(cos(f(x)) * f(x).diff(), x)

However, a slightly more complicated expression is left unchanged:

sage: integrate(x * f(x).diff() + f(x), x)
integrate(x*diff(f(x), x) + f(x), x)

instead of simplifying to $x\ f(x)$.

Is it possible to integrate such expressions in Sage? I tried to use other algorithms (e.g. algorithm='mathematica_free'), but I got this traceback:

.local/opt/sage-8.0/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in derivative(self, ex, operator)
    588         from sage.symbolic.ring import is_SymbolicVariable
    589         if self.name_init != "_maxima_init_":
--> 590             raise NotImplementedError
    591         args = ex.operands()
    592         if (not all(is_SymbolicVariable(v) for v in args) or

so it looks like only Maxima algorithm can be used because the derivative operation cannot be converted to anything else.

edit retag flag offensive close merge delete