Functions, :, and :=

I’m really posting this for myself to act as a big paperweight.  Whenever I forget about :=  and : for functions in Maxima, I can refer to this page.

The gist:

  • g(x):=x^2  results in a function you can evaluate as g(3)
  • f: x^2 results in an expression you can evaluate with ev(f,x=3)
  • ev works with both:  ev(g(x),x=3)  or ev(f,x=3)
  • also subst(x=3,f) and subst(x=3,g(x))
  • based on our definition, g doesn’t have a meaning…only  g(x) does
  • likewise, f(3) doesn’t have a meaning here…only the symbol f does
  • finally h:=x^2 gives an error — explicit dependent variable needed with :=





2 thoughts on “Functions, :, and :=”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: