In case of a variable force, total work is calculated by summation of work done during very small displacements.
Same amount of force 10 N is acting on two bodies in two different ways. Case 1: Force is acting in the direction of displacement of the body. Case 2: Force is making an angle of 60° with the direction of displacement. If the displacement is 'd' meters in both the cases, then what is the relation between the work done in both the cases?