# Work done by machine and its mechanical advantage

I'm going to start off with a question I was trying to solve from my book.
I'm not asking for help regarding a specific problem, but trying to solve this problem showed me that I'm lacking some fundamental understanding about the concept of (probably?) mechanical advantage and I would like an explanation of what am I missing from my understanding as to how this relates to solving this kind of problem.

We're presented with the following machine:

Some parameters we're told:
distance of the lever from the gear axis is $$\ell = 0.6m$$
radius of small gear is $$r_1 = 0.15m$$
radius of large gear is $$r_2 = 0.3m$$
radius of cylinder (attached to the rope) is $$r_3 = 0.1m$$
mass of the bucket is $$m = 20kg$$

Lastly it is given that one rotation of the lever makes the small gear rotate exactly once.
This gives us the understanding that one rotation of the lever is going to rotate the bigger gear halfway and by that also rotate the cylinder halfway as-well.

We're first told to find the ideal mechanical advantage which after calculating is: $$R_i = \frac{2\pi \ell}{2 \pi r_3 \frac{1}{2}} = 12$$
We're then told to find the force needed to lift the bucket assuming no friction which is $$F_1 = \frac{F_2}{R_i} = \frac{mg}{12} = 16\frac{1}{3}N$$
Next we're told how much force is needed to the lift the bucket given friction which is $$F_1 = 19.6N$$ and we're told to find the real mechanical advantage which is easy enough by $$R_r = \frac{mg}{F_1} = 10$$

Now we got to the point that got me confused and to my understanding about mechanical advantage as a concept.
We're asked to find the work needed to be done to lift the bucket $$20m$$.
Now as my understanding of work $$W = F \cdot s$$ then if $$F_1 = 19.6N$$ and $$s = 20m$$ and in this situation what I did is $$W = 19.6 \cdot 20 = 392J$$, but the book answers it the following way $$W = 19.6 \cdot 20 \cdot 12$$.
Now it got me thinking and see they're multiplying it by the mechanical advantage to get the output force of the machine and then multiplying it by the distance which actually makes sense since the output force of the machine is what "doing work" for $$20m$$ over the bucket and not the input force of the user rotating the lever.

$$\frac{F_2}{F_1} = R_r\\[4pt]F_2 = R_r \cdot F_1 = 10 \cdot 19.6 = 196N$$

But what still confuses me is, if we're told that the force needed to lift the bucket to calculate the real mechanical advantage is $$19.6N$$, then why does the book answer multiply this force by the ideal mechanical advantage to get the output force?

On the one hand the ideal mechanical adventage tells you that in ideal case, you need only that fraction of the original force to lift something. On the other hand it tells you that you have to apply that lower force on a that much longer path. E.g. you have to do the same work on the bucket with and without the machine. ($$mgh=F_1 s$$ where $$s$$ is the total lenght of the lever's path to lift the bucket. $$s=12h$$)
(In comparsion with the ideal) the real mechanical adventage tells you that due to friction in the machine, you have to apply somewhat larger force. (E.g. $$mg/10$$ instead of $$mg/12$$.) But you still have to make the same path (which lenght is $$s$$) to lift the bucket as in the ideal case. (You have to do more work because of the friction in the machine.)
When applying physical laws, it is important to note when they are applicable. In this case, $$W = F\cdot s$$ is only true if the force $$F$$ is applied over some distance $$s$$. The thing you are applying the force $$F$$ to is the lever, so to get the total work, you need to multiply that force by the distance the lever traveled, not the distance of the bucket.
If you go ahead and try to calculate this distance, you will notice that the ideal mechanical advantage of 12 appears again. That is, to lift the bucket 1m, the lever needs to travel 12m. This is no coincidence, since in the frictionless case the work done on the lever and the work done on the bucket is necessarily equal, so $$W_\text{bucket} = W_\text{lever} \\ F_\text{bucket} s_\text{bucket} = F_\text{lever} s_\text{lever}\\ F_\text{bucket} = \underbrace{\frac{s_\text{lever}}{s_\text{bucket}}}_{R_i}F_\text{lever}$$
But with friction $$F_\text{lever} > R_i F_\text{bucket}$$, so this relation no longer holds. But, we can still use $$R_i$$ to simplify the expression $$W = F_\text{lever} s_\text{lever} = F_\text{lever} R_i s_\text{bucket}$$