Differentiation from first principles