Michael, I appreciate your very thoughtful reply. On Jan 20, 10:45 pm, Michael Orlitzky <mich...@orlitzky.com> wrote: > > ---------- Forwarded message ---------- > > From: storne...@mathisasport.com<storne...@mathisasport.com> > > > That's fine, but now I want to solve for dy/dx, so I try: > > > sage: solve(equation2.diff(),diff(f(x),x,1)) > > /home/stornetta/sage-4.7.2/local/lib/python2.6/site-packages/IPython/iplib. > > py:2260: > > 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 > > [D[0](f)(x) == -f(x)/(x + 4*f(x))] > > > as you can see, I do get an answer, but the interpreter indicates my > > approach is deprecated, and I'm not clear on how one would use named > > arguments in this situation to achieve the same result. > > f here is a symbolic function taking one argument (forget for a second > that the argument is called 'x'). f(x) means f evaluated at x, which of > course is... f(x), whatever that is. What I'm trying to get at here is > that f(x) isn't the function, f is. > > You can try: > > f = function('f',x) > sage: y = var('y') > sage: f(y) > f(y) > > the call f(y) just substitutes 'y' for 'x' in the definition of f, even > though we don't really have one, we just refer to it by name, f. It's > the same as f(x = y). > > Thus, your call to f(x) up there makes an unnecessary substitution -- > it's equivalent to f(x = x). In fact, to avoid the warning, f(x = x) is > what you would do. Of course, it's better to just pass in f and not > evaluate it: > > sage: f = function('f',x) > sage: equation2 = x*f + 2*f^2 == 1 > sage: solve(equation2.diff(),diff(f,x,1)) > [D[0](f)(x) == -f(x)/(x + 4*f(x))]
-- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org