**Example 1:**

Find (f o g)(-2) given

f(x) = -3x + 2 , g(x) = |x - 4|
**Solution to example 1**

note that

(f o g)(-2) = f( g(-2) )

evaluate g(-2).

g(-2) = |-2 - 4| = 6

evaluate f( g(-2) ).

f( g(-2) ) = f(6) = -3*6 + 2 = -16

conclusion:

(f o g)(-2) = -16

**Example 2:**

Find (f o g)(x) and the domain of f o g

f(x) = (x - 1) / (x + 2) , g(x) = (x + 1) / (x - 2)
**Solution to example 2**

First find (fog)(x)

(f o g)(x) = f( g(x) ) = (g(x) - 1)/(g(x) + 2)

=[ (x + 1)/(x - 2) - 1 ] / [ (x + 1)/(x - 2) + 2 ]

= 3 / (3x - 3)

First find domain of f and g

domain of f : x not equal to -2

domain of g : x not equal to 2

g(x) has to be in the domain of f.

g(x) not equal to -2

solve for x the equation g(x) = -2

(x + 1)/(x - 2) = -2

x + 1 = -2x + 4

3x = 3

x = 1

for g(x) to be different from -2, x has to be different from 1.

conclusion:
The domain of f o g is: (-inf , 1) U (1 , 2) U (2 , +inf)

**Example 3:**

Find the composition (f o g)(x) and the domain of f o g

f(x) = x^{ 2} + 2 , g(x) = sqrt(x - 2)
**Solution to example 3**

First find (f o g)(x)

(f o g)(x) = f( g(x) ) = g(x)^{ 2} + 2

= ( sqrt(x - 2) )^{ 2} - 2

= x

First find domain of f and g

domain of f : all real numbers

domain of g : x - 2 > = 0 ; x > = 2

Since the domain of f is all real numbers, we have to make sure that x is in the domain of g so that g has a real value.

conclusion:
The domain of f o g is: [2 , +inf)

__Exercises on Composition of Functions.__

Find the composition (f o g)(x) and its domain given f and g below:

a) f(x) = 2x^{ 3} + x - 1 , g(x) = x^{ 2}

b) f(x) = | x^{ 2} - 4 | , g(x) = x - 1

c) f(x) = x^{ 2} - 5 , g(x) = sqrt(x + 5)

d) f(x) = ln x , g(x) = sqrt(x + 5)

e) f(x) = sin x , g(x) = x - 2

__Solutions to Above Exercises.__

Find the composition (f o g)(x) and its domain given f and g below:

a) (f o g)(x) = 2 x ^{ 6} + x^{ 2} -1 , domain: (-inf , + inf)

b) (f o g)(x) = | x^{ 2} - 2x - 3 | , domain: (-inf , + inf)

c) (f o g)(x) = x , domain: [ -5 , +inf)

d) (f o g)(x) = (1 / 2) ln (x + 5) , domain: [ -5 , +inf)

e) (f o g)(x) = sin (x - 2) , domain: (-inf , + inf)

References and links related to composition of functions.

Composition of Functions Questions and more Questions on Composite Functions with Solutions.