Define work done by a varying force

It can be defined as the definite integral of the varying force over some displacement. It is given by the area under a F(x) - x graph, i.e., variable force and displacement graph.