Let the time required to complete the work by A and B together = n days
=> Time required by A alone = n + 18 days
=> Time required by B alone = n + 8 days
Therefore, n2 = 18 x 8 = 144
=> n = 12
Hence, A and B require 12 days to complete the work if they work together.