first principle differentiation