Previous Up Next

2.17.1  Functional derivative : function_diff

function_diff takes a function as argument.
function_diff returns the derivative function of this function.
Input :

function_diff(sin)

Output :

(‘ x‘)->cos(‘ x‘)

Input :

function_diff(sin)(x)

Output :

cos(x)

Input :

f(x):=x^2+x*cos(x)
function_diff(f)

Output :

(‘ x‘)->2*‘ x‘+cos(‘ x‘)+‘ x‘*(-(sin(‘ x‘)))

Input :

function_diff(f)(x)

Output :

cos(x)+x*(-(sin(x)))+2*x

To define the function g as f′, input :

g:=function_diff(f)

The function_diff instruction has the same effect as using the expression derivative in conjonction with unapply :

g:=unapply(diff(f(x),x),x)
g(x)

Output :

cos(x)+x*(-(sin(x)))+2*x

Warning !!!
In Maple mode, for compatibility, D may be used in place of function_diff. For this reason, it is impossible to assign a variable named D in Maple mode (hence you can not name a geometric object D).


Previous Up Next