Sorry to revisit an old post but this was a toughy! Its not a necessary condition that d be an integer.
So working together they can do the job is d days.
Let \(r_1\) be the rate of A
Let \(r_2\) be the rate of B
Working together their rates to do the job is
Equation1:
\((r_1+r_2)d=1 (job)\)
A working alone can do the job by
Equation2:
\((r_1)(d+5)=1 (job)\)
B working alone can do the job by
Equation3:
\((r_2)(d+45)=1 (job)\)
Now set the first equation to the second equation
\((r_1+r_2)d=1 = (r_1)(d+5)\) solve for d to get \(d=5(r_1/r_2)\)
Now set equation1 to equation2
\((r_1)(d+5)=1 =(r_2)(d+45)\) solve to get \(r_1/r_2=(d+45)/(d+5)\)
Now substitute \(d=5(r_1/r_2)=5((d+45)/(d+5))\)
to get \(d(d+5)=5(d+45)\)
which leads you to \(d^2=5*45\). Which is equal to \(d=15\) when you square root both sides (of couse d must be positive, were talking about days here!).
Again, tough problem. If anyone has an easier method let us know.