Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maxima: replace function f(x) by its definition?

Tags:

maxima

I cannot find anything about this, sorry.

If I have expressions with the symbolic function f(x) and now I want to replace in these expression f(x) by its explicit form how to do it?

For example:

I have

f(x):= x^2+sin(x)

and in the differentiation

diff (%e**sqrt(f(x)*a), x,2);

I want to replace now f(x) by the expression above?

Thanks

Karl

like image 388
Karl Avatar asked Nov 19 '25 09:11

Karl


1 Answers

(%i1) i: integrate(f(x)*f(4*x), x, 0, 1) $

(%i2) f(x):= x^2+sin(x) $

(%i3) ev(i, f);
                     1
                    /
                    [             2                  2
(%o3)               I  (sin(x) + x ) (sin(4 x) + 16 x ) dx
                    ]
                    /
                     0
 -- Function: ev (<expr>, <arg_1>, ..., <arg_n>)

     Evaluates the expression <expr> in the environment specified by the
     arguments <arg_1>, ..., <arg_n>.  The arguments are switches
     (Boolean flags), assignments, equations, and functions.  'ev'
     returns the result (another expression) of the evaluation.
like image 81
slitvinov Avatar answered Nov 21 '25 10:11

slitvinov