I notice that VerificationTest will see False for a function in cell 1

f[x_] :=(x - 1) (x - 3) / (x + 2)

referred to in cell 2:

VerificationTest[Limit[f[x], Rule[x, -2]], \[Infinity]]

after hitting Shift+Enter in cell 2 only (in a newly-opened notebook with many, many cells) —but Evaluation > Evaluate Notebook will cause VerificationTest to see True. Is there some default option or something I am missing here or is this just the way it is for now?


closed as off-topic by bbgodfrey, corey979, Bob Hanlon, m_goldberg, MarcoB Nov 8 '16 at 4:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – bbgodfrey, corey979, Bob Hanlon, m_goldberg, MarcoB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ You presumably intend your function to be f[x_] := (x - 1) (x - 3)/(x + 2) since you expect a pole at x == 2. Your Limit is written improperly using RightArrow[x, -2] rather than Rule[x, -2] See documentation for Rule The Limit should not successfully evaluate no matter how you initiate the evaluation. $\endgroup$ – Bob Hanlon Nov 7 '16 at 20:53
  • $\begingroup$ @bob-hanlon your presumption is correct. I have updated my question. Once I get back to my Mathematica machine, I will verify my Limit syntax. Why would an error not be thrown? $\endgroup$ – rasx Nov 7 '16 at 21:32
  • $\begingroup$ The VerificationTest outcome is Failure this presumably covers all errors. If you extract the Limit and evaluate it separately, it returns the error message "Limit::lim: Limit specification x[RightArrow]-2 is not of the form x -> x0." and returns the Limit unevaluated. $\endgroup$ – Bob Hanlon Nov 7 '16 at 21:42
  • $\begingroup$ So what you are saying is that you wrote down the definition of f, didn't evaluate it (so f remained undefined), and only ran the verification test? $\endgroup$ – Rahul Nov 8 '16 at 6:00
  • $\begingroup$ @rahul I am saying that f is defined in a different cell (in a notebook full of cells) from the cell with the test in it. I see now that cells are lazy loaded: i need to Shift+Enter on the f cell as well as the test cell ---this answers my question part but does not answer the possibility that Mathematica can be configured to behave differently... $\endgroup$ – rasx Nov 8 '16 at 8:09

I think you improperly copied your function

  • You wrote: f[x_] :=(x - 1) (x - 3) / x + 2

  • I think you meant to write: f[x_] :=(x - 1) (x - 3) / (x + 2)

When you define you function in the latter form, this is what the code yields when you click Shift+Enter: enter image description here

  • $\begingroup$ Your correction is correct but did you just enter the correct function and hit Shift+Enter or did you have to Evaluate Notebook? (What I entered in my question is NOT what I entered in Mathematica...) $\endgroup$ – rasx Nov 7 '16 at 21:23
  • 1
    $\begingroup$ I simply hit Shift+Enter and it worked. $\endgroup$ – Jake Feuerman Nov 7 '16 at 21:30
  • $\begingroup$ @jake_feuerman from your screenshot above, I am very certain that should you not enter (hit Shift+Enter) cell 3 (which can happen quite naturally after opening a closed notebook) but hit Shift+Enter for cell 4 you will get the behavior described in my question. It would be a bit tragic when the moderators fail to perform this simple test. $\endgroup$ – rasx Nov 8 '16 at 4:52

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