Functions in symbol manipulation systems such as Maxima, Maple and Mathematica are more like real mathematical functions and less like functions in Fortran or in C. In particular, because they are defined in terms of symbolic expressions, operations such as symbolic differentiation and integration can be performed on them.
Consider the following function:
In order to obtain this result with Maxima invoke Maxima command
diff:
diff
on the result returned by the first diff, or invoke diff
with three arguments, where the third argument is the order of the
derivative:
Maxima also has a delayed
derivative, that is a diff operation,
which marks an expression as a derivative, but doesn't evaluate it:
ev(%, diff),
where diff is a special ev flag, that tells
ev to perform all delayed differentiations in the
expression, which is given as the first argument to ev.
Maxima supports the following syntactic sugar notation
that can be used instead of ev:
Now let us have a look at how all this works in Maple. First let us
define function F:
diff works in Maple much the same as it does
in Maxima. There is also a delayed evaluation version
of diff, which is called Diff. Recall that
a similar relationship between sum and Sum.
diff(f(x), x, 2) would result in an error message. Instead
you have to do this as follows:
In Mathematica the notation used in this context
is painfully different for those who are
used to Maxima and/or Maple, but, at the same time, somewhat closer to
a traditional notation used in mathematics.
The following listing shows a conversation with Mathematica,
which begins with the definition of function F. This is
followed by taking its derivative and then evaluation of its value at x=3 for
a=1 and b=2.
Higher derivatives in Mathematica are calculated by replacing x
in the call to D with a list, of which the first element is
x and the second element is the order of the derivative: