Why This Matters
The concept of a limit is the gateway to calculus. A limit describes what value a function approaches as the input gets closer and closer to some target -- even if the function is not defined at that exact point. For example, sin(x)/x is undefined at x = 0, but as x approaches 0, the value approaches 1.
Limits also formalize what we mean by infinity: what happens as x grows without bound, or as a function shoots off toward positive or negative infinity near an asymptote. Every derivative in calculus is defined as a limit, every integral is a limit of sums, and every convergence test for series uses limits. Building strong intuition about limits now will make calculus feel natural rather than mysterious.
Define Terms
Visual Model
The full process at a glance. Click Start tour to walk through each step.
A limit describes what value a function approaches. Both sides must agree for the limit to exist.
Code Example
// Approximate a limit numerically
function approxLimit(f, target, steps) {
const results = [];
for (let i = 1; i <= steps; i++) {
const h = Math.pow(10, -i);
const fromLeft = f(target - h);
const fromRight = f(target + h);
results.push({
h: h,
fromLeft: fromLeft.toFixed(8),
fromRight: fromRight.toFixed(8)
});
}
return results;
}
// Limit of sin(x)/x as x -> 0
function sinOverX(x) { return Math.sin(x) / x; }
console.log("sin(x)/x as x -> 0:");
approxLimit(sinOverX, 0, 8).forEach(r =>
console.log(`h=${r.h}: left=${r.fromLeft}, right=${r.fromRight}`));
// Approaches 1 from both sides
// Limit of (x^2 - 4)/(x - 2) as x -> 2
function rationalEx(x) { return (x*x - 4) / (x - 2); }
console.log("\n(x^2-4)/(x-2) as x -> 2:");
approxLimit(rationalEx, 2, 6).forEach(r =>
console.log(`h=${r.h}: left=${r.fromLeft}, right=${r.fromRight}`));
// Approaches 4 (since (x^2-4)/(x-2) = x+2 for x != 2)
// Limit at infinity: 1/x as x -> infinity
console.log("\n1/x as x -> infinity:");
for (let x = 10; x <= 1000000; x *= 10) {
console.log(`f(${x}) = ${(1/x).toFixed(8)}`);
}
// Approaches 0
// One-sided limits: 1/x as x -> 0
console.log("\n1/x near 0:");
console.log("from right: f(0.001) =", (1/0.001));
console.log("from left: f(-0.001) =", (1/-0.001));
// Different signs: limit DNEInteractive Experiment
Try these exercises:
- Approximate the limit of (x^2 - 9)/(x - 3) as x approaches 3 by evaluating at x = 2.9, 2.99, 2.999, 3.001, 3.01, 3.1. What value does it approach?
- Evaluate (1 + 1/n)^n for n = 10, 100, 1000, 10000, 100000. What famous constant does this approach?
- Investigate the limit of |x|/x as x approaches 0. What happens from the left? From the right? Does the limit exist?
- Compute (sqrt(x+1) - 1)/x for x = 0.1, 0.01, 0.001, 0.0001. What limit does this approach?
- Evaluate x * sin(1/x) for x = 1, 0.1, 0.01, 0.001. What does this approach as x goes to 0?
Quick Quiz
Coding Challenge
Write a function called `approxLimit` that takes a function f, a target x-value, and returns the approximate limit. Evaluate f at points approaching the target from both sides using offsets h = 0.1, 0.01, 0.001, 0.0001. Return the average of f(target - 0.0001) and f(target + 0.0001) rounded to 4 decimal places. If the function throws an error or returns NaN/Infinity at any test point, return null.
Real-World Usage
Limits are the conceptual foundation for many technical applications:
- Calculus foundations: Derivatives are limits of difference quotients: f'(x) = lim [f(x+h) - f(x)] / h as h approaches 0. Integrals are limits of Riemann sums.
- Numerical methods: Iterative algorithms (Newton's method, gradient descent) generate sequences that converge to solutions. The limit of the sequence is the answer.
- Computer graphics: Level of detail (LOD) systems use limits conceptually: as the camera moves closer, detail approaches the full model.
- Networking: Queuing theory uses limits to analyze system behavior as load approaches capacity, predicting when response times become unbounded.
- Machine learning: Training loss converging to a minimum is a practical example of a sequence approaching a limit. Learning rate schedules ensure convergence.