chain rule time and work