> > I understand that
>
> > f = sin(x)
>
> > and
>
> > f(x) = sin(x)
>
> > define two different objects in Sage.  When I introduce Sage to my
> > calc students, I want to get them to be able to use Sage with minimal
> > confusion and technicality and to accomplish the common tasks in
> > calculus, such as plotting, computing numerically and symbolically,
> > simplifying, differentiating and integrating. Which one do you think
> > is better?
>
> I think f(x) = sin(x) is better for that purpose.
>
> 1.  You can also do f(z) = sin(z) without having to first declare z.
>
> 2. Plotting will *know* that z is the variable.
>
> 3. It emphasizes that you wish to think of the expression on the right as a
> function of z.

It will also avoid annoying DeprecationWarnings for the day when f=sin
(x) is no longer supported as a callable function.  In 4.1.1:

sage: f=sin(x)
sage: f(2)
/Users/.../sage/local/lib/python2.6/site-packages/IPython/iplib.py:
2073: DeprecationWarning: Substitution using function-call syntax and
unnamed arguments is deprecated and will be removed from a future
release of Sage; you can use named arguments instead, like EXPR(x=...,
y=...)
  exec code_obj in self.user_global_ns, self.user_ns
sin(2)

Although hopefully that day will never actually come for expressions
with a single free variable, it sounds like it will, so for
reusability's sake alone probably f(x)=sin(x) is better.

- kcrisman
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-edu?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to