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 :=

colonequals

subst

colonequalserror

Advertisements

1 thought on “Functions, :, and :=”

Leave a Reply

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

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s