I had tried the code below in Mathematica 8:
f[z_] := (5 + 1/(z-a)) / ( 8 + 1/(z-a))
f[a]
and surprisingly I got following warnings:
Power::infy: Infinite expression 1/0 encountered. >>
Power::infy: Infinite expression 1/0 encountered. >>
Infinity::indet: Indeterminate expression 0 ComplexInfinity encountered. >
and the output is Indeterminate, which I think is not true because obviously it’s 1.
What’s weird is that when I changed the code to:
Simplify[(5 + 1/(z-a)) / ( 8 + 1/(z-a))] /. a -> z
I got the correct output 1. Why is that? And how should I deal with expressions involving ∞/∞ ?
Usually:
Edit
You may also add a
Directionoption to take the limit coming from either side if necessary:or
Edit 2
The weird behavior of Simplify[ ] (allowing some mathematically indefinite expressions to evaluate) is well documented in the help: