# Math Review: Composition of Functions

By now, you have probably dealt with a cornucopia of functions with two variables; most commonly* x* and *y*. To find points that exist within the function you would substitute values into one variable in order to find the other, for example subbing an *x* value into a linear equation to find it’s corresponding *y* component. Not only can you sub numeric values into equations, but entire equations as well. The composition of two functions, say* f* and *g*, creates a new functions. This function is solved by performing *f* and then performing* g*.

For example, consider two functions: *g(x) = x^3* and *f(x) = x – 4.* The composition of f with g is called *f○g* and is worked out as

*f○g = f(g(x))*

First we write down what *g(x)* is followed by applying* f(x)* to the whole of *g(x)*. In this case, applying *f(x)* means subtracting four.

*f(g(x)) = (x^3) – 4 = x^3 – 4*

Another example would be if we considered the composition of functions* h(x) = x^2 + x +2* with *j(x) = e^x*. Just as we did previously, we will write out* j* and then apply *h* to the whole of* j*.

*h○j = h(j(x)) = (e^x)^2 + e^x + 2 = e^2x + e^x + 2*

The order in which we compose functions makes a difference in what our composite function will be. Using *f(x)* and *g(x)* from the first example, we can see that if we reverse the order in which we compose them we get drastically different functions.

*g○f = g(f(x)) = (x-4)^3 = x^3 – 12x^2 + 48x -64*

As you can see, this function is very different from* f(g(x))*. In general, *f(g(x))* is not equal to *g(f(x))*.

Occasionally, you may be presented with a function that is already a composition of two functions and asked to find these two functions. This process is known as decomposition. Let’s look at the following function and consider it: *h(x) = sin(4x)*. Based on our knowledge of composite functions, we can see that *h(x)* can be written as *f(g(x))*. We know we start by writing what *g(x)* is first, followed by applying *f* to the whole of *g(x)*.

*h(x) = sin(4x) = f(4x) = f(g(x))*

The above is the reverse order of composing functions and shows that *g(x) = 4x* and *f(x) = sin(x).*

One thing to remember when solving problems with composite functions is that not all functions can be composed together where as some can only be composed for a certain set of x values. This condition is determined by the domain of both functions. The domain of a composed function is either the domain of the first function, or it lies inside the domain of the first function. Similarly, the range of a composed function is either the range of the second function, or else is inside it.

Looking to do the PSAT? We can help with PSAT Prep

This article was written for you by **Troy**, one of the tutors with Test Prep Academy.