# For the functions f(x) = x^2 and g(x) = (x-7), are f (g(x)) = g (f(x)). Also, what is g (f (2))?

*print*Print*list*Cite

f(x) = x^2

g(x) = (x-7),

We need to determine is f (g(x)) = g (f(x)).

First we will determine f(g(x))

fog (x) = f(g(x)

= f( x-7)

= (x-7)^2

= x^2 - 14x + 49

==>** f(g(x)) = x^2 - 14x + 49**

Now we will determine g(f(x):

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

= g(x^2 )

= x^2 - 7

**==> g(f(x)= x^2 - 7**

**Then we notice that f(g(x)) does not equal g(f(x))**

Now we will calculate g(f(2)):

g(f(x) = x^2 - 7

g(f(2)) = 2^2 - 7

= 4-7 = -3

**==> g(f(2)) = -3**

We are given that f(x) = x^2 and g(x) = (x-7).

Now, to determine g (f(x)), we find the value of f(x) and substitute it in g(x). f(x) = x^2. substituting this in g(x) we get g (f(x)) = x^2 -7.

To determine f (g(x)), we need to find g(x) and substitute the value in f(x). g(x) = (x-7), substituting this in f(x), we get g (f(x)) = (x-7) ^2 = x^2 - 14x + 49.

Therefore we see that g (f(x)) = x^2 -7 and f (g(x)) = x^2 - 14x + 49, which are not the same.

Also, g (f (2)) = 2^2 - 7 = 4 – 7 = -3.

f(x) = x^2 , g(x) = (x-7)

To verify if (f(g(x)) = g(f(x)) and to find g(f(2)).

f(x^2) = x^2.

f(g(x)) = {g(x)}^2.

f(g(x)) = (x-7)^2. = x^2-14x+49.

f(g(x)) = x^2-14x+49....(1).

g(f(x) = (f(x)-7)

g(f(x)) = x^2-7....(1).

From (1) and (2), we see that the right sides are different.

Therefore f(g(x)) is not equal to g(f(x).

g(f(x)) = x^2-7

To find g(f(2)) = 2^2-7 = 4-7 = -3.

Therefore g(f(2)) = -7.

First rule: the composition of 2 functions is not commutative!

(fog)(x) is different from (gof)(x)

Let's determine (fog)(x) for f(x) = x^2 and g(x) = (x-7).

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

We'll replace x by g(x) in the expression of f(x).

f(g(x)) = (g(x))^2

**f(g(x)) = (x-7)^2 (1)**

Let's determine (gof)(x) for f(x) = x^2 and g(x) = (x-7).

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

We'll replace x by f(x) in the expression of g(x).

g(f(x)) = (f(x)-7)

** g(f(x)) = x^2 - 7 (2)**

As we can see, (1) is different of (2).

To calculate g (f (2)), we'll compute first f(2):

f(2) = 2^2

f(2) = 4

g(f (2)) = g(4)

g(4) = (4-7)

g(4) = -3

**g(f (2)) = -3**