Given,
f : R→ R, f(x) = x2 + 3x + 1
g : R → R, g(x) = 2x – 3
(i) (fog)(x) = f{g(x)}
= f{2x – 3}
= (2x – 3)2 + 3(2x – 3) + 1
= 4x2 – 12x + 9 + 6x – 9 + 1
= 4x2 – 6x + 1
(ii) (gof)(x) = g{f(x)}
= g(x2 + 3x + 1)
= 2(x2 + 3x + 1) – 3
= 2x2 + 6x + 2 – 3
= 2x2 + 6x – 1
(iii) (fof)(x) = f{f(x)}
= f(x2 + 3x + 1)
= (x2 + 3x + 1)2 + 3(x2 + 3x + 1)+1
= x4 + 9x2 + 1 + 6x3 + 6x + 2x2 + 3x2 + 9x + 3 + 1
= x4 +6x3 + 14x2 + 15x + 5
(iv) (gog)(x) = g{g(x)}
= g(2x – 3)
= 2(2x – 3) – 3
= 4x – 6 – 3
= 4x – 9