Preface: how to use this book

If linear algebra is the language of machine learning, calculus is its engine of change. Calculus is the mathematics of things that vary — how a quantity responds to a small nudge in another (the derivative), and how countless tiny pieces accumulate into a whole (the integral). Every time a model “learns,” it is computing derivatives and stepping downhill; every time it reasons about probability, it is computing integrals. This book builds that machinery from scratch and carries it all the way to the gradients behind modern AI.

Who this is for

This book starts from the very beginning — what a function is and what a limit means — and climbs to multivariable optimization, infinite series, and the matrix calculus of backpropagation. It is written for the self-learner who wants both computational fluency (“I can compute the derivative and the integral”) and conceptual understanding (“I know what they mean and why they matter”). Every important result is motivated with a picture, a worked example, and — wherever possible — a forward link to how it is used in machine learning.

The two big ideas

Almost all of calculus orbits two problems and the stunning theorem that links them:

  • The tangent problem (differential calculus): given a curve, find its instantaneous slope — the rate of change.

  • The area problem (integral calculus): given a curve, find the area beneath it — the total accumulation.

  • The Fundamental Theorem of Calculus: these two problems are inverses of each other. Differentiation and integration undo one another.

The structure

  • Part I — Foundations & Limits (beginner): functions and the idea of calculus; limits and continuity.

  • Part II — Differential Calculus (core): the derivative, the rules, and their applications.

  • Part III — Integral Calculus (core): the integral and the Fundamental Theorem, techniques, applications.

  • Part IV — Series & Multivariable (advanced): sequences and Taylor series; partial derivatives and the gradient; multiple integrals; optimization and differential equations.

  • Part V — Applications: a capstone chapter on how calculus powers machine learning, deep learning, and AI.

How to read it

Read with a pen. When you meet a Definition box, restate it in your own words; when you meet an Example, cover the solution and try it first; when you meet a Try it in code box, actually run it. The colored boxes recur throughout:

  • Key idea — the one sentence to remember.

  • Intuition — the geometric or physical picture.

  • Common pitfall — mistakes to avoid.

  • How this powers ML / AI — the forward link to applications.

  • Try it in code — a hands-on check in Python/NumPy.

Two mental images carry the whole subject. The derivative is the slope of the tangent line — the best local linear approximation to a function, the answer to “if I nudge the input, how fast does the output move?” The integral is the area under the curve — the limit of adding up many thin slices. Keep both pictures in view and calculus stops being a bag of rules and becomes a single, coherent idea.

Differential Calculus

Integral Calculus

Series and Multivariable Calculus

Applications