A takes 10 days to complete the work, so A's work rate is \( \frac{1}{10} \) of the work per day.
B takes 15 days to complete the work, so B's work rate is \( \frac{1}{15} \) of the work per day.
When A and B work together, their combined work rate is:
This means A and B together can complete \(\frac{1}{6}\) of the work per day.
They work together for 5 days, so the fraction of work completed by them in 5 days is:
Thus, \(\frac{5}{6}\) of the work is completed. The remaining work is:
A now finishes the remaining \(\frac{1}{6}\) of the work alone. Since A's work rate is \(\frac{1}{10}\) of the work per day, the time A takes to complete the remaining work is:
Thus, the total time to complete the entire work is:
The whole work is completed in \(7\frac{1}{3}\) days.