Let the total work be 1
A&B together can finish a work in 8 days
In 1 day they can do 1/8 part of the work
In 6 days they can do 6/8 = 3/4 part of the work
therefore, remaining work = 1 - 3/4 = 1/4 part
Let B alone can do the work in x days
In 1 day B can do 1/x part of the work.
Now, B can finish the remaining work in 6 days working alone.
therefore, 1/4 / 1/x = 6 => x/4 = 6 => x = 24 days
So, B alone can finish the work in 24 days
Now, in 1 day A can finish 1/8 - 1/24 part of the work
= 2/24 part of the work
= 1/12 part of the work
Therefore, A alone can finish the whole work in 1 / 1/12 = 12 days.