Skip to content
Posts

cat ~/posts/mathematics-real-analysis.mdx

2026.10.21

22 min read

––– views

ibsanju

Real Analysis: Calculus With the Proofs

Limits with epsilon and delta, continuity, series, and why the derivative and the integral are limits, with worked proofs and practice questions.

Series · Part 4 of 5

Mathematics from Scratch

  1. [01]Mathematics from Scratch: Basic to Advanced, Explained Simply
  2. [02]Logic, Sets and Proofs: How Mathematicians Think
  3. [03]Linear Algebra and Differential Equations, Explained Simply
  4. [04]Real Analysis: Calculus With the Proofs (you are here)
  5. [05]Abstract Algebra, and a Map of What Comes After

Calculus, as taught in part 1, is a set of rules: differentiate this way, integrate that way. Real analysis goes back over the same ground and asks why the rules work and when they fail. The word "analysis" here means the rigorous study of calculus, not data analysis.

The main new tool is a precise definition of a limit. It is used the same way everywhere, so once it clicks, most of the subject follows. This post uses the proof methods from part 2, mainly direct proof and induction.

How to use this post

The layout is the same: the idea, how to do it, worked examples, the usual mistake, practice. Limit proofs have a fixed shape, so write out two or three of your own before moving on. Every number in the examples was checked by running the calculation.

1. Sequences and limits

A sequence is an infinite list a₁, a₂, a₃, and so on. Writing "the sequence approaches L" is vague. Here is the precise version.

Definition. A sequence aₙ has limit L if for every tolerance ε > 0 there is a number N such that, for every n ≥ N, |aₙ − L| < ε.

Read it as a game. An opponent picks any tolerance ε, however tiny. You answer with an N after which every term is within ε of L. If you can always answer, L is the limit.

How to prove a limit

  1. Scratch work: write |aₙ − L| and simplify. Solve |aₙ − L| < ε for n. That tells you how large N must be.
  2. Write the proof forwards: "Let ε > 0. Choose N so that N is larger than (the bound from step 1). Then for every n ≥ N, |aₙ − L| < ε."

Example 1: 1 ÷ n approaches 0

  • Scratch: |1/n − 0| = 1/n, and 1/n < ε exactly when n > 1/ε.
  • Proof: given ε > 0, choose N larger than 1/ε. For n ≥ N, 1/n ≤ 1/N < ε.
  • Concretely, for ε = 0.01, N = 101 works, since 1/101 is about 0.0099.

Example 2: (2n + 1) ÷ (n + 3) approaches 2

  • Scratch: (2n + 1)/(n + 3) − 2 = (2n + 1 − 2n − 6)/(n + 3) = −5/(n + 3). So the distance is 5/(n + 3).
  • That is below ε when n + 3 > 5/ε, that is n > 5/ε − 3.
  • For ε = 0.01 this says n > 497, so N = 498 works. Check: at n = 498 the distance is 5 ÷ 501, about 0.00998, which is below 0.01.

Example 3: a sequence with no limit. The sequence (−1)ⁿ goes −1, 1, −1, 1, and so on. Suppose it had a limit L and take ε = 1. Eventually every term is within 1 of L, so both a term equal to −1 and a term equal to 1 would be less than 1 away from L. But −1 and 1 are 2 apart, and the distance between them is at most |−1 − L| + |L − 1|, which would then be below 1 + 1 = 2. That is a contradiction, so no L works.

The usual mistake: choosing N first. N depends on ε, not the other way round. Another: believing a limit must be "never reached". The constant sequence 1, 1, 1, ... has limit 1, and it sits at 1 from the start.

Check yourself

In the definition of a limit, what is the order of play?

Practice

Prove that n ÷ (n + 1) approaches 1 and find N for a tolerance of 0.001. Then find N for the sequence 3 + 2 ÷ n approaching 3 with a tolerance of 0.01. Then decide whether the sequence (−1)ⁿ converges.

Show the steps and the answer
  1. The distance is |n/(n + 1) − 1| = 1/(n + 1). That is below ε when n + 1 > 1/ε, that is n > 1/ε − 1. For ε = 0.001 this says n > 999, so N = 1000 works (1 ÷ 1001 is about 0.000999).
  2. The distance is 2/n. It is below 0.01 when n > 200, so N = 201 works (2 ÷ 201 is about 0.00995).
  3. It does not converge. The terms alternate between −1 and 1, and no single number is within 1 of both.

2. Limits of functions: epsilon and delta

The same game works for functions. We say the limit of f(x) as x approaches a is L when you can force f(x) as close to L as you like by keeping x close enough to a, but not equal to a.

Definition. lim f(x) = L as x approaches a means: for every ε > 0 there is a δ > 0 such that whenever 0 < |x − a| < δ, we have |f(x) − L| < ε.

The ε is how close you want the output. The δ is how close the input must be to guarantee it. The condition 0 < |x − a| rules out x = a itself, so the value at a does not matter.

How to find δ

  1. Write |f(x) − L| and rewrite it in terms of |x − a|.
  2. If a leftover factor involves x, bound it by restricting x to a small window around a (usually δ ≤ 1).
  3. Solve for how small |x − a| must be, and take δ as the smaller of all your restrictions.

Example 1: the limit of 3x + 1 as x approaches 2 is 7

  • Scratch: |3x + 1 − 7| = |3x − 6| = 3|x − 2|. That is below ε when |x − 2| < ε/3.
  • So δ = ε ÷ 3. For ε = 0.3, δ = 0.1.

Example 2: the limit of x² as x approaches 3 is 9

  1. Scratch: |x² − 9| = |x − 3| × |x + 3|. The factor |x + 3| depends on x, so bound it.
  2. If δ ≤ 1, then x is between 2 and 4, so x + 3 is between 5 and 7, and |x + 3| < 7.
  3. Then |x² − 9| < 7|x − 3|, which is below ε when |x − 3| < ε/7.
  4. Take δ = the smaller of 1 and ε ÷ 7. For ε = 0.35, δ = 0.05. Check: at x = 3.05 the distance is 3.05² − 9 = 0.3025, below 0.35.

Example 3: why the point itself is excluded. The function (x² − 1) ÷ (x − 1) is undefined at x = 1. For every other x it equals x + 1. As x approaches 1, the values approach 2. The limit is 2 even though f(1) does not exist.

The usual mistake: treating the limit as the value at the point. The limit describes what happens near a, and it can differ from f(a), or exist when f(a) does not.

Check yourself

To prove that the limit of 3x + 1 as x approaches 2 is 7, which choice of delta works?

Practice

Find a delta in terms of epsilon for each. (a) the limit of 5x − 2 as x approaches 1 is 3. (b) the limit of 4x + 7 as x approaches 0 is 7. (c) the limit of x squared as x approaches 2 is 4.

Show the steps and the answer
  1. (a) The distance is |5x − 5| = 5|x − 1|, so δ = ε ÷ 5.
  2. (b) The distance is |4x| = 4|x − 0|, so δ = ε ÷ 4.
  3. (c) The distance is |x − 2| × |x + 2|. If δ ≤ 1 then x is between 1 and 3, so |x + 2| < 5. So δ = the smaller of 1 and ε ÷ 5. For ε = 0.1, δ = 0.02, and the largest distance in that window is about 0.08, below 0.1.

3. Continuity and the intermediate value theorem

A function f is continuous at a if the limit of f(x) as x approaches a equals f(a). That packs three requirements: f(a) exists, the limit exists, and they are equal. Polynomials, sine, cosine and eˣ are continuous everywhere.

There are three standard ways to fail:

  1. Removable: a hole, as in (x² − 1) ÷ (x − 1) at 1.
  2. Jump: the function jumps from one value to another.
  3. Infinite: the function blows up, as 1 ÷ x does at 0.

The intermediate value theorem (IVT). If f is continuous on the interval from a to b, and y is any number between f(a) and f(b), then f(c) = y for some c between a and b. A continuous function cannot skip values.

How to use it

  1. Define f so that your equation is f(x) = 0.
  2. Find two inputs where f has opposite signs.
  3. The IVT guarantees a root between them.
  4. To narrow it down, test the midpoint and keep the half where the sign changes (the bisection method).

Example: x³ + x − 1 = 0 has a root between 0 and 1

  • f(0) = −1 and f(1) = 1, so there is a root between them.
  • Each row below tests the midpoint of the current interval:
StepMidpointf at midpointRoot lies in
10.5−0.3750.5 to 1
20.750.1720.5 to 0.75
30.625−0.1310.625 to 0.75
40.68750.0120.625 to 0.6875
50.65625−0.0610.65625 to 0.6875
60.671875−0.0250.671875 to 0.6875

After 6 steps the root is trapped in an interval of width 1 ÷ 64, about 0.0156. Running the halving further gives a root of about 0.6823.

Where the theorem needs the real numbers. Take f(x) = x² − 2, which goes from −1 at x = 1 to 2 at x = 2. If you allowed only rational numbers, there would be no c with f(c) = 0, because √2 is irrational (part 2). The theorem is a statement about the real numbers, and section 6 explains what they have that the rationals lack.

The usual mistake: applying the IVT to a function that is not continuous. The function 1 ÷ x has f(−1) = −1 and f(1) = 1, but it never equals 0. It breaks at x = 0, inside the interval.

Check yourself

f(x) = 1/x has f(−1) = −1 and f(1) = 1, yet no x between them gives 0. Why does this not contradict the intermediate value theorem?

Practice

Show that x³ − 2x − 5 = 0 has a root between 2 and 3, and do one bisection step. Then show that cos x = x has a solution between 0 and 1.

Show the steps and the answer
  1. Let f(x) = x³ − 2x − 5. Then f(2) = 8 − 4 − 5 = −1 and f(3) = 27 − 6 − 5 = 16. The sign changes, f is continuous, so there is a root between 2 and 3.
  2. One step: the midpoint is 2.5 and f(2.5) = 15.625 − 5 − 5 = 5.625, which is positive. The sign change is now between 2 and 2.5, so the root is in that smaller interval.
  3. Let g(x) = cos x − x. Then g(0) = 1 is positive, and g(1) = cos 1 − 1, about −0.46, is negative. The function g is continuous, so it equals 0 somewhere between 0 and 1. That x satisfies cos x = x.

4. Series

A series is an infinite sum. It makes sense through partial sums: S₁ = a₁, S₂ = a₁ + a₂, and so on. The series converges if the sequence of partial sums has a limit, and that limit is the value of the sum.

The geometric series. The sum a + ar + ar² + ... equals a ÷ (1 − r) whenever r is between −1 and 1.

  • Why: the partial sum is Sₙ = a(1 − rⁿ) ÷ (1 − r), and rⁿ approaches 0.
  • Example: 3 + 1 + 1/3 + 1/9 + ... has a = 3 and r = 1/3, so the sum is 3 ÷ (2/3) = 9/2.
  • Example: 0.999... = 0.9 + 0.09 + 0.009 + ..., so a = 0.9 and r = 0.1, and the sum is 0.9 ÷ 0.9 = 1. So 0.999... equals 1, and this is why.

The harmonic series diverges. The sum 1 + 1/2 + 1/3 + 1/4 + ... grows without bound, even though the terms shrink to 0. The proof groups the terms:

  • 1/3 + 1/4 is at least 1/4 + 1/4 = 1/2.
  • 1/5 + 1/6 + 1/7 + 1/8 is at least 4 × 1/8 = 1/2.
  • The next 8 terms are at least 1/2, then the next 16, and so on.
  • Infinitely many groups of at least 1/2 add up past any number.

The partial sums really do keep climbing, slowly. Using 2ᵏ terms:

TermsPartial sumGuaranteed at least
21.51.5
42.0832
82.7182.5
163.3813
324.0583.5

Tests for convergence

  1. Divergence test: if the terms do not approach 0, the series diverges. (The reverse is false, as the harmonic series shows.)
  2. Ratio test: look at the ratio of each term to the one before. If it settles below 1, the series converges. If it settles above 1, it diverges. If it settles at exactly 1, the test says nothing.
  3. Alternating series: if the signs alternate and the sizes of the terms decrease to 0, the series converges. For example 1 − 1/2 + 1/3 − 1/4 + ... converges, to ln 2 (about 0.693).

Example: n ÷ 2ⁿ added over all n from 1. The ratio of consecutive terms is (n + 1) ÷ 2n, which approaches 1/2. That is below 1, so the series converges. Its sum is 2.

The usual mistake: concluding that a series converges because its terms go to 0. The harmonic series is the standard counterexample. The alternating harmonic series is also a warning in another way: rearranging its terms can change its sum. That is the Riemann rearrangement theorem, and it is one reason infinite sums need care.

Check yourself

The terms of 1 + 1/2 + 1/3 + 1/4 + ... shrink to 0. What can you conclude about the series?

Practice

Find the sum of 5 + 5/2 + 5/4 + .... Then find the sum of (1/3) + (1/9) + (1/27) + .... Then decide, using a test, whether the sum of n ÷ (n + 1) over all n from 1 converges.

Show the steps and the answer
  1. Geometric with a = 5 and r = 1/2: 5 ÷ (1/2) = 10.
  2. Geometric with a = 1/3 and r = 1/3: (1/3) ÷ (2/3) = 1/2.
  3. The terms n ÷ (n + 1) approach 1, not 0. By the divergence test the series diverges.

Answers: 10; 1/2; diverges.

5. Why the derivative and the integral are limits

Both big ideas of calculus are limits, and the definitions are the ones you now know how to use.

The derivative. The derivative of f at x is the limit as h approaches 0 of (f(x + h) − f(x)) ÷ h. You cannot just set h = 0, because that gives 0 ÷ 0. The question is what the ratio approaches as h gets small.

Example: f(x) = x²

  1. (f(x + h) − f(x)) ÷ h = ((x + h)² − x²) ÷ h = (2xh + h²) ÷ h = 2x + h.
  2. As h approaches 0, this approaches 2x. So the derivative is 2x.
  3. Numbers help: at x = 3 and h = 0.001, the ratio is 6.001, close to 6.

Move the second point toward the first and watch the slope settle:

Try it: the derivative as a slope

The derivative is the slope of a curve at one point. Take two points on y = x², draw the line through them, and move the second point closer. The slope settles on one number.

-4-22464812162024
  • slope of the secant line = (f(2) − f(1)) / 1 = 3
  • true slope at x = 1, from the rule d/dx x² = 2x: 2

The secant slope is always 2x + h. As h shrinks to 0, it becomes 2x. That limit is the derivative.

The integral. The integral is the limit of sums of thin rectangles. Take the area under y = x² from 0 to 1, using n rectangles of width 1 ÷ n and heights taken at the right end of each:

  1. The sum is (1/n)(1/n)² + (1/n)(2/n)² + ... + (1/n)(n/n)², which is (1 ÷ n³) × (1² + 2² + ... + n²).
  2. The formula from the induction practice in part 2 gives 1² + ... + n² = n(n + 1)(2n + 1) ÷ 6.
  3. So the sum is (n + 1)(2n + 1) ÷ 6n². For n = 10 that is 0.385, and for n = 100 it is 0.338.
  4. As n grows, the sum approaches 1/3. Using the left ends gives (n − 1)(2n − 1) ÷ 6n², which is 0.285 for n = 10 and 0.328 for n = 100 and also approaches 1/3. The true area is squeezed between the two.

The demo below uses left-end rectangles for y = x² from 0 to 3, where the exact area is 9. Because the curve rises, left rectangles fall short, and more rectangles close the gap. For example, 10 left rectangles give 7.695 and 100 give about 8.865.

Try it: the integral as area

The integral is the area under a curve. Estimate it with thin rectangles. More rectangles mean a better estimate.

123246810
  • sum of 3 rectangles = 5
  • exact area under y = x² from 0 to 3 = 9 (the antiderivative x³/3 gives 27/3)

The fundamental theorem of calculus ties the two together: if you build a function by accumulating the area under f, the derivative of that area function is f again. Differentiating and integrating undo each other.

Differentiable is stronger than continuous. A function with a derivative at a point is continuous there, but not the other way round. The function |x| is continuous at 0, but the slope from the right is 1 and from the left is −1, so there is no derivative.

The usual mistake: thinking the derivative is the slope between two points that are "infinitely close". The derivative is a limit of slopes between ordinary points, and it is a single number.

Check yourself

Why can't you find the derivative by putting h = 0 in (f(x + h) − f(x)) ÷ h?

Practice

Find the derivative of f(x) = 3x² − x from the definition, and evaluate it at x = 2. Then show that |x| has no derivative at 0. Then use right-end rectangles to show the area under y = x from 0 to 2 is 2.

Show the steps and the answer
  1. f(x + h) − f(x) = 3(2xh + h²) − h. Divide by h: 6x + 3h − 1. As h approaches 0 this is 6x − 1. At x = 2 the derivative is 11.
  2. For h above 0 the ratio (|h| − 0) ÷ h equals 1. For h below 0 it equals −1. The two sides disagree, so the limit does not exist.
  3. With n rectangles of width 2 ÷ n and right-end heights 2k ÷ n, the sum is (4 ÷ n²) × (1 + 2 + ... + n) = (4 ÷ n²) × n(n + 1) ÷ 2 = 2(n + 1) ÷ n. As n grows this approaches 2, which matches the triangle with base 2 and height 2.

6. Completeness: what the real numbers have that fractions lack

The rational numbers have holes. No fraction squares to 2, yet fractions get as close to √2 as you like. Newton's method starting from 1 produces 3/2, 17/12, 577/408. Their squares are 2.25, 2.0069 and 2.000006, closing in on 2, and every term is a fraction. The sequence has no limit among the fractions.

The real numbers fill those holes. The property is stated with upper bounds. A set is bounded above if some number is at least as large as everything in it. A least upper bound (or supremum) is the smallest such number.

Completeness axiom. Every non-empty set of real numbers that is bounded above has a least upper bound.

Example 1: the set of rational x with x² below 2. It is bounded above, by 2 for instance. Its least upper bound is √2, which exists among the reals but not among the fractions, so the rationals fail this property.

Example 2: three sets and their suprema

  • The numbers 1 − 1/n for n = 1, 2, 3, ...: 0, 1/2, 2/3, 3/4, and so on. The least upper bound is 1, and no member equals it.
  • The open interval from 0 to 1: least upper bound 1, not a member.
  • The closed interval from 0 to 1: least upper bound 1, and it is a member.

What follows from it. Many results rest on completeness: a bounded sequence that only goes up must converge; the intermediate value theorem; a continuous function on a closed interval attains a largest value. They fail over the rationals and hold over the reals.

The usual mistake: confusing the least upper bound with the largest element. A set can have a least upper bound without containing it, as the open interval above shows.

Check yourself

What is the least upper bound of the numbers 1 − 1/n for n = 1, 2, 3, ...?

Practice

Find the least upper bound of each set and say whether it belongs to the set. (a) the numbers 1 − 1/n for n = 1, 2, 3, .... (b) the real numbers x with x squared below 4. (c) the closed interval from 2 to 5.

Show the steps and the answer
  1. (a) 1, not in the set.
  2. (b) The set is the interval from −2 to 2 with the ends left out, so the least upper bound is 2, not in the set.
  3. (c) 5, in the set.

The mistakes in one table

MistakeWhy it failsFix
Choosing N before the toleranceN must depend on εLet ε come first, then solve for N
Taking the limit to be f(a)The limit ignores the value at aLook at nearby values only
Using the IVT without continuityThe function can jump over valuesCheck continuity on the whole interval
Series converge because terms go to 0The harmonic series divergesUse the ratio test or another test
Setting h = 0 in the derivative quotientIt gives 0 ÷ 0Take the limit as h approaches 0
Least upper bound means largest memberThe open interval has no largest memberCheck whether the bound is in the set

Where to go next

The next post in the series moves from analysis to abstract algebra. For more analysis, the book Understanding Analysis by Stephen Abbott is recommended for learning epsilon and delta proofs, and Jay Cummings' Real Analysis: A Long-Form Mathematics Textbook has more commentary and motivation than most. For video, Francis Su's analysis lectures and the University of Toronto MAT137 videos on YouTube are both recommended. Walter Rudin's Principles of Mathematical Analysis is the classic demanding follow-up.

Sources and further reading

  • Stephen Abbott, Understanding Analysis.
  • Jay Cummings, Real Analysis: A Long-Form Mathematics Textbook.
  • Francis Su, real analysis video lectures (YouTube), and the MAT137 videos from the University of Toronto.
  • Walter Rudin, Principles of Mathematical Analysis.
  • How to self-study real analysis, an article that recommends the first three items above.

Enjoyed this? Leave a reaction

Share this article

Comments

Loading comments…

Leave a comment

Enjoying this post?

Don't miss out. Get an email whenever I post, no spam.

Subscribe Now