function as result...



> How can I write function as result of formula?
> 
> if i try :
> f(x):=diff(sin(x),x);
> 
> it gives no result ...

I am not sure exactly what you want to do, but I will guess that you
expect f(x):=... to define a *mathematical* function which you can then
manipulate formally.  That is not the way Maxima works.  Maxima normally
manipulates *expressions*, not named functions.

Probably what you want to do is something like:

    f: diff(sin(x),x);

That now sets the programming variable f to the *expression* cos(x).

Named mathematical functions like f(x) are useful in Maxima primarily
when they are *not* defined, and you want to manipulate them formally,
e.g.

   expr: log(f(x)/(f(x)+1))$
   diff(expr,x)
      => (f(x)+1)*
         ('diff(f(x),x,1)/(f(x)+1)-f(x)*'diff(f(x),x,1)/(f(x)+1)^2)
         /f(x)
   ratsimp(%)
      => 'diff(f(x),x,1)/(f(x)^2+f(x))
   subst(sin,f,%)
      => 'diff(sin(x),x,1)/(sin(x)^2+sin(x))
   %,diff;
      /* carry out the differentiation */
      =>   cos(x)/(sin(x)^2+sin(x))

I hope this is helpful.  Please feel free to ask more questions about
this or other issues.

      -s