Work done by a variable force:- Let us considered a force which acts always in One Direction but whose magnitude may keep on varying. We can choose the direction of the force as the x-axis. Further, let us assume that the magnitude of the force is also a function of x is known to us. Now, we are interested in finding the work done by this force in moving a body from \(X_{i} to X_{f}\).
Work done for small displacement \( d{x}\) is
\( dW=F\cdot dx\)
Now total work done can be obtained by integration of the above formula from the lower limit to an upper limit.