First, let's calculate the horizontal component of the applied force:

Now, calculating the works, we have:
a.
To calculate this work, we use the horizontal component of the applied force:

b.
To calculate this work, we use the friction force only:

(We use a negative force because it is against the movement)
c.
The total work on the wagon is given by:
