| 1 | initial version |
For substituting a function, you should use substitute_function, not subs;
sage: y = function('y')
sage: f = diff(y(x), x) + 5*y(x)
sage: y0(x) = x^2
sage: f.substitute_function(y, y0)
5*x^2 + 2*x
Note the definition y = function('y') instead of y = function('y')(x). Of course, you can always introduce some abbreviation for y(x), with a symbol different from y, e.g.
sage: Y = y(x)
sage: f = diff(Y, x) + 5*Y
sage: f.substitute_function(y, y0)
5*x^2 + 2*x
| 2 | No.2 Revision |
For substituting a function, you should use substitute_function, not subs;:
sage: y = function('y')
sage: f = diff(y(x), x) + 5*y(x)
sage: y0(x) = x^2
sage: f.substitute_function(y, y0)
5*x^2 + 2*x
Note the definition y = function('y') instead of y = function('y')(x). Of course, you can always introduce some abbreviation for y(x), with a symbol different from y, e.g.
sage: Y = y(x)
sage: f = diff(Y, x) + 5*Y
sage: f.substitute_function(y, y0)
5*x^2 + 2*x
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.