Ask Your Question

Revision history [back]

You can use the function() method of symbolic expressions to obtain a callable symbolic expression, which is what you get with f(x) = x+2.

sage: b = y == x + 2
sage: b
y == x + 2
sage: f = b.rhs().function(x)
sage: f
x |--> x + 2

Note that you need to specify the argument of the function, in this case x, explicitly.