The l'Hopital's rule can be used to evaluate limits of the form `lim_(x-> a)f(x)/g(x)`if when x is substituted by a, `f(x)/g(x) = 0/0 or f(x)/g(x) = oo/oo`
This is the constraint that has to be kept in mind when a limit is being evaluated using the l'Hopital's rule. There are many types of indeterminate forms `oo - oo` , `0^oo` , `0^0` , `oo^0` , etc. Only if substitution yields the indeterminate forms `0/0 and oo/oo` can the l'Hopital's rule be used. Else the solution that we get need not be correct.
For example, `lim_(x->2) (x^2 + 4x + 6)/(x - 2)` cannot be determined using l'Hopital's rule as the numerator does not become equal to 0, only the denominator does. Using l'Hopital's rule here gives 2*2 + 4 = 8 which is not the right result. The correct limit is infinity.