Sack on a carpet — dragged onto a rougher floor

only the centre of mass matters  ·  W = Mg(μ1s2 + μ2s1)  ·  change the sand distribution and watch F(X) change but the area stay put

W = 64.0 J area under F(X) = formula

Side view

drag the CM marker to move s1/s2, drag the sack to scrub  ·  the sack's height shows ρ(ξ), the weight per unit length

Pull force F vs crossing distance X

shaded area = work done so far  ·  run-in / run-out is not part of the answer