Mathematics of Generative AI provides a unified and modern applied mathematics foundation for understanding today's most influential generative models of AI, including diffusion models, score-based methods, normalizing flows, variational autoencoders, transformers, and emerging agentic and decision-based frameworks. Aimed at advanced undergraduates, graduate students, and research-oriented practitioners, the book bridges classical applied mathematics and contemporary AI by presenting them as a single, coherent narrative.Rather than treating applied mathematics as a prerequisite detached from applications, the text introduces linear algebra, calculus, optimization, probability, information theory, and stochastic processes in direct alignment with their roles in generative modeling. Each mathematical concept is motivated by a concrete AI mechanism — denoising, sampling, attention, transport, or control — allowing readers to understand not only how modern models work, but why they take their characteristic forms.A distinguishing feature of the book is its synthesis chapter, which develops a unifying diffusion-based perspective on generative models. GANs, flows, VAEs, reinforcement learning, and path–integral formulations are shown to arise as special cases or limits of controlled stochastic dynamics, revealing deep connections between generative AI, optimal transport, statistical physics, and stochastic control.The book follows a learning-by-doing philosophy, integrating theory with carefully designed exercises and lightweight computational experiments. Accompanying Python/Jupyter notebooks allow readers to visualize dynamics, test ideas, and explore models interactively, making the text both rigorous and practical.