Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
Physics[diff] - differentiate with respect to commutative and anticommutative variables
Calling Sequence
diff(expression, x, , ... )
Parameters
expression
-
any mathematical expression or relation between expressions
x, , ...
the derivation variables, commutative or anticommutative
Description
The diff command is a differentiation command prepared to work with commutative (C) and anticommutative (AC) differentiation variables; that is, it takes into account the possible anticommutative character of the differentiation variables . Differentiation with respect to noncommutative (NC) variables is not implemented. Note that higher order derivatives with respect to AC variables do not commute, so their evaluation by the standard diff command would lead to an incorrect result. For the conventions adopted to represent NC and AC objects, see the Physics package conventions.
The %diff command is the inert form of diff; that is, it represents the same mathematical operation while displaying the operation unevaluated. To evaluate the operation, use the value command.
All of the differentiating knowledge of the top level diff command is taken into account when evaluating derivatives with diff, and all differentiation rules defined by the user as `diff/...` routines are also automatically taken into account.
The syntax for the input of diff is equal to that of the top level command, and a `print/diff` procedure is implemented in order to have the same display. Higher order derivatives with respect to commutative and anticommutative variables are displayed in separate groups. For example, set to be the prefix identifying anticommutative variables:
Physics[Setup](anticommutativeprefix = theta);
Physics[diff](f(theta1, theta2, x, y), theta1, theta2, x$3, y$2);
As with the top level diff command, if the result of a requested derivative cannot be expressed in terms of diff, then the D operator is used to express it. The equivalence between derivatives written in terms of diff and D is as follows:
Physics[diff](f(theta1, theta2), theta1, theta2);
(3) = convert((3), D);
The derivative above should be interpreted as: first differentiate with respect to , then with respect to ; or perform the derivatives in the opposite order and multiply the result by . Thus, the right-hand side should not be interpreted as a commutative higher order derivative.
To convert between formats, use the convert command with diff, Diff, or D as the second argument. Although an equivalence between diff and D always exists, note that there is no equivalence between the Physics and top level versions of diff when there are anticommutative objects in the derivand.
Examples
First set the symbols and as prefixes identifying anticommutative variables (see Setup for details).
So the following is an anticommutative function of two anticommutative variables.
The second derivative with respect to the same anticommutative variable is equal to zero.
All second order mixed derivatives anticommute.
Convert to the D format.
Derivatives of composite anticommutative functions with respect to anticommutative variables:
Derivatives of anticommutative products with respect to an anticommutative variable:
The mixed second order derivatives anticommute. These operations sometimes require normalizing and expanding the noncommutative products; for that purpose, use the expand command (if the intention is to expand only noncommutative products, use Physics/Expand).
You can use C and AC variables together. If the output contains derivatives with respect to both C and AC variables, then they are displayed in separate groups.
When the derivand contains both commutative and anticommutative variables and functions, using the top level diff command may result in incorrect calculations, even when the differentiation variable is commutative.
For example, differentiate the following anticommutative expression with respect to the commutative variable .
The result above, where the order in which multiplication is performed in the noncommutative product * is relevant, cannot be obtained by using the top level diff command.
See Also
diff, Expand, Physics, Physics conventions, Physics examples, Physics/*, Setup
References
Cheb-Terrab, E.S. "Symbolic Computing with Anti-commutative and Non-commutative Variables." MapleTech, Vol. 5, No. 1. (1998): 16-22.
Download Help Document