Example 1
In
Solution 1: Use an expression, not function, for the first argument:
Solution 2: The differential operator D can differentiate procedures (including functional operators).
For users of Maple 2017 and earlier versions: Previously, this error was generated in the following cases. As a result of updates made in Maple 2018, these examples no longer result in an error.
Example 2
In the following example, an error is generated when a Vector, , is passed to the diff command.
>
|
|
This is as expected since is not of type algebraic.
Solution:
Here, we assume that the intention was to differentiate each element of the Vector. Since each element in the Vector is an algebraic expression, differentiating element-wise corrects the above error. Specifically, use ~ to differentiate each element of the Vector. For more information on ~, see the operators/elementwise help page.
>
|
|
Example 3
In the following example, the call to the VectorCalculus package has been omitted. This results in the top-level diff function being used for the right-hand side values of and , rather than VectorCalculus[diff]. Since the top-level diff function does not accept Vectors as arguments, an error occurs.
| (2.5) |
| (2.6) |
>
|
|
| (2.7) |
>
|
|
| (2.8) |
>
|
|
>
|
|
Solution:
Adding with(VectorCalculus) before the sequence of statements results in VectorCalculus[diff]. This corrects the error.
>
|
|
| (2.9) |
| (2.10) |
>
|
|
| (2.11) |
>
|
|
| (2.12) |
>
|
|
>
|
|