Search code examples
seriesmaple

What is wrong in this command "series(diff(f(z), z), z = 1, 2)" in Maple?


Assume f(z) is an arbitrary function of z. In Maple, if we want to get the series expansion of diff(f(z),z) at z=0, we can use

series(diff(f(z), z), z = 0, 2)

The output is "(D(f))(0)+...". However, we cannot obtain the series expansion of diff(f(z),z) at z=1 by

series(diff(f(z), z), z = 1, 2)

The output is "Error, (in PDEtools/useD/diff_to_D) invalid input: diff received z+1, which is not valid for its 2nd argument." What is wrong, and how to get the series expansion of an expression that contains derivatives of a function such as diff(f(z),z)?


Solution

  • It looks like a bug.

    Workarounds might include,

    series(D(f)(z), z = 1, 2);
                                             /       2\
         D(f)(1) + @@(D, 2)(f)(1) (z - 1) + O\(z - 1) /
    

    or (with a different expansion order option),

    MultiSeries:-series(diff(f(z), z), z = 1, 3);
                                             /       2\
         D(f)(1) + @@(D, 2)(f)(1) (z - 1) + O\(z - 1) /