# Differentiation of general functions #8510

Closed
opened this Issue Nov 24, 2014 · 2 comments

Projects
None yet
2 participants
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,))`
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 ``````

Member

### asmeurer commented May 2, 2015

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

Merged

### 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>```
``` 4b1ef16 ```

### 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>```
``` 8e55b27 ```

### 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>```
``` 62ea062 ```