calc-lab course outline · Calculus for Computer Science

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.

Program
BCSAI — Computer Science & AI
Course code
CACC-CSAI.2.M.A
Area
Mathematics
Sessions
30
Credits
6.0 ECTS
Academic year
2025–26
Degree course
Second
Semester
Category
Basic
Language
English
Workload
150 h
Professor
Carlos Gordon

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:

Generic skills reinforced alongside: summarising and presenting information accurately, isolating the core question from the superfluous, and quickly identifying the right tool for a given problem.

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

Individual studying 26.7%
Lectures 20.0%
Exercises · async · field work 20.0%
Group work 20.0%
Discussions 13.3%

Total dedication ≈ 150 hours (40 h individual study · 30 h lectures · 30 h exercises/async/field · 30 h group work · 20 h discussions).

Grade breakdown

Final exam 30%
Intermediate tests (midterm + quizzes) 30%
Individual work (problem sets) 30%
Class participation 10%

A minimum of 3.5 / 10 on the final exam is required to pass overall, even if other components are passed.

Assessment components in detail

Final exam30%

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.

Intermediate tests30%

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.

Individual work30%

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.

Class participation10%

Deliverable: active, prepared engagement during lectures — questions and remarks. Evaluation: based on participation and class conduct; disruption or excessive talking can incur a penalty.

Pass & attendance rules: 80% attendance is required — students below it fail both the ordinary and the extraordinary (June/July) calls and must re-enrol. The re-sit is a single comprehensive exam (continuous evaluation ignored), passing grade 5 with a maximum of 8.0. Four calls are allowed across two academic years.

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.)

I Limits & continuity sessions 1–5

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.

By the end of Module I you should be able to
  • 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.
SESSION 1
Introduction to the course

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.
Setting · a function $f : \mathbb{R} \to \mathbb{R}$ Everything in the course studies how a function behaves: near a point (limits), instantaneously (derivatives), and in aggregate (integrals).

Key idea: calculus is the mathematics of change and accumulation — the two engines behind most CS algorithms.

Stewart · Ch.1 Functions
SESSION 2
Limits

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.
Definition · limit $\lim_{x\to a} f(x) = L \iff \forall\varepsilon>0\ \exists\delta>0:\ 0<|x-a|<\delta \Rightarrow |f(x)-L|<\varepsilon$ Pick a tolerance $\varepsilon$; a $\delta$ must exist that keeps $f(x)$ within it.

Key idea: the limit is a promise about closeness, quantified by $\varepsilon$ and $\delta$.

SESSION 3
Indeterminate forms

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.
Theorem · squeeze $g(x)\le f(x)\le h(x),\ \lim g = \lim h = L \Rightarrow \lim f = L$ The engine behind $\lim_{x\to0} x\sin(1/x)=0$.

Key idea: an indeterminate form is an invitation to rewrite, not a final answer.

SESSION 4
Limits: further applications

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.
Rule · L'Hôpital $\lim_{x\to a}\frac{f(x)}{g(x)} = \lim_{x\to a}\frac{f'(x)}{g'(x)}$ Valid for $\tfrac00$ / $\tfrac\infty\infty$ when the right-hand limit exists.

Key idea: derivatives can rescue limits that algebra alone cannot.

Wolfram AlphaStewart · Ch.4
SESSION 5
Continuity

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.
Theorem · Bolzano $f$ continuous on $[a,b],\ f(a)f(b)<0 \Rightarrow \exists c\in(a,b):\ f(c)=0$ The basis of the bisection root-finding algorithm.

Key idea: continuity is what lets numerical algorithms trust intermediate values.

II Derivatives sessions 6–8

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.

By the end of Module II you should be able to
  • 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.
SESSION 6
Derivatives

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.
Definition · derivative $f'(x) = \lim_{h\to 0}\dfrac{f(x+h)-f(x)}{h}$ The instantaneous rate of change — the slope of the tangent line.

Key idea: differentiation turns the geometry of tangents into an algebra of rules.

demo ↗ tangent lineStewart · Ch.3
SESSION 7
High-order derivatives

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.
Series · Taylor $f(x) = \sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k + R_n(x),\quad R_n = o\big((x-a)^n\big)$ The residual $R_n$ is little-o — it vanishes faster than the last kept term.

Key idea: Taylor + Big-O is the same notation you will use to analyse algorithms — calculus and complexity meet here.

SESSION 8
Review & quiz

Consolidation of limits, continuity and derivatives; first graded quiz.

  • Checkpoint: the single-variable differential toolkit before integration begins.
Checkpoint limits · continuity · derivatives Quiz worth part of the 30% intermediate-tests component.

Key idea: spaced retrieval beats cramming — the quiz is a diagnostic, not a verdict.

Quiz · 30% track
III Sequences & series sessions 9–11

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.

By the end of Module III you should be able to
  • Define and compute the limit of a sequence.
  • Decide whether a series converges or diverges.
  • Manipulate power series and identify their interval of convergence.
SESSION 9
Sequences

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.
Definition · sequence limit $\lim_{n\to\infty} a_n = L \iff \forall\varepsilon>0\ \exists N:\ n>N \Rightarrow |a_n-L|<\varepsilon$ The same ε–δ idea, now over the integers — the model for iterative-algorithm convergence.

Key idea: a convergent sequence is exactly what "an iterative algorithm settles down" means.

Stewart · Ch.11
SESSION 10
Sequences (cont.)

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.
Idea · fixed point $a_{n+1}=g(a_n)\to L \Rightarrow L=g(L)$ Iterations converge to a fixed point of $g$ when $g$ is a contraction.

Key idea: fixed-point iteration is the abstract skeleton of gradient descent and Newton's method.

Stewart · Ch.11
SESSION 11
Series

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.
Definition · series $\sum_{n=1}^{\infty} a_n = \lim_{N\to\infty}\sum_{n=1}^{N} a_n$ A series converges iff its sequence of partial sums converges.

Key idea: power series are infinite-degree Taylor polynomials — the bridge between Modules II and IV.

IV Integration sessions 12–16

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.

By the end of Module IV you should be able to
  • 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.
SESSION 12
Integrals — antiderivatives

Antiderivatives and indefinite integrals; advanced methods of integration.

  • Indefinite integral: the family of antiderivatives.
  • Methods: substitution, integration by parts, partial fractions.
Method · by parts $\int u\,dv = uv - \int v\,du$ The product rule, run backwards.

Key idea: integration is a craft of recognising which rule un-does which derivative.

Stewart · Ch.5–7
SESSION 13
Integrals — the definite integral

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.
Theorem · FTC $\int_a^b f(x)\,dx = F(b)-F(a),\quad F' = f$ The definite integral is the net change of any antiderivative.

Key idea: a Riemann sum is "accumulate many small pieces" — the same logic as summing a loss over training steps.

SESSION 14
Improper integrals

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.
Result · p-integral $\int_1^{\infty}\frac{dx}{x^p}$ converges $\iff p>1$ The continuous mirror of the p-series convergence test.

Key idea: convergence of an improper integral mirrors convergence of a series — the same threshold $p>1$.

Stewart · Ch.7
SESSION 15
Review for the midterm

Consolidation of limits through integration ahead of the midterm.

  • Synthesis: the entire single-variable course so far, in one sitting.
Checkpoint limits · derivatives · series · integrals Everything that the midterm will test.

Key idea: revisit the formula boxes above — each is a likely exam prompt.

Review
SESSION 16
Midterm

In-class midterm examination.

  • Coverage: Modules I–IV (single-variable calculus).
Assessment · 30% track Midterm exam Part of the 30% intermediate-tests component.

Key idea: the midterm is half-time, not full-time — multivariable calculus is still ahead.

Exam · 30% track
V Numerical & multivariable calculus sessions 17–22

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.

By the end of Module V you should be able to
  • 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.
SESSION 17
Numerical methods

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.
Method · Newton $x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}$ Linearise, solve, repeat — the second-order optimiser of the project.

Key idea: when formulas run out, numerical methods take over — and they are pure calculus in code.

SESSION 18
Functions of several variables

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.
Definition · gradient $\nabla f = \left(\frac{\partial f}{\partial x_1},\dots,\frac{\partial f}{\partial x_n}\right)$ Direction of steepest ascent; its negative is the descent direction.

Key idea: the gradient is the multivariable derivative — and the object every training step follows downhill.

SESSION 19
Chain rule for several variables

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.
Rule · chain $\frac{dL}{dx} = \sum_i \frac{\partial L}{\partial u_i}\frac{\partial u_i}{\partial x}$ Sum the contributions along every path — exactly what backprop accumulates.

Key idea: backpropagation is nothing but the chain rule, organised to reuse computation.

SESSION 20
Optimization

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.
Algorithm · gradient descent $\theta \leftarrow \theta - \eta\,\nabla_\theta L$ The single line that trains the network in the project.

Key idea: unconstrained optimization is the search for $\nabla f = 0$; gradient descent walks there one step at a time.

SESSION 21
Constrained optimization

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.
Condition · Lagrange $\nabla f = \lambda\,\nabla g$ At the optimum, the gradients are parallel — weight decay is this with $g=\lVert\theta\rVert^2$.

Key idea: constraints turn into an extra gradient condition — and recover L2 regularisation in ML.

SESSION 22
Review & quiz

Consolidation of numerical and multivariable methods; graded quiz.

  • Checkpoint: gradients, chain rule and optimization before multiple integrals.
Checkpoint gradient · chain rule · optimization Quiz worth part of the 30% intermediate-tests component.

Key idea: if you can explain the project, you can pass this quiz.

Quiz · 30% track
VI Multiple integrals & vector calculus sessions 23–30

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.

By the end of Module VI you should be able to
  • 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.
SESSION 23
Double integrals

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.
Theorem · Fubini $\iint_R f\,dA = \int_a^b\!\!\int_c^d f(x,y)\,dy\,dx$ A 2-D integral is two 1-D integrals, done one at a time.

Key idea: higher-dimensional integration reduces to nested single integrals.

demo ↗ 3D surfaceMarsden & Tromba
SESSION 24
Triple 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$.
Application · volume $\text{Vol}(V) = \iiint_V dV$ Mass, charge or probability follow by inserting a density.

Key idea: the integral generalises "sum over a region" to any number of dimensions.

Marsden & Tromba
SESSION 25
Change of variables — polar

Change of variables in multiple integrals: polar coordinates.

  • Polar coordinates: $(r,\theta)$ for circular symmetry.
  • Jacobian: the area-scaling factor of the transform.
Transform · polar $dA = r\,dr\,d\theta$ The Jacobian $r$ accounts for how area stretches in polar coordinates.

Key idea: the right coordinates turn a hard integral into an easy one — at the cost of a Jacobian.

demo ↗ vector fieldStewart · Ch.15
SESSION 26
Change of variables — cylindrical & spherical

Change of variables: cylindrical and spherical coordinates.

  • Cylindrical / spherical: coordinates matched to 3-D symmetry.
  • Jacobians: $r$ and $\rho^2\sin\phi$ respectively.
Transform · spherical $dV = \rho^2\sin\phi\,d\rho\,d\phi\,d\theta$ The spherical Jacobian — essential for radially symmetric problems.

Key idea: symmetry should dictate the coordinate system, not the other way around.

Marsden & Tromba
SESSION 27
Review & quiz

Consolidation of multiple integration; graded quiz.

  • Checkpoint: double/triple integrals and changes of variables.
Checkpoint multiple integrals · coordinate changes Quiz worth part of the 30% intermediate-tests component.

Key idea: practice setting up the limits of integration — that is where most marks are won or lost.

Quiz · 30% track
SESSION 28
Vector-valued functions

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.
Definition · arc length $L = \int_a^b \lVert \mathbf r'(t)\rVert\,dt$ Sum infinitesimal segment lengths along the curve.

Key idea: vector fields and line integrals are the calculus of flows — fluid, force, probability.

demo ↗ vector fieldMarsden & Tromba
SESSION 29
Conservative fields

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.
Criterion · conservative $\mathbf F = \nabla \varphi \iff \nabla\times\mathbf F = \mathbf 0$ (on a simply connected domain) A curl-free field has a potential; line integrals become path-independent.

Key idea: conservative = gradient of something — the same $\nabla\varphi$ that drives gradient descent, now read backwards.

SESSION 30
Final exam

Comprehensive final examination.

  • Coverage: the whole course, single- and multi-variable.
Assessment · 30% + gate Final exam — minimum 3.5/10 to pass Worth 30%, but a hard gate: below 3.5 fails the course regardless of other marks.

Key idea: the final is comprehensive — the formula boxes on this page are your revision index.

Exam · 30% + gate

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.

recommended

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.

recommended

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.

recommended

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.

companion

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.