Let the time needed for the first one to do the job alone be x and for the second be y.
This would mean that their rates would be 1/x and 1/y.
1 / (1/x+1/y) = 6
1 / (x+y/xy) = 6
xy/(x+y) = 6
xy = 6x + 6y
3 ((x+y)/xy) + 4 (1/y) = 1
(3x + 3y + 4x)/xy = 1
7x + 3y = xy
6x + 6y = 7x + 3y
3y = x
xy = 6x + 6y
xy = 6(x+y)
xy = 6(3y+y)
xy = 24y
x = 24
y = 8
Therefore it would take 24 hours for the first person to work alone and 8 hours for the second.