Suppose we have a block of mass $M$ and we are moving it up a curve, very slowly ($a=0$). The surface is not smooth, and coefficient of friction is $\mu=\mu_s=\mu_k$.
To move the block we apply a force $F$ to the block tangential to the surface(on which the block is, at that time). If we take the angle of slope to be $\theta$ (of the surface), then the forces acting are friction$f$, gravity/weight $Mg$ and external force $F$.
This is where the problem comes. If we want to find out the work done by friction, then $$W_{friction}=\int\vec{F_{friction}}.\vec{dr}=-\mu Mg\int dr cos\theta=-\mu Mg\int dx$$ But when I use the work-energy theorem, then $$W_{friction}+W_{gravity}+W_{ext}=0$$ $$W_{friction}=-W_{gravity}-W_{ext}$$ $$W_{friction}=Mgh-F\int dr$$ When I get the work done by friction using integration then it tells me it doesn't depend on the type of path and path length, but only horizontal $x$ covered. When I use the work-energy theorem, it tells me that it depends on height $h$ till which the block goes and path length $r$. What is going wrong? Could anyone hint me?
Thanks in advance.