On Jun 26, 2012, at 8:01 AM, Pierre H <[email protected]> wrote:
>>> J.diff(x).doit() > f(x) > > Thanks, it indeed does the job. I just didn't know this method... Now, I have a second problem wich a slight modification : >>> J1 = f(x-t).integrate((t,0,x)) >>> print J1.diff(x) f(0) + Integral(Subs(Derivative(f(_xi_1), _xi_1), (_xi_1,), (-t + x,)), (t, 0, x)) This result, even with the nice MathJax rendering in IPython Notebook is pretty difficult to understand and the "doit" trick doesn't help. I did a separate pen and paper derivation and came to the conclusion that J1.diff(x) is actually f(x) The Subs object is just SymPy's way of representing the derivative of f evaluated at x - t (that is, f'(x - t)). We could probably pretty print this nicer. I believe your derivation is correct. Unfortunately, SymPy's integrate is not so good at applying general rules. In this case, it doesn't know that the Subs object is just a derivative, and after a substitution, can be evaluated by the fundamental theorem of calculus. However, we know that, and we can tell this to SymPy. If you take just the integral part and use .transform() to do a change of variables, it can be simplified. In other words, (f(0) + Integral(Subs(Derivative(f(_xi_1), _xi_1), (_xi_1,), (-t + x,)), (t, 0, x)).transform(x - t, t)).doit() will give f(x). (you will need to create the Symbol _xi_1) Feel free to open issues in our issue tracker at http://code.google.com/p/sympy/issues/list for both of these problems (printing of Subs and the inability to do the integral), as well as for any other problems you find in SymPy. Aaron Meurer However, I do not trust my integration skills which is the reason why I asked sympy for this case. Is it a kind of symbolic integration that is not supported by current sympy ? Or is just me doing bad integration ;-) ... Best, Pierre -- You received this message because you are subscribed to the Google Groups "sympy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/zDVV1g-b-LQJ. 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/sympy?hl=en. -- You received this message because you are subscribed to the Google Groups "sympy" group. 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/sympy?hl=en.
