differentiate with respect to X