We are given that f(x) is degree 2, g(x) is degree 1, f(g(x))=8x2−2x, and g(f(x))=4x2+6x+1. Let f(x)=ax2+bx+c and g(x)=px+q.
Substituting into f(g(x)) gives
f(g(x))=a(px+q)2+b(px+q)+c=ap2x2+(2apq+bp)x+(aq2+bq+c),
and comparing this with 8x2−2x+0 yields the equations
ap2=8(1),2apq+bp=−2(2),aq2+bq+c=0(3).
Similarly, substituting into g(f(x)) gives
g(f(x))=p(ax2+bx+c)+q=pax2+pbx+(pc+q),
and comparing with 4x2+6x+1 yields
pa=4(4),pb=6(5),pc+q=1(6).
From (1) and (4) it follows that p=2 and a=2. Then (5) implies b=3, substituting into (2) gives q=−1, and using (6) yields c=1. One checks that (3) is satisfied since aq2+bq+c=2(1)+3(−1)+1=0. Hence f(x)=2x2+3x+1 and g(x)=2x−1.
Finally, evaluating at x=2 gives f(2)=2(4)+3(2)+1=15 and g(2)=2(2)−1=3, so f(2)+g(2)=18, and the answer is 18.