Step 1 :First, find \( f(g(x)) \). Substituting \( g(x) \) into \( f(x) \), we get \( f(g(x)) = 3g(x) + 2 = 3(x^2 - 5) + 2 \). Simplify to get \( 3x^2 - 15 + 2 = 3x^2 - 13 \).
Step 2 :Next, find \( g(f(x)) \). Substituting \( f(x) \) into \( g(x) \), we get \( g(f(x)) = f(x)^2 - 5 = (3x + 2)^2 - 5 \). Expand and simplify to get \( 9x^2 + 12x + 4 - 5 = 9x^2 + 12x - 1 \).