In work-rate problems, a certain person can complete a fraction of the job for a specific timeframe. As stated in the problem, A and B can finish the job by working together for 8 days. It must be noted that the fraction of the job they can finish individually per day is additive.
A can complete the work in 12 days and finish 1/12 fraction of a job per day. This can be substituted directly to the equation to solve for the time B needed to finish the work.
This means that B can do 1/24 fraction of the job per day and can completely finish the job in 24 days.