Name:

substitute replace the occurrences of the free variable in an expression.

Library name:

sollya_obj_t sollya_lib_substitute(sollya_obj_t, sollya_obj_t)

Usage:

substitute(f,g) : (function, function) -> function substitute(f,t) : (function, constant) -> constant

Parameters:

• f is a function.
• g is a function.
• t is a real number.

Description:

• substitute(f, g) produces the function (f o g) : x -> f(g(x)).
• substitute(f, t) is the constant f(t). Note that the constant is represented by its expression until it has been evaluated (exactly the same way as if you type the expression f replacing instances of the free variable by t).
• If f is stored in a variable F, the effect of the commands substitute(F,g) or substitute(F,t) is absolutely equivalent to writing F(g) resp. F(t).

Example 1:

> f=sin(x);
> g=cos(x);
> substitute(f,g);
sin(cos(x))
> f(g);
sin(cos(x))

Example 2:

> a=1;
> f=sin(x);
> substitute(f,a);
0.84147098480789650665250232163029899962256306079837
> f(a);
0.84147098480789650665250232163029899962256306079837