First, we can determine the rate at which Bill prepares dough by using the information given:
Bill prepared 10 kilograms of dough in 2 hours. To find the rate in kilograms per hour, we can calculate:
\[ \text{Rate} = \frac{10 \text{ kg}}{2 \text{ hours}} = 5 \text{ kg/hour} \]
Next, we want to find out how many hours Bill worked to prepare 40 kilograms of dough. We can use the unit rate we just calculated:
\[ \text{Time} = \frac{\text{Amount of dough}}{\text{Rate}} = \frac{40 \text{ kg}}{5 \text{ kg/hour}} \]
Calculating that gives:
\[ \text{Time} = 8 \text{ hours} \]
Thus, Bill worked 8 hours to prepare 40 kilograms of dough.