Differential calculus in one variable: theory and applications for optimisation, approximations, and plotting functions