differentiation calculator first principles