part of equation as function



On 3/13/12 11:31 PM, Jens Axel S?gaard wrote:
>
> Here is a simple example:
>
> (%i13) f(x) := expand( x*(x+1) );
> (%o13)                     f(x) := expand(x (x + 1))
>
> (%i14) define( g(x), expand( x*(x+1) ));
>                                           2
> (%o14)                          g(x) := x  + x
>

If you are going to try for a FAQ, it seems to me it would be this.

the difference between

f(x) := %o5
f(x):=''%o5
define(f(x), %o5)
define(f(x),'%o5)

and maybe a few others.
In particular, the first line, f(x):=%o5  will always return the value 
of %o5,
and if you change %o5, it will affect the meaning of f.

IF you want to re-type %o5 in to the system as the right hand side of
the definition of f, then use the second line.

Or the third line.

The fourth line is unlikely to be anything you want. It is like the 
first line.

RJF