Application: work done by a variable force - compressing a spring - B