Calculus lessons
What is calculus?
Illustration of a car on a curved road: tangent for differentiation, shaded area for integration.
Calculus is the mathematics of change. It gives us tools to measure how things move, grow, and accumulate over time.
It has two main branches. Differentiation finds rates of change (how fast something is changing at a given moment). Integration finds totals from rates (how much has accumulated).
These two ideas are connected. One is the reverse of the other, which is the key insight that makes calculus so powerful.
Limits and approaching a value
A limit describes what value a function approaches as the input gets closer and closer to some target. You never need to actually reach the target.
For example, as x approaches 2, the function x^2 approaches 4. We write this as:
Limit notation: \lim_{x \to 2} x^2 = 4
Limits matter because rates of change involve dividing by gaps that shrink to zero. Without limits, we cannot make that precise.
Watching a limit in action
Limits are easier to understand when you can see a value being approached from both sides.
Interactive limit explorer for (x^2-4)/(x-2) approaching x = 2.
Practice: Find the limit
Factor a removable discontinuity and type the limit value.
The gradient of a curve
A straight line has a constant gradient. A curve does not. Its steepness changes from point to point.
To measure the gradient at a single point, we draw a secant line through two nearby points on the curve. Then we bring the two points closer together until the secant becomes a tangent.
Shrink the secant on y = x^2 until it becomes the tangent.
Differentiation from first principles
The formal definition of the derivative uses a limit. We start with the gradient of a secant and let the gap h shrink to zero.
First principles: f'(x) = \lim_{h \to 0} \frac{f(x + h) - f(x)}{h}
Let us apply this to f(x) = x^2:
\frac{(x+h)^2 - x^2}{h}(substitute into the formula)\frac{x^2 + 2xh + h^2 - x^2}{h}(expand the bracket)\frac{\textcolor{#f871b9}{2xh} + \textcolor{#8b5cf6}{h^2}}{h}(cancel the x^2 terms)2x + h(divide each term by h)2x(let h approach 0)
So the derivative of x^2 is 2x. At x = 3, the gradient is 6.
Practice: Differentiate from first principles
Fill in each first-principles step to differentiate a simple function.
The power rule
First principles works but is slow. The power rule gives us a shortcut for any term of the form x^n:
Power rule: \frac{d}{dx}(x^n) = nx^{n-1}
Multiply by the power, then reduce the power by one. This works for any constant n, including fractions and negatives.
\frac{d}{dx}(x^3) = 3x^2(bring down 3, reduce power)\frac{d}{dx}(5x^4) = 20x^3(constant multiplier stays)\frac{d}{dx}(7) = 0(constants vanish)
Applying the power rule
When a function has several terms, differentiate each one separately and add the results.
Power-rule machine: animate each term of a polynomial through differentiation.
Practice: Find the derivative
Differentiate a random polynomial and type the derivative.
Chain rule, product rule, quotient rule
Three rules handle combinations of functions. The chain rule deals with nested functions (a function inside another function).
Chain rule: \frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)
The product rule differentiates two functions multiplied together. The quotient rule handles one function divided by another.
\frac{d}{dx}[u \cdot v] = u'v + uv'(product rule)\frac{d}{dx}\left[\frac{u}{v}\right] = \frac{u'v - uv'}{v^2}(quotient rule)
Using the chain rule
Think of the chain rule as peeling layers. Differentiate the outer function first, then multiply by the derivative of the inner function.
y = (3x + 1)^4(outer: u^4, inner: u = 3x + 1)\frac{dy}{dx} = \textcolor{#f871b9}{4(3x+1)^3} \cdot \textcolor{#8b5cf6}{3}(differentiate outer, then inner)\frac{dy}{dx} = 12(3x+1)^3(simplified)
Nested-box chain-rule demo: differentiate outer and inner layers, then multiply.
Practice: Apply differentiation rules
Differentiate using the chain, product, or quotient rule.
Stationary points and curve sketching
A stationary point is where the gradient equals zero. The curve is momentarily flat. These can be maxima, minima, or points of inflection.
To classify them, use the second derivative. If f''(x) > 0 at the point, it is a minimum. If f''(x) < 0, it is a maximum.
f(x) = x^3 - 3x + 2f'(x) = 3x^2 - 3 = 0(set derivative to zero)x^2 = 1,\ \ x = \pm 1(solve for x)f''(x) = 6x(second derivative)f''(-1) = -6 < 0(maximum at x = -1)f''(1) = 6 > 0(minimum at x = 1)
Finding turning points visually
The derivative graph crosses the x-axis exactly where the original function has a stationary point. This connection is powerful for sketching curves.
Split view of a cubic and its derivative, with live increasing/decreasing shading.
Practice: Classify the stationary points
Find f'(x), the stationary points, and classify each as a max or min.
What is integration?
Integration finds the total amount accumulated from a rate of change. If differentiation asks "how fast?", integration asks "how much in total?"
Graphically, the definite integral gives the area between the curve and the x-axis over an interval.
Definite integral: \int_a^b f(x)\ dx
Approximating area with rectangles
Before learning the exact method, consider filling the area under a curve with thin rectangles. The more rectangles you use, the closer the approximation.
Riemann-sum explorer: rectangles under y = x^2 converging to the integral.
Basic integration rules
Integration reverses differentiation. The power rule in reverse: increase the power by one, then divide by the new power.
Power rule for integration: \int x^n\ dx = \frac{x^{n+1}}{n+1} + C
The C is the constant of integration. Since the derivative of any constant is zero, we cannot know its value without extra information.
\int x^3\ dx = \frac{x^4}{4} + C(raise power, divide)\int 5x^2\ dx = \frac{5x^3}{3} + C(constant multiplier stays)\int 4\ dx = 4x + C(constant integrates to linear)
Practice: Integrate the function
Integrate a random polynomial, remembering the constant of integration.
Definite integrals
A definite integral has upper and lower limits. It gives an exact numerical answer, not a function. The constant C cancels out.
\int_1^3 2x\ dx(integrate 2x from 1 to 3)\left[x^2\right]_1^3(antiderivative is x^2)\textcolor{#f871b9}{3^2} - \textcolor{#8b5cf6}{1^2} = 9 - 1 = 8(substitute upper minus lower)
This result equals the exact area under y = 2x between x = 1 and x = 3.
The fundamental theorem of calculus
This theorem connects differentiation and integration. It says that integration (finding area) and differentiation (finding gradient) are inverse operations.
Fundamental theorem: \int_a^b f'(x)\ dx = f(b) - f(a)
If you differentiate a function and then integrate the result over an interval, you get back the net change in the original function. This is why finding antiderivatives lets us compute exact areas.
Evaluating definite integrals
The process is always the same: find the antiderivative, substitute the upper limit, substitute the lower limit, then subtract.
Step-by-step definite-integral evaluation with the shaded area shown alongside.
Practice: Evaluate the definite integral
Evaluate a definite integral, giving a numeric or fraction answer.
Velocity, acceleration and displacement
Calculus connects position, velocity, and acceleration. Velocity is the derivative of position. Acceleration is the derivative of velocity.
Going the other way, integrating acceleration gives velocity, and integrating velocity gives displacement.
s(t) \xrightarrow{\frac{d}{dt}} v(t) \xrightarrow{\frac{d}{dt}} a(t)(differentiate to go right)a(t) \xrightarrow{\int} v(t) \xrightarrow{\int} s(t)(integrate to go left)
Motion in action
A ball is thrown upward with position s(t) = 20t - 5t^2. Let us find its velocity and when it reaches maximum height.
v(t) = \frac{ds}{dt} = 20 - 10t(differentiate position)20 - 10t = 0(velocity = 0 at max height)t = 2(max height at t = 2 seconds)s(2) = 20(2) - 5(4) = 20(max height = 20 metres)
Projectile-motion explorer with synced position, velocity and acceleration graphs.
Area between two curves
To find the area between two curves, subtract the lower function from the upper function and integrate over the interval where they overlap.
Area between curves: A = \int_a^b [f(x) - g(x)]\ dx
First find where the curves intersect by solving f(x) = g(x). Those intersection points become your limits of integration.
Visualising area between curves
The shaded region between two curves shows exactly what the integral computes.
Area-between-curves explorer: shade the region and sweep the integration limits.
Practice: Find the area
Find intersections, set up the integral, and compute the area between two curves.