-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Derivative of vector-valued function #375
Comments
Integration in contrast works just fine:
|
Another example:
I think this is related to this rule in mathics/builtin/calculus.py: 'D[{items___}, x_?NotListQ]': 'D[#, x]& /@ {items}', When this is applied to There might be some other issues here but a short-term fix is to avoid slots in these rules, so we can properly handle taking derivatives of slot expressions. |
Using Function and Slot in this rule causes problems if the pattern variables are bound to expressions containing slots. Avoid this by using the named-argument form of Function.
Fix for issue #375: avoid slots in rule handling D[{...}, ...]
This should now be fixed. Thanks for reporting this! |
Derivative calculation works for scalar-valued functions:
In[56]:= p[x_] := x^2
In[57]:= p'[x]
Out[57]= 2 x
But not for vector-valued functions:
In[58]:= p[x_] := {x^2}
In[59]:= p'[x]
Out[59]= {0}
I was expecting {2x}.
The text was updated successfully, but these errors were encountered: