So this is a functions question which is essentially asking you to combine the first two functions and then equate them with the last one.
fg(x) can be considered as replacing the x in f(x) with g(x):
fg(x) = f(g(x)) = 3(ax+6) + 2afg(x) = 3ax + 18 + 2a
This new combined fg(x) is the same as the last function given in the question so the two can be equated:
3ax + 18 + 2a = 12x + b
Both sides of the equation have an x term and a constant so the x term on the right side must be the same as that on the left so 3a = 12 therefore a = 4.
The constants on both sides must also be equal therefore 18 + 2a = b. We found the value of a as 4 therefore b = 18 + 8 = 26
The answer is b = 26