Search code examples
maple

Differentiation of unspecified functions in Maple


Lets say I have a function defined by f(Asin(x)). I want to differentiate this function in Maple. That is ∂f(Asin(x))/∂x = A*cos(x)*f’(A*sin(x)). However, Maple requires me to specify the function using the command f := a -> y for example. So I wish to know if it is possible to differentiate unspecified functions in Maple and if possible how.


Solution

  • Contrary to what you've claimed, Maple does not require you to specify f (as an operator, say).

    Below, f is just some unassigned name. And you can call diff on an expression involving function calls to f.

    restart;
    
    expr := f(A*sin(x));
    
    ans1 := diff(expr, x);
    
       D(f)(A*sin(x))*A*cos(x)
    

    That result happens to be in D form, which is a convenient way to express the derivative of f evaluated at a point/value.

    That result can also be represented in diff form (or Diff, its inert alternative). In this form we get a result involving a diff call. But that needs a variable of differentiation, and here that has to be some "dummy" name.

    convert(ans1, diff);
    
       eval(diff(f(t1),t1),{t1 = A*sin(x)})*A*cos(x)
    

    If you convert to diff form then any substitution for f by some concrete operator -- followed by evaluation -- would result in actual differentiation. But if you were to convert to inert Diff form then later substitution for f would not result in actual differentitation (unless, say, you utilized the value command on that result).