# l'Hôpital guidelines

Suppose we want to evaluate

$$\lim_{x \to 0} \; x \log (x)$$

If we write this in the form $x/(1/\log(x))$, then l'Hôpital's rule does not work, but if we write it as $\log(x)/(1/x)$, it does. Is there any sort of general guideline to choosing the numerator and denominator?

• Note that the limit as written does not exist, and L'Hopital's is irrelevant: $\log x$ is not defined on an interval containing $0$: it's only defined to the right of $0$. Of course, you can take the limit as $x\to 0^+$. Rule of thumb: make choices that make the derivatives simpler or at least no harder than the original. $\frac{1}{\log x}$ has a derivative which is harder than the original, so it's not a good choice. – Arturo Magidin Sep 8 '11 at 3:13

## 2 Answers

There is no known general algorithm to choose which way to apply L'Hospital's rule. Sometimes $\rm\: N'/D'\:$ works and sometimes $\rm\: (D^{-1})'/(N^{-1})'\:$ works. If you iteratively try both cases then you get combinatorial explosion: $\rm\:2^k\:$ possibilities upon $\rm\:k\:$ successive applications of the rule (not to mention possibly intractable intermediate expression swell with expressions that grow under differentiation, e.g. exponentials). There are some heuristics that sometimes help in practice, e.g. see the papers below on early heuristic approaches to computing limits in computer algebra systems.

D. Gruntz. On Computing Limits in a Symbolic Manipulation System.
Steven J. Harrington. A symbolic limit evaluation program in REDUCE.
Jean-Pierre Laurent. A program that computes limits using heuristics to evaluate the indeterminate forms.

However, there are effective algorithms for computing limits of large classes of elementary and special functions. They do not employ L'Hopital's rule. In fact I devised the first known algorithm when I was an MIT student. It employs a sort of generalized power series expansion in terms of certain asymptotic kernels (technically it employs differential valuation theory in Hardy-Rosenlicht fields). For an introduction to similar ideas see G. Edgar's Transseries for beginners.

Below is an example of my (Macsyma) algorithm computing (my generalization of) a limit suggested by Rich Schroeppel, who - not believing in the existence of an algorithm for limits - designed a monstrous expression in an attempt to thwart the algorithm • Maple can do this one too: > d1:= exp(exp(exp(exp(-exp(exp(x))-exp(x)-x+a)+x)))-exp(exp(exp(x))); > limit(d1, x=infinity); $$e^a$$ – Robert Israel Sep 8 '11 at 4:11
• @Rob Back in the dark ages - when I first devised my algorithm (circa 1980) - no computer algebra system could handle such limits. Then it was a major open problem in computer algebra to find a general algorithm for computing limits - to complement the recently discovered algorithms for integration and ODE solution. Now most leading systems have (partially) implemented some variation on these ideas (my work, or Shackell's, or transseries - which are all closely related). – Bill Dubuque Sep 8 '11 at 4:41

One general guideline is, you want to write your indeterminate form as $f/g$ where $f'/g'$ is going to be "simpler" than $f/g$. Now taking the derivative of a logarithm makes it simpler (i.e. rational rather than transcendental), so a logarithmic factor should, if possible, be isolated by itself as $f$ or $g$. The same goes for arctan.