This two-volume textbook, of which this is the first volume, is a self-contained comprehensive presentation of mathematics for computer scientists. It includes coverage of sets, numbers, graphs, algebra, logic, grammars and machines. It also deals with linear geometry, calculus, ODEs, and special themes such as neural networks, Fourier theory, wavelets, numerical issues, statistics, categories, and manifolds. This text is complemented by an online university course which covers the same theoretical content in a totally different presentation. The student or working scientist who gets involved with this text may at any time consult the online interface which contains applets and other interactive tools. For the second edition the entire text has been carefully re-written, and many examples have been added, as well as illustrations and explications to statements and proofs which were exposed in a too short a style. This makes the book easier for both instructors and students.