Let's say that
M = # hours it takes the Mason to build the wall.
A = # hours it takes the Apprentice to build the wall.
We know that M = A - 6
We also know that
1/M + 1/A = 1/4, where 4 = number of hours to build the wall when the mason and apprentice work together.
Substituting M = A-6 in the equation above, we have
1/(A-6) + 1/A = 1/4
Rearranging terms we have,
1 + (A-6)/A = (A-6)/4
A + (A-6) = A(A-6)/4
4A + 4(A-6) = A(A-6)
4A + 4A - 24 = A2 - 6A
8A - 24 = A2 - 6A
and
0 = A2 -14A + 24
We can factor and solve
0= (A-8) (A-6)
Setting each factor equal to 0 and solving
A= 8 or A = 6
We can discard the A=6 solution because if A=6, then M=0 and this is an illogical solution since the mason cannot build a wall in 0 hours.
But when A = 8, then M = 2.
So it would take the apprentice 8 hours working alone to build the wall.
Hope this helps.