The father can complete 1 train set in x minute RF = 1/x
Either son can complete one rain set in x + 10 minutes RS = 1/(x+10)
Together they can complete one train set in 12 minutes RT = 1/12
1/x + 1/(x +10) + 1/(x+10) = 1/12
(3x + 10)/(x2 + 10x) = 1/12
36x + 120 = x2 + 10x
0 = x2 -26x -120
which can be factored
0 = (x - 30)(x + 4)
-4 minutes is not a possible solution, so the father, working alone, takes 30 minutes
Either son, working alone, take 30 +10 = 40 minutes
Working together, the boys have a rate of RB = RS+ RS = 1/40 + 1/40 = 1/20,
so, together, the boys accomplish the job in 20 minutes.