# What are the composite functions `(f * g)(x)` and `(g * f)(x)` if `f(x) = 3-x` and `g(x) = x^2` ?

*print*Print*list*Cite

### 3 Answers

Swapping the order of the functions `f` and `g` clearly results in a different answer.

`(f * g)(x) = f(x^2) = 3 - x^2` whereas

`(g * f)(x) = g(3-x) = (3-x)^2`

Why? Because `g` is a non-linear function and `f` is a linear function - they do not *commute *with each other. If `g` were also linear, or if `f` were of the form `f(x) = x^a` then they would be *commutative.*

We have functions `f` and `g` where

`f(x) = 3-x` , `g(x) = x^2`

` `The '*composite function'* or '*product of functions'* `(f *g)(x)` means that we apply function `g` first followed by `f` and vice versa for `(g * f)(x)`.

Therefore

`(f * g)(x) = f(g(x)) = f(x^2 ) = 3 - x^2` and

`(g * f)(x) = g(f(x)) = g(3-x) = (3-x)^2`

**Answer `(f * g)(x) = 3-x^2` and `(g * f)(x) = (3-x)^2` **

You need to use the property of composition of two functions to evaluate the new function `(fog)(x)` , such that:

`(fog)(x) = f(g(x))`

You need to replace `g(x)` for x in equation of `f(x)` , such that:

`f(g(x)) = 3 - g(x)`

Replacing `x^2 ` for `g(x)` yields:

`f(g(x)) = 3 - x^2`

You need to evaluate the function `(gof)(x)` , such that:

`(gof)(x) = g(f(x))`

Replacing `f(x)` in equation of `g(x)` yields:

`g(f(x)) = (f(x))^2 => g(f(x)) = (3 - x)^2`

Expanding the binomial yields:

`g(f(x)) = 9 - 6x + x^2`

**Hence, evaluating the functions `(fog)(x)` and `(gof)(x)` , using the property of composition of two functions, yields `f(g(x)) = 3 - x^2 ` and **`g(f(x)) = 9 - 6x + x^2.`