Let the times to complete the job alone be A and B days. Let's say that B is longer than A by 8 days, so B=A+8.
If it takes A days to complete a job alone then in one day 1/A of the job will be done. If it takes A+8 days, then in one day 1/(A+8) of the job will be done. If the two workers are working together they finish the job in 7 1/2 days or 15/2 days. So in 1 day they complete 2/15 job. Applying the rates at which they work alone (the rate is the amount of the job they complete in a day), we have 1/A+1/(A+8)=2/15. We multiply through by the LCM=15A(A+8):
A^2-7A-60=0=(A-12)(A+5), so A=12 and B=A+8=20
1/12+1/20=2/15; in one day worker A completes 1/12 of the job while B completes 1/20. By the end of the day 2/15 of the job is completed, so it will take 15/2 days to complete the whole job (7 1/2 days).
To make it clearer, imagine the job was to lay 300 bricks. Consider how many bricks can be laid in one day. It takes 7 1/2 days to lay 300 bricks, so in one day 40 bricks are laid, 25 by worker A and 15 by worker B. It will take worker A 12 days (12*25=300 bricks) to do the job alone; while worker B would need 20 days (20*15=300 bricks).