Math & ModelingAdvancedGraph simulation~25 min

Calculus Explorer: Limits, Derivatives and Integrals

Calculus is the mathematics of change. It answers two questions: how fast is something changing right now (the derivative), and how much has built up over time (the integral). Both rest on the idea of a limit. Approach a point from both sides, turn a secant into a tangent, pack thinner and thinner rectangles under a curve, and watch the two big ideas of calculus turn out to be opposite sides of one coin.

Explore

FTC: the fundamental theorem of calculus, which links derivatives and integrals.

Use x, a, b, pi, e, + − * / ^, brackets and sin cos tan exp ln log sqrt abs. Write 2x for 2·x.

3
1.5
1

Q is at x + h. Make h small to see the secant turn into the tangent; Start shrinks it for you.

Drag the coloured points and markers. Drag the background to pan (two fingers on a touch screen); pinch or Ctrl + scroll to zoom. Tap the graph to read coordinates.

Challenge

—
—
—
—
—
—
—
—
—
—
—
—

How to use this simulator

  1. Choose a function, or type your own (for example x^3 - 2x or sin(2x)/x) and press Plot. Sliders a and b appear when the function uses them.
  2. In Limits, drag the target marker on the x-axis, then drag the purple (left) and orange (right) points towards it, or press Start. Compare the table of values and read the verdict.
  3. In Derivative, drag P along the curve and Q towards P. Turn on the graph of f′ and the increasing/decreasing bands to see where f rises, falls and turns.
  4. In Integral, drag the bounds a and b, change the number of rectangles and the rule, and press Start to watch the sum converge.
  5. In FTC, drag x and watch the accumulated area A(x) in the lower graph. Its slope always matches the height of f.
  6. Drag the background to pan, pinch or Ctrl + scroll to zoom, and tap the graph to read coordinates. Try the challenges under the controls.

Learning objectives

  • Estimate one-sided and two-sided limits, and explain why a limit can differ from a function’s value.
  • Recognise continuous functions and removable, jump and infinite discontinuities.
  • Interpret the derivative as the limit of secant slopes and the slope of the tangent line.
  • Use the sign of f′ to find where f increases or decreases, and classify stationary points correctly.
  • Approximate definite integrals with left, right and midpoint Riemann sums, and distinguish signed area from geometric area.
  • Explain the fundamental theorem of calculus.

Limits

The limit of f(x) as x approaches a describes the values f(x) gets close to when x is close to a, but not equal to it. We write limx→a f(x) = L. The value f(a) itself does not matter: f might not even be defined at a.

A left-hand limit (x → a⁻) uses only x < a; a right-hand limit (x → a⁺) uses only x > a. The two-sided limit exists only when both one-sided limits exist and are equal. If f grows without bound, we write lim = ∞ to describe the behaviour, but the limit does not exist as a number.

Continuity and discontinuities

f is continuous at a when three things hold: f(a) is defined, the limit exists, and the limit equals f(a).

TypeWhat happensExample in the lab
Removable (a hole)The limit exists but f(a) is undefined or different(x² − 1)/(x − 1) at x = 1
JumpLeft and right limits exist but are differentx² (x < 1), x + 2 (x ≥ 1)
Infinitef grows without bound: a vertical asymptote1/(x − 2)² at 2, 1/x at 0
Oscillatingf keeps swinging and never settlessin(1/x) at 0

Derivatives

The slope of a secant line through (x, f(x)) and (x + h, f(x + h)) is the average rate of change [f(x + h) − f(x)]/h. Letting h shrink to zero gives the derivative, theinstantaneous rate of change:

f′(x) = limh→0 [f(x + h) − f(x)] / h

Geometrically, f′(x) is the slope of the tangent line, the line that just touches the curve there. A function is differentiable at x when this limit exists. Corners (|x| at 0), cusps (x2/3 at 0), jumps and vertical tangents have no derivative. A differentiable function is always continuous, but a continuous function need not be differentiable.

What f′ tells you about f

  • Where f′(x) > 0, f is increasing; where f′(x) < 0, f is decreasing.
  • Where f′(x) = 0, the tangent is horizontal: a stationary point.
  • A stationary point is a local maximum if f′ changes from + to −, a local minimum if it changes from − to +, and neither if f′ keeps its sign (x³ at 0).
  • Maxima and minima can also occur where f′ does not exist, such as the corner of |x|.

Integrals and Riemann sums

To find the area under a curve between x = a and x = b, split [a, b] into n strips of width Δx = (b − a)/n, and add up rectangles of height f(xᵢ*), where xᵢ* is the left end, right end or midpoint of each strip. This is aRiemann sum, Σ f(xᵢ*)·Δx. As n → ∞ the sums approach the definite integral∫ab f(x) dx.

An indefinite integral ∫ f(x) dx = F(x) + C is the family of all antiderivatives(functions whose derivative is f). A definite integral is a number; an indefinite integral is a family of functions. When F is known, ∫ab f(x) dx = F(b) − F(a).

For an increasing function, left sums underestimate and right sums overestimate; midpoint sums are usually much more accurate. The error of left and right sums shrinks roughly in proportion to 1/n, and of midpoint sums to 1/n².

Signed area versus geometric area

The definite integral measures signed accumulation: area above the x-axis counts positive and area below counts negative. So ∫02π sin x dx = 0, even though the curve encloses a totalgeometric area of ∫02π |sin x| dx = 4. If f is unbounded on [a, b] (for example 1/x across 0), the ordinary integral does not exist; such “improper” integrals need separate treatment.

The fundamental theorem of calculus

Define the accumulation function A(x) = ∫ax f(t) dt: the signed area from a up to a moving edge x. If f is continuous on an interval containing a and x, then

d/dx [ ∫ax f(t) dt ] = f(x)

In words: the area grows at a rate equal to the height of the curve at the moving edge. When f is positive A increases, when f is negative A decreases, and where f crosses zero A has a peak or a valley. The second part of the theorem gives ∫ab f(x) dx = F(b) − F(a) for any antiderivative F, which is how exact integrals are calculated.

Formula reference

FormulaMeaning
limx→a f(x) = Lf(x) gets arbitrarily close to L as x gets close to a (x ≠ a)
[f(x + h) − f(x)] / hSecant slope: average rate of change over a step h
f′(x) = limh→0 [f(x + h) − f(x)] / hDerivative: instantaneous rate of change
y = f(a) + f′(a)(x − a)Tangent line at x = a
Δx = (b − a)/n; Σ f(xᵢ*) ΔxRiemann sum with n strips
∫ab f(x) dx = F(b) − F(a)Definite integral from an antiderivative F (f continuous on [a, b])
d/dx ∫ax f(t) dt = f(x)Fundamental theorem of calculus (f continuous)
(xⁿ)′ = n·xⁿ⁻¹; (eᵏˣ)′ = k·eᵏˣ; (sin x)′ = cos xSome derivatives used by the presets

How the lab computes

A computer cannot take a true limit, so the lab estimates. Limits are estimated from f(a ± 10⁻ᵏ) for k up to 7 and labelled “numerical”. Derivatives of the preset functions use their exact formulas; for your own functions the lab uses the central difference [f(x + h) − f(x − h)]/(2h) with a small h, which is accurate to about eight significant digits for smooth functions. Corners and cusps are detected by comparing the slopes from the left and the right. Exact integrals come from an antiderivative when one is known; otherwise the lab uses two-point Gauss–Legendre quadrature with 1,000 panels. The lab flags intervals where f is unbounded instead of printing a meaningless number. Expressions you type are read by a small parser that only understands maths, never by running code. Very rapidly oscillating or extremely steep functions can still fool any numerical method.

Real-world applications

  • Physics: velocity is the derivative of position, acceleration is the derivative of velocity, and distance travelled is the integral of speed.
  • Engineering: integrals give the work done by a force, the centre of mass of a beam and the charge stored in a capacitor.
  • Economics: marginal cost and marginal revenue are derivatives; total cost is the integral of marginal cost.
  • Medicine: the area under a drug-concentration curve measures total exposure to a medicine.
  • Computing: machine learning trains models by following derivatives (gradients) downhill.

Interesting facts

  • Isaac Newton and Gottfried Leibniz developed calculus independently in the 1660s–1680s; the notation dy/dx and ∫ is Leibniz’s.
  • Archimedes estimated the area of a parabolic segment more than 2,000 years ago by filling it with ever-smaller triangles, an early version of a limit.
  • The rigorous ε–δ definition of a limit was only completed in the 19th century, by Cauchy and Weierstrass.
  • Weierstrass found a function that is continuous everywhere but differentiable nowhere: a curve made entirely of “corners”.

Common misconceptions

  • “The limit is just f(a).” Only for continuous functions. A limit can exist where f(a) is undefined or different.
  • “f′(a) = 0 means a maximum or minimum.” Not always: x³ has f′(0) = 0 but no turning point.
  • “Continuous means differentiable.” |x| is continuous at 0 but has no derivative there.
  • “An integral is always the area.” It is signed area: parts below the axis subtract.
  • “The secant slope is the derivative.” The secant slope is an average rate of change; the derivative is its limit.

Important terms

Limit
The value f(x) approaches as x approaches a, from one side or both.
Continuity
f is continuous at a if f(a) exists and equals the limit there.
Derivative
The instantaneous rate of change; the slope of the tangent line.
Secant line
A line through two points of a curve; its slope is an average rate of change.
Tangent line
The line through a point of a curve with slope equal to the derivative there.
Differentiable
Having a derivative at a point (no corner, cusp, jump or vertical tangent).
Stationary point
A point where f′ = 0.
Riemann sum
A sum of rectangle areas that approximates an integral.
Definite integral
The limit of Riemann sums on [a, b]: a number giving signed accumulation.
Indefinite integral (antiderivative)
A family of functions F(x) + C whose derivative is f.

Key takeaways

  • A limit describes behaviour near a point, not the value at it.
  • The derivative is the limit of secant slopes: the slope of the tangent.
  • The sign of f′ shows where f rises and falls; turning points need f′ to change sign.
  • Integrals are limits of Riemann sums and measure signed area.
  • The fundamental theorem links the two ideas: accumulating f and then differentiating gives f back.

Knowledge check

Calculus Explorer: Limits, Derivatives and Integrals: test your understanding

Answer each question to get instant feedback and an explanation. Use the simulator to check your thinking.

10 questions5 intermediate3 basic2 advanced

0 of 10 answered

  1. Q1Intermediatef(x) = (x² − 4)/(x − 2) is undefined at x = 2. What is the limit of f(x) as x → 2?
    Show answer

    Answer: C. 4

    For x ≠ 2, f(x) = x + 2, so the values approach 4 from both sides. A limit depends on values near the point, not at it: this is a removable discontinuity.

  2. Q2BasicAs x → 0 from the left, g(x) → −1; as x → 0 from the right, g(x) → 1. What can you conclude?
    Show answer

    Answer: A. The two-sided limit does not exist, because the one-sided limits differ

    A two-sided limit exists only when the left-hand and right-hand limits are equal. Here g has a jump discontinuity at 0, whatever g(0) is.

  3. Q3BasicWhat does the derivative f′(a) measure?
    Show answer

    Answer: D. The instantaneous rate of change of f at a: the slope of the tangent line there

    f′(a) = lim h→0 [f(a + h) − f(a)]/h is the limit of secant slopes (average rates of change) as the interval shrinks to zero.

  4. Q4IntermediateFor f(x) = x², the secant slope from x = 3 to x = 3 + h is 6 + h. In the simulator, what do you predict as you drag Q towards P?
    Show answer

    Answer: B. The secant slope approaches 6, the tangent slope f′(3)

    As h → 0, 6 + h → 6. The derivative of x² is 2x, and 2 × 3 = 6.

  5. Q5Basicf′(x) > 0 for all x in an interval. What does this tell you about f on that interval?
    Show answer

    Answer: A. f is increasing

    A positive derivative means the tangent slopes upward everywhere in the interval, so f increases. It says nothing about whether f itself is positive.

  6. Q6IntermediateFor f(x) = x³, f′(0) = 0. Is x = 0 a local maximum or minimum?
    Show answer

    Answer: C. Neither: f′ is positive on both sides, so f keeps increasing through 0

    A stationary point (f′ = 0) is a maximum or minimum only if f′ changes sign there. For x³, f′(x) = 3x² ≥ 0 on both sides, so 0 is a stationary inflection point.

  7. Q7IntermediateWhy does f(x) = |x| have no derivative at x = 0?
    Show answer

    Answer: B. Because the slope from the left (−1) and from the right (+1) are different: there is a corner

    |x| is continuous at 0, but the one-sided difference quotients disagree, so no single tangent slope exists. Continuity does not guarantee differentiability.

  8. Q8AdvancedUsing 2 midpoint rectangles, estimate ∫ from 0 to 2 of x² dx.
    Show answer

    Answer: B. 2.5

    Δx = 1 and the midpoints are 0.5 and 1.5, so the sum is 1 × (0.25 + 2.25) = 2.5. The exact value is 8/3 ≈ 2.67.

  9. Q9Intermediate∫ from 0 to 2π of sin x dx = 0. Why is this not the same as the total area between the curve and the x-axis?
    Show answer

    Answer: D. Because the integral counts area below the axis as negative; the geometric area is 4

    The definite integral measures signed accumulation. The parts above and below the axis each have area 2 and cancel; the total geometric area ∫|sin x| dx is 4.

  10. Q10AdvancedA(x) = ∫ from 0 to x of f(t) dt, where f is continuous. According to the fundamental theorem of calculus, what is A′(x)?
    Show answer

    Answer: A. f(x)

    The rate at which accumulated area grows equals the height of the curve at the moving edge: d/dx ∫ₐˣ f(t) dt = f(x). This links integration and differentiation.

References and further reading

  1. Strang, G., & Herman, E. (2016). Calculus Volume 1, Chapter 2: Limits. OpenStax. openstax.org (opens in a new tab)
  2. Strang, G., & Herman, E. (2016). Calculus Volume 1, Chapter 3: Derivatives. OpenStax. openstax.org (opens in a new tab)
  3. Strang, G., & Herman, E. (2016). Calculus Volume 1, Sections 5.1–5.3: Approximating Areas, The Definite Integral, The Fundamental Theorem of Calculus. OpenStax. openstax.org (opens in a new tab)
  4. Burden, R. L., Faires, J. D., & Burden, A. M. (2016). Numerical Analysis (10th ed.), Chapter 4: Numerical Differentiation and Integration. Cengage.

This simulator is a simplified educational model. Found an error? Let us know. See our educational disclaimer.