I have been asked this question and I substituted the value of x in f with g(x), and rearranged the equality but is incorrect.

Answer:
if fg(x)=6x+q
then f(gx) =6x+q
3(px+4)+p =6x+q
3px+12+p = 6x+q
3px+p = 6x+q-12
make p the subject
p( 3x+1) = 6x+q-12
p= (6x + q -12 )/ 3x +1
Answer:
p = 2 and q = 14
Step-by-step explanation:
f(g(x)) = 3(px + 4) + p
f(g(x)) = 3px + 12 + p
6x + q = 3px + 12 + p
The trick here is to equate the coefficients.
6 = 3p and q = 12 + p
p = 2 and q = 14