Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Mathematica 9 If I write:

f[x_] = (x - 1)/(x - 1)

I get


And if then I write:


I get


But if I write:

(1 - 1)/(1 - 1)

I get:


Why am I not getting Indeterminate for f[1] when f[x_] = (x - 1)/(x - 1) ?

What am I doing wrong?

share|improve this question

closed as too localized by Yves Klett, Simon Woods, Artes, R. M. Jan 3 '13 at 14:18

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Thanks to @Nasser comment, I found my mistake, I was using = instead of :=. The basic difference between these forms is when the expression is evaluated. = is an immediate assignment, which is evaluated at the time when the assignment is made. := on the other hand, is a delayed assignment, which is not evaluated when the assignment is made, but is instead evaluated each time its value is requested, more info here:

share|improve this answer
By the way, if you had typed ?f following the original definition of f, you would have seen why it was returning 1. – Cassini Jan 3 '13 at 14:12

Not the answer you're looking for? Browse other questions tagged or ask your own question.