Free lesson · Differential calculus
Functions, limits and continuity
Open interactive lessonPractice calculationsExplore labs
Start with the idea
- A function turns an input into an output.
- A limit asks what the output approaches as the input gets near a point; the function does not have to be defined at that point.
- Continuity adds the requirement that the limiting value agrees with the actual value.
Symbols, units & horizon
- x: input value
- f(x): output at x
- lim: limiting value
- x→2: approach 2 without requiring x=2
- ≠: not equal
- g: new function agreeing with f away from 2, with g(2)=4 at the missing point
- Example x values are dimensionless
When and why to use this
Use limits to understand boundary behaviour and continuity to decide whether small input changes can produce abrupt output changes. These concepts are useful in physics, geometry, engineering and numerical model design.
- Start with a concrete mapping: a square of side x has area f(x)=x².
- Input units are length and output units are length squared.
- The domain specifies allowed inputs.
- A formula involving division excludes zero denominators; a real logarithm requires a positive argument.
- To investigate a limit, simplify first or approach from both sides.
- A table can suggest an answer, but a few sampled values do not prove a limit exists.
- A function with a jump has different one-sided limits; a removable hole can have the same limiting value on both sides.
Functions, limits and continuity
- Factor the numerator: x²−4=(x−2)(x+2). For x≠2, cancel the nonzero factor x−2.
- The remaining expression x+2 approaches 4 as x approaches 2 from either side. The original quotient is still undefined at x=2.
- Define a new function g with the same values away from 2 and g(2)=4. That extension is continuous at 2.
At x=1.9 the quotient is 3.9; at x=2.1 it is 4.1. The limit is 4, while substituting 2 into the unsimplified quotient gives the undefined expression 0/0.
An analogy to remember
A road can approach the same height from both directions even if one paving stone is missing. The limit describes the approach; continuity asks whether the stone is present at the matching height.
How this becomes a building block
Limits are the foundation of derivatives and definite integrals. In a trading system, checking a model’s domain can prevent invalid calculations at zero time, zero volatility or zero liquidity. A removable singularity may need a carefully derived limiting implementation rather than a divide-by-zero workaround.
Further reading: OpenStax Calculus, Volume 1 — definitions and standard theorems ↗
Python implementation
Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.
def quotient_with_hole(x):
if x == 2:
raise ValueError("Original function undefined at x=2")
return x + 2 # algebraically equivalent on the original domain
def continuous_extension(x):
return x + 2
print(quotient_with_hole(1.9), continuous_extension(2))Continue learning
Differential Calculus: Limits & Derivatives — all lessons- Start with a straight line: input, output and slope
- Functions, limits and continuity
- The derivative: from an average slope to an instantaneous rate
- Core derivative rules: constants, powers and sums
- Derivative rules: powers, products, quotients and compositions
- Second derivatives, Taylor expansions and numerical error
- Stationary points, optimisation and Newton’s method
Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations