Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 68 ยท Limits and Continuity

Limits: The Core Idea

Understand limits as the value a function approaches, use numeric tables and one-sided limits, handle infinity, and check results with sympy limit().

How fast is a car going at this instant? Speed is distance divided by time, but at a single instant no time passes and no distance is covered, which gives the meaningless 0/0. The way out is to ask what speed we approach over shorter and shorter intervals. That idea, approaching a value without having to reach it, is the limit, and the whole of calculus stands on it.

In this lesson you build the idea with tables and pictures first, then meet the precise notation, one-sided limits, infinite behaviour, and the sympy function that computes limits for you.

Approaching a value

Consider f(x) = (x**2 - 1)/(x - 1). At x = 1 the formula gives 0/0, so f(1) is undefined. Yet for x near 1 the function is perfectly well behaved. Try values closing in on 1 from both sides.

Python A numeric table of values

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 outputs march toward 2 from both sides. We write

lim (x โ†’ 1) (x**2 - 1)/(x - 1) = 2

and read it "the limit of f(x) as x approaches 1 is 2". The key point: the limit describes what happens near x = 1, not at it. The function does not even need to be defined there.

flowchart LR
    A["x approaches 1<br/>from the left"] --> C["f(x) approaches 2"]
    B["x approaches 1<br/>from the right"] --> C
    C --> D["the limit exists and equals 2"]

A two-sided limit exists when both directions agree on the same value.

Algebra explains the table: for x โ‰  1, (x**2 - 1)/(x - 1) = x + 1, and x + 1 clearly approaches 2. The graph is the straight line y = x + 1 with a single missing point, a "hole" at (1, 2).

Python The graph with a hole

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.

One-sided limits

Sometimes the left and right disagree. We write lim (x โ†’ aโป) for the left-hand limit (approaching through values smaller than a) and lim (x โ†’ aโบ) for the right-hand limit. The two-sided limit exists only if both one-sided limits exist and are equal.

A classic example is the sign function: sign(x) is -1 for negative x and +1 for positive x. As x approaches 0, the left limit is -1 and the right limit is +1. They differ, so the two-sided limit does not exist. Another is 1/x near 0: from the right it grows without bound, from the left it falls without bound.

Python Left and right can disagree

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.

For 1/x neither side settles on a finite number. We say the limit is "infinite" only when both sides blow up the same way. Here one goes to +โˆž and the other to -โˆž, so there is no two-sided limit at all.

What a table can and cannot tell you

Tables build intuition but they are not proofs, and they can mislead. Consider sin(pi/x) near 0: it oscillates faster and faster between -1 and 1, so it approaches nothing, yet a lazy table could happen to hit the same value several times. Also, round-off error can hurt: for very small h, computed values lose digits. Use tables to guess, then confirm with algebra or with a symbolic tool.

Limits at infinity and infinite limits

Two different ideas wear the word "infinity":

  • Limit at infinity: lim (x โ†’ โˆž) f(x) asks what f does as x gets enormous. For 1/x the answer is 0. This describes a horizontal asymptote, the long-run behaviour of a system, such as the final temperature of a cooling cup.
  • Infinite limit: lim (x โ†’ a) f(x) = โˆž means f grows without bound near a finite point a. This describes a vertical asymptote.
Python Behaviour for large 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 values settle toward 3, the ratio of leading coefficients. That is the horizontal asymptote y = 3. You will learn the general recipe in Limit Laws and Tricks.

Computing limits with sympy

sympy.limit(expr, variable, point) returns the exact limit. Use dir="+" or dir="-" for one-sided limits, and sp.oo for infinity.

Python sympy.limit

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 famous result sin(x)/x โ†’ 1 is the foundation for the derivative of sine, and (1 + 1/x)**x โ†’ e is one way to define the number e. Neither is easy to see from the formula alone; both are clear in a table.

For a precise definition, mathematicians say the limit is L if you can make f(x) as close as you like to L by taking x sufficiently close to a (but not equal to it). The next lessons give techniques that avoid grinding through that definition.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does lim (x โ†’ 2) f(x) = 5 tell you about f(2)?

    A limit describes behaviour near x = 2, not at it. The value at 2 can agree with the limit, differ from it, or not exist.
  2. 2. When does a two-sided limit at x = a exist?

    Both sides must approach the same finite value. For sign(x) at 0 the sides give -1 and +1, so the limit does not exist.
  3. 3. What is lim (x โ†’ โˆž) (3x2 + 5)/(x2 + 2x + 1)?

    For huge x the highest powers dominate, so the ratio approaches 3x2 / x2 = 3.
  4. 4. Which sympy call gives the right-hand limit of 1/x at 0?

    The signature is limit(expression, variable, point), and dir='+' selects approach from the right, giving infinity here.

Summary

  • A limit is the value a function approaches near a point; the function need not be defined there.
  • A two-sided limit exists only if the left and right limits agree.
  • Limits at infinity describe long-run behaviour; infinite limits describe vertical asymptotes.
  • Numeric tables suggest answers but do not prove them; confirm with algebra or sympy.limit.
  • Famous limits: sin(x)/x โ†’ 1 and (1 + 1/x)**x โ†’ e.

Next: Limit Laws and Tricks.