unapply is used to transform an expression into a function.
unapply takes two arguments an expression and the name of a variable.
unapply returns the function defined by this expression and
this variable.
Warning when a function is defined,
the right member of the affectation is not evaluated,
hence g:=sin(x+1); f(x):=g
does not defined the function
f: x → sin(x+1) but defines the function
f: x → g. To defined the former function, unapply
should be used, like in the following example:
Input :
Output :
hence, the variable g is assigned to a symbolic expression
and the variable f is assigned to a function.
Input :
Output :
Input :
Output :
Input :
Output :
Input :
Output :
Remark
Suppose that f is a function of 2 variables f:(x,w)→ f(x,w),
and that g is the function defined by
g: w → hw where hw is the function defined by
hw(x)=f(x,w).
unapply is also used to define g with Xcas.
Input :
Output :