Python Same Method Differentiation Rules Calculus