The area under the force-displacement graph gives the work done.
Let the area of the trapezium is A1 and the area of the triangle from 35m to 40m is A2.
The area from 0m to 35m is given as,
A=A1−A2
=12×10×(20+40)−12×5×5
=287.5
Thus, the work done by the force is 287.5J.