>
> Hi guys,
>
> This is so simple that probably someone else has already noticed it, but
> just in case:
>
> sage: x,t = var('x,t')
> sage: f = (1-x)/(1-x*cos(t))
> sage: f(x=1)
> 0
> sage: f(t=0)(x=1)
> 1
>
>
My guess is that this is more of a convention than anything else.
sage: x/x
1
sage: 0/x
0
Maxima:
(%i1) x/x;
(%o1) 1
(%i2) 0/x;
(%o2) 0
If Mma and Maple do it too, that would be my guess. In any case, it is
'known' and I bet you'll find other examples with a search of the email
lists (though searching for x/x might be hard!). It's possible to not
immediately do such reductions
sage: x.mul(1/x,hold=True)
x/x
but I'm not sure how to combine that with the substitution that you are
doing.
- kcrisman
The second one is, of course, the correct answer. (FYI, Mathematica9 fails,
> too.)
>
> Wouldn't the first one return some sort of conditional expression: "if t=0
> then 1, else 0"
>
> I would be happy to help in the debugging, if I can get some indication of
> what is running in the background, i.e. what function is called when one
> does the substitution "f(x=1)".
>
> Cheers,
> Jesús Torrado
>
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.