Calculus for Computer Science
Bachelor in Computer Science & Artificial Intelligence (BCSAI) · IE University · a 30-session, syllabus-driven map of the course — every module and every session, with the interactive calc-lab demos cross-linked where they bring a concept to life.
The connection between mathematics and computer science is remarkable — early computer science was shaped by mathematicians like Gödel, Turing, von Neumann, Péter and Church. Among all the branches of mathematics, this course focuses on calculus as a stepping stone toward mathematical, formal and abstract reasoning.
Students learn the key techniques and applications of limits, derivatives and integrals, and uncover their applications to computer science — algorithm complexity (Big-O / little-o), numerical methods, and the calculus that powers machine learning: the gradient descent and backpropagation project is the concrete pay-off. Pure mathematical thinking is combined throughout with solving problems using computers (Python, Wolfram Alpha).
Formally, the spine of the course is one limit — the derivative $f'(x) = \lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$ — and its inverse, the integral $\int_a^b f(x)\,dx = \lim_{n\to\infty}\sum_{i=1}^{n} f(x_i^*)\,\Delta x$, joined by the Fundamental Theorem of Calculus. Almost every session below is a variation on these two ideas.
Learning objectives
The main objective is to set the foundations of mathematical and analytical thinking, and to develop the abstract reasoning and computational tools used through the rest of the degree. By the end of the course, students should be able to:
- Use abstract reasoning. Move fluently between intuition, formal definition and computation.
- Mathematise real problems. Re-formulate real-world problems in mathematical language.
- Master the core objects of analysis. Limit, derivative and integral — in one and several variables.
- Compute confidently. Carry out complex computations involving derivatives and integrals.
- Optimise. Solve basic problems in optimization, constrained and unconstrained.
Methodology & assessment
IE's method is collaborative, active and applied: students build knowledge through lectures, in-class discussions, exercises and group work, combining pure mathematical thinking with computer-aided problem solving (Python, Wolfram Alpha). GenAI tools may be used to build an informed, critical perspective — with acknowledgement, and never taken at face value.
Learning-activity weighting
Grade breakdown
Assessment components in detail
Deliverable: a comprehensive written exam covering the whole course. Evaluation: worth 30% of the grade, but it acts as a gate — you must score at least 3.5/10 on it to pass the course even if every other component is passed.
Deliverable: the mid-term exam (Session 16) plus the in-class quizzes (Sessions 8, 22, 27). Evaluation: together worth 30%, spread across the term to keep pace honest.
Deliverable: each module has its own problem set; selected exercises, announced through the course, are turned in. Evaluation: rewards consistent independent practice — the bulk of the 150-hour workload.
Deliverable: active, prepared engagement during lectures — questions and remarks. Evaluation: based on participation and class conduct; disruption or excessive talking can incur a penalty.
Program — 30 sessions
The schedule mirrors the syllabus exactly. Filled timeline dots mark review/quiz/exam checkpoints. Where a concept maps to a live demo, a demo ↗ tag links straight to it; the machine-learning pay-off sessions link to the project. Each session carries the core formula it rests on plus a short key idea. (The schedule is tentative; pace adapts to the group.)
The foundations: what it means for a function to approach a value, how to compute limits including indeterminate forms, and how limits define continuity. This is where informal intuition is replaced by the formal $\varepsilon$–$\delta$ machinery the rest of the course rests on.
- State and apply the formal definition of a limit, and decide when a limit fails to exist.
- Resolve indeterminate forms with algebra, the Squeeze Theorem and L'Hôpital's rule.
- Find horizontal and vertical asymptotes from limits.
- Classify discontinuities and apply Bolzano's theorem to locate roots.
Overview of contents, materials, methodology and grading; preliminary concepts.
- Why calculus for CS: from algorithm complexity to machine learning.
- Preliminary concepts: functions, notation, and the applications to come.
Key idea: calculus is the mathematics of change and accumulation — the two engines behind most CS algorithms.
Concept, idea and formal definition; first limit computations.
- Intuitive limit: the value $f(x)$ approaches as $x \to a$.
- Formal $\varepsilon$–$\delta$ definition: making "arbitrarily close" precise.
Key idea: the limit is a promise about closeness, quantified by $\varepsilon$ and $\delta$.
Computing limits through indeterminate forms; the Squeeze Theorem.
- Indeterminate forms: $\tfrac{0}{0}$, $\tfrac{\infty}{\infty}$, $\infty-\infty$ and friends.
- Squeeze Theorem: trapping a function between two that share a limit.
Key idea: an indeterminate form is an invitation to rewrite, not a final answer.
Asymptotes; L'Hôpital's rule; examples with Wolfram Alpha.
- Asymptotes: horizontal and vertical, read off limits at infinity and at poles.
- L'Hôpital's rule: resolving $\tfrac00$ and $\tfrac\infty\infty$ via derivatives.
Key idea: derivatives can rescue limits that algebra alone cannot.
Definition; discontinuity types; Bolzano's theorem; Wolfram examples.
- Continuity: $\lim_{x\to a} f(x) = f(a)$ — no jumps, holes or blow-ups.
- Bolzano: a sign change on a continuous function forces a root.
Key idea: continuity is what lets numerical algorithms trust intermediate values.
The derivative as the limit of secant slopes, the computation rules, and the higher-order story: Taylor series and the Big-O / little-o notation that connects calculus directly to algorithm analysis. This module is the mathematical heart of the gradient-descent project.
- Define the derivative as a limit and compute it from first principles.
- Apply the product, quotient, chain, implicit and logarithmic rules fluently.
- Build Taylor approximations and bound their residual.
- Use Big-O / little-o notation to describe local and asymptotic behaviour.
Concept and formal definition as a limit; computation rules; implicit and logarithmic differentiation.
- Definition: the derivative is the limit of difference quotients.
- Rules: product, quotient, chain; implicit and logarithmic differentiation.
Key idea: differentiation turns the geometry of tangents into an algebra of rules.
Applications; Taylor series and residual; Big-O and little-o notation.
- Taylor series: approximating a function by polynomials at a point.
- Big-O / little-o: the language of approximation error and algorithm complexity.
Key idea: Taylor + Big-O is the same notation you will use to analyse algorithms — calculus and complexity meet here.
Consolidation of limits, continuity and derivatives; first graded quiz.
- Checkpoint: the single-variable differential toolkit before integration begins.
Key idea: spaced retrieval beats cramming — the quiz is a diagnostic, not a verdict.
Discrete limits: how infinite lists of numbers converge, and what it means to sum infinitely many terms. Power series tie this module back to Taylor and forward to numerical methods.
- Define and compute the limit of a sequence.
- Decide whether a series converges or diverges.
- Manipulate power series and identify their interval of convergence.
Concept of sequence; definition of the limit of a sequence; computation techniques.
- Convergence: $a_n \to L$ as $n\to\infty$.
- Techniques: monotone-bounded, ratio, dominant-term reasoning.
Key idea: a convergent sequence is exactly what "an iterative algorithm settles down" means.
Further techniques for computing limits of sequences; examples and applications.
- Recursive sequences: fixed points and convergence of iterations.
- Applications: convergence rates, a preview of Newton's method.
Key idea: fixed-point iteration is the abstract skeleton of gradient descent and Newton's method.
Concept of series; limits of series and power series; divergent series.
- Series: the limit of partial sums $\sum a_n$.
- Power series: $\sum c_n (x-a)^n$ and convergence radius.
Key idea: power series are infinite-degree Taylor polynomials — the bridge between Modules II and IV.
The inverse of differentiation: antiderivatives, the definite integral as a limit of Riemann sums, the Fundamental Theorem that unites the two, and improper integrals. Python makes an appearance for definite-integral computation.
- Compute indefinite integrals with substitution and integration by parts.
- Interpret the definite integral as area and as a limit of Riemann sums.
- Apply the Fundamental Theorem of Calculus in both directions.
- Test improper integrals for convergence.
Antiderivatives and indefinite integrals; advanced methods of integration.
- Indefinite integral: the family of antiderivatives.
- Methods: substitution, integration by parts, partial fractions.
Key idea: integration is a craft of recognising which rule un-does which derivative.
Definite integral and area; Riemann sums as limits; the Fundamental Theorem; Python examples.
- Riemann sum: area approximated by rectangles, exact in the limit.
- FTC: differentiation and integration are inverse operations.
Key idea: a Riemann sum is "accumulate many small pieces" — the same logic as summing a loss over training steps.
P-integrals; convergence and the comparison test.
- Improper integral: infinite limits or unbounded integrands, defined via a limit.
- Comparison test: bound a hard integrand by an easy one.
Key idea: convergence of an improper integral mirrors convergence of a series — the same threshold $p>1$.
Consolidation of limits through integration ahead of the midterm.
- Synthesis: the entire single-variable course so far, in one sitting.
Key idea: revisit the formula boxes above — each is a likely exam prompt.
In-class midterm examination.
- Coverage: Modules I–IV (single-variable calculus).
Key idea: the midterm is half-time, not full-time — multivariable calculus is still ahead.
The CS core of the course: numerical methods (Simpson, Newton), functions of several variables, the gradient, the chain rule and backpropagation, and optimization by gradient descent and Lagrange multipliers. This module is the neural-network project.
- Approximate integrals and roots numerically (Simpson, trapezoid, Newton) in Python.
- Compute partial derivatives, gradients and directional derivatives.
- Apply the multivariable chain rule — and recognise it as backpropagation.
- Solve unconstrained problems with gradient descent and constrained ones with Lagrange multipliers.
Numerical approximation of definite integrals (Simpson's, trapezoidal); Newton's method; Python implementation.
- Quadrature: trapezoidal and Simpson's rules for $\int f$.
- Newton's method: quadratically convergent root-finding.
Key idea: when formulas run out, numerical methods take over — and they are pure calculus in code.
Visualising functions; level sets and curves; partial derivatives; gradient; directional derivatives.
- Partial derivatives: slope along one axis at a time.
- Gradient: the vector of partials — points uphill, perpendicular to level sets.
Key idea: the gradient is the multivariable derivative — and the object every training step follows downhill.
Definition; particular cases; applications and the backpropagation algorithm.
- Multivariable chain rule: differentiating compositions of vector functions.
- Backpropagation: the chain rule applied layer-by-layer through a network.
Key idea: backpropagation is nothing but the chain rule, organised to reuse computation.
High-order derivatives for several variables; unconstrained optimization; the gradient descent algorithm and its implementation.
- Critical points: where $\nabla f = \mathbf{0}$; the Hessian classifies them.
- Gradient descent: step against the gradient to minimise.
Key idea: unconstrained optimization is the search for $\nabla f = 0$; gradient descent walks there one step at a time.
Lagrange multipliers; graphical interpretation; examples and Python implementation.
- Lagrange multipliers: optimise subject to a constraint $g(\mathbf x)=c$.
- Geometry: the objective contour is tangent to the constraint set.
Key idea: constraints turn into an extra gradient condition — and recover L2 regularisation in ML.
Consolidation of numerical and multivariable methods; graded quiz.
- Checkpoint: gradients, chain rule and optimization before multiple integrals.
Key idea: if you can explain the project, you can pass this quiz.
Integration in higher dimensions — double and triple integrals, changes of variables — and the vector calculus of parametrised curves and fields, finishing with curl, divergence and conservative fields. The course closes with review, a quiz and the final exam.
- Evaluate double and triple integrals with Fubini's theorem.
- Change variables to polar, cylindrical and spherical coordinates.
- Work with parametrised curves, arc length and line integrals.
- Identify conservative fields via curl and recover potential functions.
Rectangular regions; Cavalieri's principle; Fubini's theorem.
- Double integral: volume under a surface over a 2-D region.
- Fubini: evaluate as an iterated single integral.
Key idea: higher-dimensional integration reduces to nested single integrals.
Fubini's theorem for triple integrals; volume as a triple integral.
- Triple integral: integrate a density over a 3-D solid.
- Volume: $\iiint_V 1\,dV$.
Key idea: the integral generalises "sum over a region" to any number of dimensions.
Change of variables in multiple integrals: polar coordinates.
- Polar coordinates: $(r,\theta)$ for circular symmetry.
- Jacobian: the area-scaling factor of the transform.
Key idea: the right coordinates turn a hard integral into an easy one — at the cost of a Jacobian.
Change of variables: cylindrical and spherical coordinates.
- Cylindrical / spherical: coordinates matched to 3-D symmetry.
- Jacobians: $r$ and $\rho^2\sin\phi$ respectively.
Key idea: symmetry should dictate the coordinate system, not the other way around.
Consolidation of multiple integration; graded quiz.
- Checkpoint: double/triple integrals and changes of variables.
Key idea: practice setting up the limits of integration — that is where most marks are won or lost.
Parametrised curves; vector fields; integrals over curves; arc length.
- Parametrised curve: $\mathbf r(t)$ tracing a path.
- Line integral & arc length: integrating along a curve.
Key idea: vector fields and line integrals are the calculus of flows — fluid, force, probability.
Curl and divergence; conservative fields; the Fundamental Theorem for line integrals; potential functions.
- Curl / divergence: local rotation and local expansion of a field.
- Conservative field: a field that is the gradient of a potential.
Key idea: conservative = gradient of something — the same $\nabla\varphi$ that drives gradient descent, now read backwards.
Comprehensive final examination.
- Coverage: the whole course, single- and multi-variable.
Key idea: the final is comprehensive — the formula boxes on this page are your revision index.
Key concepts at a glance
The recurring objects of the course, each linked to where you can see it move.
- Limit lim
- The value a function approaches; the foundation of both the derivative and the integral. demo
- Derivative f′
- Instantaneous rate of change — the limiting slope of secant lines. demo
- Critical point f′=0
- Where the slope vanishes; classified as min/max/saddle by the second derivative. demo
- Riemann sum Σ f Δx
- Area approximated by rectangles, exact in the limit — the definite integral. demo
- Taylor series Σ fⁿ/n!
- Local polynomial approximation; its residual is little-o. demo
- Partial derivative ∂f/∂x
- Rate of change along one axis of a multivariable function. demo
- Gradient ∇f
- Vector of partials; points in the steepest-ascent direction. demo
- Vector field F(x,y)
- A vector at every point; curl and divergence describe its local behaviour. demo
- Gradient descent θ−η∇L
- Iterative minimisation by stepping against the gradient. project
- Backpropagation chain rule
- The multivariable chain rule applied through a network. project
Bibliography
Recommended texts from the syllabus.
Stewart, J. (2016). Calculus (8th ed.). Cengage Learning. ISBN 978-1285740621.
The main single- and multi-variable reference — limits, derivatives, Taylor series, integrals, multiple integrals.
Marsden, J. E. & Tromba, A. J. Vector Calculus (6th ed.). W. H. Freeman. ISBN 978-1429215084.
The vector-calculus half — gradient, chain rule, multiple integrals, curl/divergence and conservative fields.
Adams, R. A. & Essex, C. (2018). Calculus: A Complete Course (9th ed.). Pearson. ISBN 978-0134154367.
A complete alternative treatment, strong on numerical methods (Newton, Simpson) and worked examples.
calc-lab — interactive demos (index.html) and the worked project (project.html).
This site: 10 live calculus demos plus a from-scratch neural-network project applying Modules II & V end-to-end.