3

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

miracle173
  • 1,852
  • 16
  • 33
Karl
  • 263
  • 3
  • 10

1 Answers1

2
(%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.
slitvinov
  • 5,693
  • 20
  • 31
  • many thanks, but for my problem this does not work. I have f(x):=exp(-x^2) and in the integral 'integrate (%f(x)*f(4*x), x, 0, 1) I want to replace f(x) now by exp(-x^ 2). How? Many thanks! – Karl Apr 17 '20 at 04:14
  • very sorry, we don't come together, i should have formulated more clearly, my fault.. I have 'integrate (%f(x)*f(4*x), x, 0, 1), please note the apostrophe and want that f(x) and f(4*x) are replaced by exp(-x^2) and exp(-(4*x)^ 2) as integrands, no evaluation. – Karl Apr 17 '20 at 12:15