Let the number of days B alone takes to complete the work be x.
Since A takes 5 days less than B to finish the work, A takes x - 5 days to complete the work.
Now, the work done per day by A is the reciprocal of the number of days A takes to finish the work, i.e., 1 / (x - 5). Similarly, the work done per day by B is 1 / x.
When A and B work together, they can complete 1 unit of work in 6 days. Therefore, their combined rate of work per day is 1 / 6. So, the sum of the individual rates of A and B working together is:
(1 / (x - 5)) + (1 / x) = 1 / 6
To solve for x, find a common denominator on the left-hand side:
(1 / (x - 5)) + (1 / x) = (x + (x - 5)) / (x(x - 5)) = (2x - 5) / (x(x - 5))
Now, set this equal to 1/6:
(2x - 5) / (x(x - 5)) = 1 / 6
Cross-multiply:
6(2x - 5) = x(x - 5)
Simplify:
12x - 30 = x^2 - 5x
Move all terms to one side:
x^2 - 5x - 12x + 30 = 0
x^2 - 17x + 30 = 0
Now, solve the quadratic equation x^2 - 17x + 30 = 0 using the quadratic formula:
x = [-(-17) ± √((-17)^2 - 4(1)(30))] / 2(1)
x = [17 ± √(289 - 120)] / 2
x = [17 ± √169] / 2
x = [17 ± 13] / 2
So, we have two possible solutions for x:
x = (17 + 13) / 2 = 30 / 2 = 15 x = (17 - 13) / 2 = 4 / 2 = 2
Since x = 2 is not a feasible solution (B cannot finish the work in 2 days if A takes 5 days less), the only valid solution is x = 15.
Thus, B alone can complete the work in 15 days.