Skip to content
Tutorials Center
My learning

Topics

Lesson 5 of 68 Β· Limits and Continuity

Limit Laws and Tricks

Compute limits with the limit laws, resolve 0/0 by factoring and conjugates, use the squeeze theorem, find limits at infinity, and verify with sympy.

Tables of numbers are good for guessing, but you do not want to build a table every time. Fortunately limits obey simple rules, so most are computed by algebra. This lesson gives you the rules, then the standard tricks for the stubborn cases where plugging in produces 0/0 or infinity/infinity.

Always begin by trying direct substitution. If it gives a number, you are done. Only when it produces a meaningless form do the tricks below come into play.

The limit laws

Suppose lim f(x) = A and lim g(x) = B as x β†’ a, with A and B finite. Then:

Law Result
Sum / difference lim (f Β± g) = A Β± B
Constant multiple lim (cΒ·f) = cΒ·A
Product lim (fΒ·g) = AΒ·B
Quotient lim (f/g) = A/B, if B β‰  0
Power lim f(x)**n = A**n
Root lim n-th root of f = n-th root of A (with A β‰₯ 0 for even n)

For polynomials and most everyday formulas these laws mean the limit is just the value: lim (x β†’ 2) (x**2 + 3x) = 4 + 6 = 10. That property is called continuity, studied in the next lesson.

Indeterminate forms

If substitution yields 0/0, the result is called indeterminate: it can be any number, so you must dig deeper. Other indeterminate forms are ∞/∞, ∞ βˆ’ ∞, 0·∞, 1**∞, 0**0 and ∞**0. A value like 5/0 is not indeterminate; it signals a vertical asymptote or an infinite limit.

flowchart TD
    S["Substitute x = a"] --> Q{"Result?"}
    Q -->|"a number"| D["Done: that is the limit"]
    Q -->|"nonzero / 0"| V["Vertical asymptote:<br/>check each side"]
    Q -->|"0/0"| T["Try factoring,<br/>conjugates, common denominators"]
    T --> D

Substitute first; use tricks only when you land on 0/0.

Trick 1: factor and cancel

The numerator and denominator of a 0/0 rational function share a factor that vanishes at a. Factor it out, cancel, and substitute again. The cancellation is legitimate because limits ignore the single point x = a.

For lim (x β†’ 3) (x**2 - 9)/(x - 3): factor to (x - 3)(x + 3)/(x - 3) = x + 3, which approaches 6.

Trick 2: multiply by the conjugate

When square roots cause the trouble, multiply top and bottom by the conjugate, the same expression with the opposite sign in the middle. The product (a - b)(a + b) = a**2 - b**2 removes the root.

For lim (x β†’ 4) (sqrt(x) - 2)/(x - 4): multiply by (sqrt(x) + 2)/(sqrt(x) + 2). The numerator becomes x - 4, which cancels, leaving 1/(sqrt(x) + 2), which approaches 1/4.

Python Factoring and conjugates, checked by sympy

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Both forms give the same numbers because they are the same function for x β‰  4; the second one simply is defined at 4 and reveals the limit 0.25.

Trick 3: combine fractions

For ∞ βˆ’ ∞ or fractions inside fractions, put everything over a common denominator. Example: lim (x β†’ 0) (1/x βˆ’ 1/(x**2 + x)). Both terms blow up, but over the common denominator x(x + 1) the difference is ((x + 1) βˆ’ 1)/(x(x + 1)) = x/(x(x + 1)) = 1/(x + 1), which approaches 1.

The squeeze theorem

Sometimes a function wobbles too wildly for algebra but is trapped between two simpler functions. If g(x) ≀ f(x) ≀ h(x) near a, and g and h both approach L, then f is squeezed to L as well.

The standard example: x**2 Β· sin(1/x) near 0. The sine factor jumps wildly between -1 and 1, but -x**2 ≀ x**2Β·sin(1/x) ≀ x**2, and both bounds go to 0. So the limit is 0.

Python Squeezing x^2 sin(1/x)

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The wiggly curve never escapes the pair of parabolas, so it is pulled to 0 at the origin. The same idea proves sin(x)/x β†’ 1.

Limits at infinity

For rational functions, divide numerator and denominator by the highest power of x in the denominator, or just compare degrees:

  • Degree of top < degree of bottom: limit is 0.
  • Degrees equal: limit is the ratio of leading coefficients.
  • Degree of top > degree of bottom: the limit is infinite (the sign depends on the leading terms).

For expressions with roots, such as sqrt(x**2 + x) βˆ’ x, multiply by the conjugate first. Be careful: sqrt(x**2) = |x|, which equals -x when x β†’ βˆ’βˆž.

Python Limits at infinity, three ways

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The results are 5/2, 0, infinity and 1/2. The last one is a nice surprise: two quantities that both grow without bound differ by a number that settles at one half. The numeric check shows the same trend, though for very large t round-off begins to creep in, as you will see in Floating-Point Error and Conditioning.

L'HΓ΄pital's rule and the other indeterminate forms

For 0/0 or ∞/∞, there is a derivative-based shortcut called L'Hôpital's rule. It needs derivatives, so it is a preview of Differentiation Rules; the algebraic tricks above are still valuable because they work without derivatives and often give more insight.

L'Hôpital's rule. Suppose f and g are differentiable near a (except possibly at a), g'(x) != 0 there, and f(x) / g(x) has the form 0/0 or ∞/∞ as x approaches a (where a may also be ±∞). If f'(x) / g'(x) has a limit L (finite or infinite), then f(x) / g(x) has the same limit L.

Note what the rule says: differentiate the top and the bottom separately (this is not the quotient rule), then take the limit again. If the new quotient is still 0/0 or ∞/∞, apply the rule again. For example, (e**x - 1 - x) / x**2 is 0/0 at x = 0. One step gives (e**x - 1) / (2x), still 0/0. A second step gives e**x / 2, whose limit is 1/2. The rule is a consequence of Cauchy's mean value theorem, proved in Mean Value Theorems.

Other indeterminate forms

The seven classic indeterminate forms are 0/0, ∞/∞, 0 · ∞, ∞ - ∞, 1^∞, 0^0 and ∞^0. The rule applies directly only to the first two, so the others must be rewritten first:

Form Rewrite Example
0 · ∞ write f g as f / (1/g) to get 0/0 or ∞/∞ x ln x as ln x / (1/x)
∞ - ∞ combine into one fraction (common denominator) 1/x - 1/sin x
1^∞, 0^0, ∞^0 take logarithms: L = e^(lim ln f), and the new limit is a 0 · ∞ form (1 + 1/x)^x, x^x, x^(1/x)

For (1 + 1/x)**x as x grows, ln L = lim x ln(1 + 1/x), which is ∞ · 0. Rewritten as ln(1 + 1/x) / (1/x) it is 0/0, and one step gives 1, so L = e. This is how the famous limit e arises and why continuous compounding appears in engineering formulas.

Python The indeterminate forms with sympy

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The results show the pattern ln x / sqrt(x) -> 0 and x**3 / e**x -> 0: exponentials beat polynomials and polynomials beat logarithms. Also x ln x -> 0 as x approaches 0 from the right, and x**x -> 1. A limit of an indeterminate form can be anything (here 1/2, 0, 1, e), which is exactly why the form alone tells you nothing.

Pitfalls

  1. Check the form first. (x + 1)/(x + 3) at x = 0 is 1/3, not indeterminate. Applying the rule anyway gives 1, which is wrong.
  2. The derivative ratio must have a limit. The rule goes one way only. For (x + sin x) / x as x grows, the derivative ratio 1 + cos x oscillates forever and has no limit, yet the original limit exists and equals 1 (divide top and bottom by x, since sin x / x -> 0).
  3. Do not use it in circles. The limit sin(x)/x -> 1 is often proved using the derivative of sine, so deriving that derivative with the rule is circular.
  4. Sometimes it never terminates. For sqrt(x**2 + 1) / x as x grows, differentiating just flips the fraction back and forth. Algebra (divide by x) wins immediately.
Python Pitfalls: oscillating derivative ratio and wrong use

Press Run (or Ctrl + Enter) to see the result here.

Program input Β· what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The original quotient settles to 1 while the derivative ratio keeps swinging between 0 and 2, which shows the rule's one-way logic: a missing limit for f'/g' proves nothing about f/g.

Check your understanding

Quick check Β· 4 questions

of 4 answered You scored / 4 Β· perfect!

  1. 1. What is lim (x β†’ 5) (x**2 - 25)/(x - 5)?

    Factor the numerator as (x - 5)(x + 5), cancel (x - 5), and substitute x = 5 into x + 5 to get 10.
  2. 2. Which form is NOT indeterminate?

    A nonzero number divided by something approaching zero blows up, signalling an infinite limit or asymptote. The other forms need more work.
  3. 3. The squeeze theorem proves lim x**2 sin(1/x) = 0 at x = 0 because:

    Since the sine is between -1 and 1, the product is bounded by -x2 and x2. Both bounds go to 0, so the function is forced to 0.
  4. 4. What is lim (x β†’ ∞) (5x3 + x)/(2x3 - 7)?

    The degrees match, so the limit is the ratio of the leading coefficients: 5/2.

Summary

  • Substitute first. Limit laws let you split sums, products and quotients (with nonzero denominators).
  • 0/0 is indeterminate: factor and cancel, multiply by a conjugate, or combine fractions.
  • The squeeze theorem traps a wild function between two tame ones with the same limit.
  • At infinity, compare degrees of rational functions, and use conjugates for roots.
  • Confirm answers with sympy.limit or a quick numeric table.

Next: Continuity.