Working 2nd method for differentiation