Direct sustitution does not work for this example because the denominator would be zero...not allowed.
(x^2-x-2) the numerator can be factored to (x-2)(x+1)
now (x-2)(x+1) / (x-2) becomes (x+1) the equation of a line (except x cannot equal 2)
Then as x approaches 2 the limit becomes (x+1) = 3
Here is the graph: (note: I drew a little hole in the graph at x=2)