I think what you want here is not ev at all; I am guessing, but I suspect
you want to define function h in terms of the *simplified* result of the
symbolic calculation f(x)/g(x).
The way to do that is
define(h(x), f(x)/g(x) )
For example:
(%i1) f(x):=4*x^5$
(%i2) g(x):=3*x^4$
(%i3) define(h(x),f(x)/g(x))$
(%i4) dispfun(h);
(%t4) h(x):=4*x/3
Equivalently, you can write
h(x) := ''(f(x)/g(x))
which evaluates the contents of ''( ... ) at the time of function
definition, but I think 'define' is clearer.
-s
On Wed, Sep 22, 2010 at 10:44, Dan <vi5u0-maxima at yahoo.co.uk> wrote:
>
> Dear All,
>
> Imagine I do something like (a more complicated version of) this
>
> load(draw) ;
>
> f(x) := 4*x^5 ;
> g(x) := 3*x^4 ;
>
> h(x) := ev(f(x)/g(x)) ;
>
> draw2d(explicit(h(x),x,0,7)) ;
>
> If I've understood correctly, the ev() is called separately for each
> specific numerical value of x during the draw2d(). A lot of
> CPU time could be saved by instead calling the ev()
> once and for all at the time h(x) is defined. Is this possible,
> please?
>
> --
>
> Thanks,
>
> Dan
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>