Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There are a few ways to do this, though I do not know exactly what you need for this so it may or may not fill your needs.

sage: f = x.mul(1/x,hold=True)
sage: f
x/x
sage: f(x=3)
1
sage: f(x=0)
<snip>
RuntimeError: power::eval(): division by zero

However, this will still give

sage: f.derivative(x)
0

So I don't know if this is exactly what you want. Also, we still don't have a way to 'unhold' other than simplification at this time.

sage: f.simplify()
1