Byron is 3 years older than Doug. The product of their ages is 40. How old is Doug

D (D+3) = 40

D^2 + 3 D - 40 = 0
(D-5) (D+8) = 0
D = 5
B = 8