SigmaField
Mathematical Foundations for Quant Finance
0 of 256 lessons
      1. 2.1.1 Limits: what a function approachesConcept · 25 min
      2. 2.1.2 One-sided limits and continuityConcept · 30 min
      3. 2.1.3 Limits at infinityConcept · 30 min
      4. 2.1.4 Practice set: limitsPractice set · 25 min
      5. 2.1.5 Case study: continuous compounding as a limitCase study · 30 min

Level 2, Single-variable calculus 2.1 Limits and continuity Lesson 2 of 5

ConceptLesson 2.1.2 in Level 2, Single-variable calculus. About 30 minutes.

One-sided limits and continuity

One-sided limits

A one-sided limit looks at one side of a point only. Approaching from the left uses inputs just below aa; approaching from the right uses inputs just above it. In lesson 2.1.1 the two sides always agreed, but sometimes they do not.

Take f(x)=∣x∣xf(x) = \dfrac{|x|}{x}, which is undefined at 0. The absolute value ∣x∣|x| is xx when x≥0x \ge 0 and −x-x when x<0x < 0 (lesson 0.3.3).

So for every positive xx, f(x)=xx=1f(x) = \frac{x}{x} = 1, and for every negative xx, f(x)=−xx=−1f(x) = \frac{-x}{x} = -1. The table shows the same:

xx−0.1-0.1−0.01-0.01−0.001-0.0010.0010.010.1
∣x∣x\frac{\lvert x \rvert}{x}−1-1−1-1−1-1111

From the left the outputs stay at −1-1; from the right they stay at 1. Each side has a limit, but the two differ.

Rule: One-sided limits

lim⁡x→a−f(x): from the left (x<a)lim⁡x→a+f(x): from the right (x>a)\begin{gathered} \lim_{x \to a^-} f(x): \text{ from the left } (x < a) \\ \lim_{x \to a^+} f(x): \text{ from the right } (x > a) \end{gathered}

The small minus sign means xx approaches from below aa, the plus sign from above. The ordinary limit exists only when both one-sided limits exist and are equal.

For ∣x∣x\frac{|x|}{x} at 0, the left limit is −1-1 and the right limit is 1. They differ, so lim⁡x→0∣x∣x\lim_{x \to 0} \frac{|x|}{x} does not exist.

In the explorer, shrink the gap and watch the two points. However close they come to 0, one output stays at −1-1 and the other at 1. Then switch to the hole from lesson 2.1.1 to see two sides that agree.

Explore

Pick a gap and watch the two points close in on x = 0 from the left and the right. Turn on zoom to follow them in.

−202−2−1012
From the left
f(−0.5) = −1
From the right
f(0.5) = 1
Verdict
The left side stays at −1 and the right side at 1. They never agree, so there is no limit.

Try it

sp.limit takes a fourth argument for the side: "-" for the left, "+" for the right.

It confirms −1-1 and 1. Without the fourth argument, SymPy checks only the right side, so always give the side when the two may differ.

⌘/Ctrl + Enter runs the cell

A jump in a piecewise function

A piecewise function (lesson 1.1.2) can jump where its pieces meet. Take

f(x)={x2if x<2x−1if x≥2f(x) = \begin{cases} x^2 & \text{if } x < 2 \\ x - 1 & \text{if } x \ge 2 \end{cases}

Just left of 2, only the first piece is used, so the left limit is 22=42^2 = 4. Just right of 2, only the second piece is used, so the right limit is 2−1=12 - 1 = 1. The input 2 itself belongs to the second piece, so f(2)=1f(2) = 1.

The two pieces meet x=2x = 2 at different heights. The left limit is 4, the right limit is 1, and the filled dot shows that f(2)=1f(2) = 1.

Try it

The cell tabulates ff from both sides of 2. From the left the outputs climb towards 4 (3.61, 3.9601, 3.996001); from the right they fall towards 1 (1.1, 1.01, 1.001).

round(…, 6) hides rounding errors in the last digits.

⌘/Ctrl + Enter runs the cell

Blow-ups, side by side

A blow-up can go a different way on each side. For 1x\frac{1}{x} near 0, inputs 0.1, 0.01 and 0.001 give 10, 100 and 1000. Inputs −0.1-0.1, −0.01-0.01 and −0.001-0.001 give −10-10, −100-100 and −1000-1000.

So lim⁡x→0+1x=∞\lim_{x \to 0^+} \frac{1}{x} = \infty and lim⁡x→0−1x=−∞\lim_{x \to 0^-} \frac{1}{x} = -\infty: it grows without bound to the right and falls without bound to the left. For 1x2\frac{1}{x^2} both sides give ∞\infty. Either way no number is approached, so neither function has a limit at 0.

At the edge of a domain

Some functions exist on one side of a point only. x\sqrt{x} needs x≥0x \ge 0 (lesson 1.1.1), so at 0 there is no left side to look at. The right limit is all there is: lim⁡x→0+x=0\lim_{x \to 0^+} \sqrt{x} = 0.

ln⁡x\ln x needs x>0x > 0, and near 0 it falls without bound. It gives −2.302585-2.302585 at 0.1, −6.907755-6.907755 at 0.001 and −13.815511-13.815511 at 10−610^{-6}, so lim⁡x→0+ln⁡x=−∞\lim_{x \to 0^+} \ln x = -\infty.

Try it

SymPy gives each one-sided limit of this section: 1x\frac{1}{x} from both sides, 1x2\frac{1}{x^2} from both sides, then x\sqrt{x} and ln⁡x\ln x from the right.

oo is SymPy's ∞\infty, and sp.log is ln⁡\ln.

⌘/Ctrl + Enter runs the cell

Continuity

A function is continuous at aa when its graph has no break there: you can draw through aa without lifting your pen. In terms of limits, the value at aa is exactly where the graph is heading.

Rule: Continuity at a

lim⁡x→af(x)=f(a)\lim_{x \to a} f(x) = f(a)

Three things must hold: f(a)f(a) exists, the limit at aa exists, and the two are equal. At the edge of a domain, use the one-sided limit from inside.

A function is continuous on an interval when it is continuous at every point of it. Polynomials, exe^x, sin⁡x\sin x and cos⁡x\cos x are continuous everywhere. x\sqrt{x} is continuous for x≥0x \ge 0 and ln⁡x\ln x for x>0x > 0.

Sums, products and ratios of continuous functions are continuous too, except where a bottom is 0. That is why substitution worked in lesson 2.1.1. For example, x+1x−5\frac{x + 1}{x - 5} is continuous at every input except 5.

Three ways to break

A hole, a jump and a blow-up. Only the hole has a limit at the break; the other two have none.

  • A hole: the limit exists, but f(a)f(a) is missing or different. x2−1x−1\frac{x^2 - 1}{x - 1} at 1 has limit 2 and no value. Defining f(1)=2f(1) = 2 fills the hole, which is why a hole is also called a removable break.
  • A jump: both one-sided limits exist but differ, as with ∣x∣x\frac{|x|}{x} at 0, or the piecewise ff above at 2. No choice of f(a)f(a) can fix it.
  • A blow-up: the outputs run off to ∞\infty or −∞-\infty on at least one side, as with 1x\frac{1}{x} at 0.
Check yourself
What kind of break does x+1x2−1\dfrac{x + 1}{x^2 - 1} have at x=−1x = -1?

Joining the pieces

You can choose a piecewise function's numbers so the pieces meet. Take f(x)=x+kf(x) = x + k for x<1x < 1 and 3x3x for x≥1x \ge 1. The left limit at 1 is 1+k1 + k, and the right limit and the value are both 3×1=33 \times 1 = 3.

They are equal when 1+k=31 + k = 3, so k=2k = 2 makes ff continuous. With k=2k = 2, the inputs 0.999, 1 and 1.001 give 2.999, 3 and 3.003, with no jump.

Try it

The cell checks the join with k=2k = 2, then shows the jump that k=0k = 0 would leave: 0.999 on the left against 3.003 on the right.

⌘/Ctrl + Enter runs the cell

Why bisection needs continuity

Bisection (lesson 1.3.2) keeps the half of an interval where the sign of ff changes. It relies on one fact: a function that is continuous on [a,b][a, b] and changes sign must cross 0 in between. A graph without breaks cannot get from below the axis to above it without crossing.

Without continuity the fact fails. For 1x\frac{1}{x} on [−1,2][-1, 2], f(−1)=−1f(-1) = -1 and f(2)=0.5f(2) = 0.5 have opposite signs, yet 1x\frac{1}{x} is never 0. Bisection still runs: it closes in on 0, the blow-up, where 1x\frac{1}{x} is huge.

Try it

The bisection of lesson 1.3.2, run on 1x\frac{1}{x} over [−1,2][-1, 2]. After 22 steps it reports about 0.00000012, where 1x\frac{1}{x} is 8,388,608: a break, not a root.

Check that ff is continuous on the bracket before trusting the answer.

⌘/Ctrl + Enter runs the cell

Continuous does not mean smooth. ∣x∣|x| is continuous at 0, since both one-sided limits and the value are 0, but it has a corner there. Lesson 2.2.1 uses one-sided limits to find slopes, and lesson 2.2.2 shows why the corner has none.

Common mistakes

  1. Check both sides. A limit from one side says nothing about the other. The limit exists only when the two agree.
  2. The value is a separate question. For the piecewise ff, f(2)=1f(2) = 1 matches the right limit, yet the limit at 2 does not exist. Find the piece that holds aa itself, as in lesson 1.1.2.
  3. a−a^- means "from below aa", not "negative". x→2−x \to 2^- uses inputs like 1.99, which are positive.
  4. A limit can exist where the function is not continuous. A hole has a limit but no value, or the wrong value.
  5. ∞\infty from both sides is still no limit. 1x2\frac{1}{x^2} grows without bound on both sides of 0, and ∞\infty is not a number.
  6. A sign change proves a root only for a continuous function. 1x\frac{1}{x} changes sign across 0 without ever being 0.

One-sided limits and continuity

0 of 12 correct

  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.
  9. 9.
  10. 10.
  11. 11.
  12. 12.
How to type answers
  • Powers with ^: x^7, 2^(1/3), a^-2.
  • Multiply with * or by writing side by side: 3x^2, 2(x+1).
  • ln(x) is the natural log, log(x, 2) is log base 2, e is Euler's number, sqrt(x) is a square root.
  • sin(x), cos(x) and tan(x) take radians; write pi for π and sin(x)^2 for sin²x.
  • Your first answer to each question is saved: it counts towards your score and brings the question back for review.
  • Exact answers like ln(20)/ln(3) are best. Decimals need about 4 significant figures.

Summary card

  • lim⁡x→a−\lim_{x \to a^-} approaches from the left and lim⁡x→a+\lim_{x \to a^+} from the right. The limit exists only when both exist and agree.
  • A limit fails at a jump (the sides differ) or a blow-up (the outputs run off to ±∞\pm\infty). At the edge of a domain, only one side exists.
  • Continuous at aa means lim⁡x→af(x)=f(a)\lim_{x \to a} f(x) = f(a). Breaks are holes, jumps or blow-ups; only a hole can be filled.
  • Join the pieces of a piecewise function by making the one-sided limits equal.
  • A continuous function that changes sign has a root in between; without continuity, a sign change proves nothing.

Free further reading

Optional. This lesson covers what you need; these add more examples and practice. All are free to read.