Some questions regarding the teaching of the infinitesimal calculus in secondary school will be studied in depth. Particular emphasis will be placed on the use of the history of mathematics as a useful tool for identifying and deepening epistemological obstacles in dealing with basic issues of mathematical analysis. A large part of the course will be dedicated to the design and development of educational paths that also include the use of software. Among the topics covered: the concept of function in its various declinations, both didactic and historical; limits of sequences and functions, continuity and derivability. Various approaches to the calculation of areas and volume, the principle of exhaustion, the theory of indivisibles and the integrals of Cauchy and Riemann.