New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiation of general functions #8510

Closed
isuruf opened this Issue Nov 24, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@isuruf
Copy link
Member

isuruf commented Nov 24, 2014

In [1]:
from sympy import *
var('x, y')
f = Function('f')

In [2]:
f(x + y, x).diff(x)

Out[2]:
Derivative(f(x + y, x), x) + Subs(Derivative(f(_xi_1, x), _xi_1), (_xi_1,), (x + y,))

In [3]:
f(x, x).diff(x)

Out[3]:
2*Derivative(f(x, x), x)

For In [2], instead of the result, I would expect,
Subs(Derivative(f(x+y, _xi_2), _xi_2), (_xi_2,), (x,)) + Subs(Derivative(f(_xi_1, x), _xi_1), (_xi_1,), (x + y,))

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented May 2, 2015

I agree:

In [16]: f(x + y, x).diff(x).replace(f, lambda x, y: x**2*y).doit().expand()
Out[16]:
   2            2
5⋅x  + 6⋅x⋅y + y

In [17]: ((x + y)**2*x).diff(x).expand()
Out[17]:
   2            2
3⋅x  + 4⋅x⋅y + y
@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented May 2, 2015

I checked against some old versions and this has never worked.

skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 16, 2016

Fix a bug in fdiff(argindex)
Closes sympy/sympy#8510

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>

skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 17, 2016

Fix a bug in fdiff(argindex)
Closes sympy/sympy#8510

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>

skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 17, 2016

Fix a bug in fdiff(argindex)
Closes sympy/sympy#8510

// edited by skirpichev

Signed-off-by: Sergey B Kirpichev <skirpichev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment