It is given that a force F=−xi^+yj^ acts on a particle. The particle is moved from point A(1,0) to B(0,1) along the line segment.
Work done by a variable force on the particle,
W=∫F⋅dr=∫F⋅(dxi^+dyj^)
(In two dimension, dr=dxi^+dyj^
and it is given F=−xi^+yj^)
W=∫(−xi^+yj^)⋅(dxi^+dyj^)
=∫−xdx+ydy=∫−xdx+∫ydy.
As the particle is displaced from A(1,0) to B(0,1), x varies from 1 to 0 and y varies from 0 to 1.
So, work will be,
W=−∫10xdx+∫01ydy=−[2x2]10+[2y2]01
=21(0+(1)2+(1)2−0)=1J.