We had a question which goes like this:
A particle is displaced from $(0,0)$ to $(1,1)$ along $\rm y=x$. The force $F$ on the particle is $\rm ( x^2 \hat j + y \hat i)$. Find Work done during displacement.
What I did:
$$\rm W = \int F\cdot dx$$
$$\rm = \int ( y \hat i + x^2 \hat j)\cdot( dx \hat i + dy \hat j)$$
$$\rm = \int (y \ dx + x^2 \ dy)$$
The problem is that we can't integrate with respect to one variable keeping other as constant because both variables change.
What to do in this case? Also can we put $y = x$ since it was moved along this path? Also if we were not given this condition, how we find the integral then?