If....

f(x) = x + 2 and
g(x) = −x^2 + 2x − 3, determine

- ( f ∘ g)(−2)
- a formula for (g∘f)(x)

My answer for ( f ∘ g)(−2) = -9

But I don't know how to get the formula for (g∘f)(x).

Any help would be great.

(g∘f)(x)

= g(f(x) )
= g(x+2)
= -(x+2)^2 + 2(x+2) - 3
= -x^2 - 4x - 4 + 2x + 4 - 3
= -x^2 - 2x - 3

(g∘f)(-2) = -4 + 4 - 3 = -3

or

f(x) = x+2
f(-2) = -2+2 = 0
then
g(f(-2))
= g(0) = -0+0-3 = -3