**Note**: **Using** **composition of functions** **to determine if two functions are inverses** can be found here in the **Inverses of Functions** section.

We learned what a function is in the **Algebraic Functions** section, but let’s talk about more advanced types of functions. All these types of functions are found in “real life” computations that go on every day!

Let’s first review what a function is. A function is defined as a relation between two things where there is only one “answer” for every “question”. For example, $ x$ is typically the variable used for the “question” and $ y$ or $ f\left( x \right)$ is the answer. Thus, we can’t have more than one “$ y$” (dependent variable) for the same “$ x$” (independent variable).

We evaluate functions by plugging in the value in the parentheses on the left-hand side for every $ x$ (or whatever the variable is) on the right-hand side. For example, for function $ f\left( x \right)=4{{x}^{2}}+3x$, if our $ x$ was **2**, our $ f\left( x \right)$ would be $ f\left( 2 \right)=4{{\left( 2 \right)}^{2}}+3\left( 2 \right)=16+6=22$. As a more complicated example,

$ \displaystyle \begin{align}f\left( {x-1} \right)&=4{{\left( {x-1} \right)}^{2}}+3\left( {x-1} \right)\\&=4\left( {{{x}^{2}}-2x+1} \right)+3x-3\\&=4{{x}^{2}}-8x+4+3x-3=4{{x}^{2}}-5x+1\end{align}$

## Adding, Subtracting, Multiplying, and Dividing Functions

Functions, like numbers, can actually be added, subtracted, multiplied and even divided. These operations are pretty obvious, but I will give examples anyway. Let’s think of a situation where two functions would be added:

Yesterday you went to your favorite **cosmetics store** and used your **$5 off** coupon. Then you went to your favorite **shoe store** and used your** 25% off** coupon. What is the function for the **total number of dollars you spent** yesterday, given you bought items that **regularly cost $80** at **each store**? (Disregard tax).

We have two functions here: one for what you spent at the cosmetic store (given the regular price of the items), and one for what you spent at the shoe store (given the regular price of the items). You might want to put some “fake” numbers in to convince yourself that these are the correct functions.

Total amount spent at cosmetics store, given full price of items: $ \displaystyle f\left( x \right)=x-5$

Total amount spent at shoe store, given full price of items: $ g\left( x \right)\,=\,.75x$

Let’s get the total amount you spent two ways: first adding the amount **you spent separately** at each store, and then combining (adding) the functions and getting the** total amount you spent at both stores.**

We said that you bought items at each store that regularly cost **$80****. **Look how we get the same amount that we spent by first evaluating the functions separately (plugging numbers in) and then adding the amounts, and second by adding the functions, and then evaluating that combined function:

Below are the rules on how the **adding**,** subtracting**,** multiplying **and** dividing** functions work. I know the notation on the left looks really funny (and we saw this in the example above); it just means that the sum/difference/product/quotient of two functions is defined as when you just take the right hand side (what they are defined as) and add/subtract/multiply/divide them together. Makes sense, right?

Let’s use two different functions, both of which are binomials:

See – not too bad, right? I know we haven’t learned about the quotient of two functions yet; we will talk about that in the **Rational Functions** section. This particular function that we got from dividing functions can’t be simplified, but we’ll see later that some of them can.

Note that the multiplication operation on functions is not to be confused with the **composition ****of functions**, which looks like$ \left( {f\circ g} \right)\left( x \right)$. We will go over this later **here**.

## Increasing, Decreasing and Constant Functions

You might be asked to tell what parts of a function are** increasing**,** decreasing, or constant. Note that we also address this concept in the** here in the** Graphing and Finding Roots of Polynomials** section and in the here in the **Calculus:** **Curve Sketching** section.

This really isn’t too difficult, but you have to be careful to look where the $ y$ or $ f(x)$ is increasing, decreasing, or remaining constant, but the **answer **will be in an **interval of the** $ x$. The answer will always with **soft brackets**, since the exact point where the function changes direction is neither increasing, decreasing, nor remaining constant.

Let’s look at an example:

See how we are looking at the $ y$ (up and down) to see where the function is increasing, decreasing, or constant, but write down the $ x$ (back and forth)?

Also, see how the function is either increasing, decreasing, or constant for its whole domain (except for the “turning” points)?

**Important note**: If a function has a break in it, such as an **asymptote or hole** in a **rational function**, it is not increasing, constant, or decreasing at that point. We would have to “jump” over that part of the graph when writing down the $ x$ intervals, like we do with **domains and ranges**. (The function would be **discontinuous** at that point). Also, information about **polynomials** and their **end behavior**, which is sometimes taught with increasing and decreasing functions, can be found here in the **Graphing and Finding Roots of Polynomial Functions** section.

## Extrema: Relative and Absolute Minimums and Maximums

In the example above, there is a **local **(**relative**)** maximum** at point $ (3,2)$ since this is the highest point in the section of the graph where the “hill” is. A **local **(**relative**) **minimum** would similarly be the lowest point in a section of a graph where there is a “valley”. This graph would have no **absolute minimums** or **absolute maximums **(the absolute lowest and highest points on the graph), since the range of the graph goes from $ \left( {-\infty ,\infty } \right)$. These minimums and maximums are called the **extrema** of the functions, and we typically identify them as either a coordinate point, or “minimum/maximum of the $ y$ value, where $ x=$ the $ x$ value”; in the above example, we would say “a maximum of **2**, where $ x=3$”.

Again, think of the **absolute** extrema as the absolute lowest or highest point in the **whole domain** of the function, and the **relative (local) extrema** as the lowest or highest for a part of the graph. Technically, relative extrema must be the minimum or maximum of a point from **both sides of $ x$**, so they can’t be endpoints; they are just “valleys” or “hills”. Note that not every function has a lowest (minimum) or highest (maximum) point in an interval or even the whole domain (like the function $ y=x$), so there may not be any extrema. The **endpoints** of a function may be the lowest or highest points (thus the absolute, not relative extrema); these are called the **endpoint extrema**.

Here is a graph that shows some examples of **absolute**/**relative extrema**; note also the **endpoint extrema** points:

We discuss how the extrema of functions are useful in the Curve Sketching of graphs here in the** Calculus: Curve Sketching** section.

## Even and Odd Functions

There are actually three different types of functions: **even**, **odd**, or **neither**. Most functions are **neither**, but you’ll need to know how to identify the even and odd functions, both graphically and algebraically. One reason the engineers out there need to know if functions are even or odd is that they can do fewer computations if they know functions have certain traits.

### Even Functions

**Even** functions are those that are **symmetrical** about the $ y$-axis, meaning that they are exactly the same to the right of the $ y$-axis as they are to the left. **This means if you drew a function on a piece of paper and folded that paper where the $ y$-axis is, the two sides of the function would match exactly.** (You will go over all this symmetry stuff in **Geometry**). I know this sounds really complicated, but this means if $ (x,y)$ is a point on the function (graph), then so is $ (-x,y)$. One of the most “famous” examples of an even function is $ y={{x}^{2}}$.

A function is **even**, algebraically, if $ f\left( {-x} \right)=f\left( x \right)$.

### Odd Functions

**Odd** functions are those that are **symmetrical** about the **origin** $ (0,0)$, meaning that if $ (x,y)$ is a point on the function (graph), then so is $ (-x,-y)$. Think of odd functions as having the “pinwheel” effect (if you’ve heard of a pinwheel); if you put a pin through the origin and rotated the function around half-way, you’d see the same function. (**If you turn the function upside down, you’ll have same function!**) One of the most “famous” examples of an even function is $ y={{x}^{3}}$ (but a simpler one is $ y=x$).

A function is** odd**, algebraically, if $ f\left( {-x} \right)=-f\left( x \right)$.

### “Neither” Functions

Any function that isn’t odd or even, is (you guessed it!) neither!

Here are some examples with some simple functions:

Here are more examples where we’ll determine the type of function (even, odd, or neither) **algebraically. **Make sure to be really careful with the signs, especially with the even and odd exponents.

**HINT**: When dealing with polynomials, note that the **even functions** have all **zero or even exponents** **terms** – don’t forget that the exponent of a constant, like **8**, is **0**, since **8** is the same as $ 8{{x}^{0}}$, or $ (8)(1)$. **Odd functions** have all **odd exponents terms** (note that $ x$ has an exponent of **1**). Functions that are neither even nor odd have a combination of even exponents and odd exponents terms. Note that this works on **polynomials only**; for example, it does not necessarily work with a function that is a quotient of two polynomials (a rational function).

## Compositions of Functions (Composite Functions)

**Compositions of functions** can be confusing and a lot of people freak out with them, but they really aren’t that bad if you learn a few tricks.

**Note**: **Using** **composition of functions** **to determine if two functions are inverses** can be found here in the **Inverses of Functions** section.

Composition of functions is just **combining 2 or more functions, but evaluating them in a certain order**. It’s almost like one is **inside** the other – you always work with one first, and then the other. That’s all it is!

Let’s start out with an example (shopping, of course!). Let’s say you found two coupons for your favorite clothing store: one that is a** 20% discount**, and another one that is **$10 off**. The store allows you to use both of them, **in any order**. You need to figure out which way is the better deal.

First define the two functions. Make sure you understand how they work with “real” numbers with each discount, for example if you bought **$100** worth of clothes (you’d spend **$80** with first discount, **$90** with second). Of course, if you could only use one of the discounts, the amount you save depends on how much you spend, but you are allowed to use both.

Total amount spent at store with **20% discount**, given full price of items: $ \displaystyle f\left( x \right)=.80x=.8x$

Total amount spent at store with **$10 off**, given full price of items: $ g\left(x\right)=x-10$

Look at what happens when we apply the discounts in different orders, if we were to buy **$100** worth of clothes. For now, look at first two columns only:

Now look at the last column. Composition of functions are either written $ f\left( {g\left( x \right)} \right)$** **or $ \left( {f\circ g} \right)\left( x \right)$. The trick with compositions of functions is that we always work from the** inside out **with $ f\left( {g\left( x \right)} \right)$ or **right to left** with$ f\circ g\left( x \right)$. You look at what the inside (or rightmost) function first and then that’s the “**new **$ x$*“* that we use to **replace** every ** “**$ x$

*“*in the outside (or leftmost) function. Another way to look at it is the

**output of the inner function**becomes the

**input of the outer function**.

So, in the example above, if we take the **$10** off first and then take **20%** off, we have to use the** inside function **$ g(x)$ ($ x-10$) and put it in the **outside function **$ f(x)$ as the “**new **$ x$”. We have to put this everywhere on the right of the $ f(x)$ function, to replace every $ x$’s (in this example, we only have one). Don’t worry if you don’t get this at first; it’s a difficult concept! It’d be better to take the **20% off first** (which makes sense, since we’re taking the **20%** off of a higher number).

### Compositions Algebraically

Let’s do more examples of getting compositions of functions algebraically, using the two functions below:

### Compositions Graphically

Sometimes you’ll be asked to work with compositions of functions graphically, both “forwards” and “backwards”. You can do this without even knowing what the functions are! Let’s first do a “real life” example:

Let’s say you took a very part-time babysitting job (at **$12**/job) to satisfy your cravings for going to the movies (at **$10** per movie). How much money you make for the month depends on how many babysitting jobs you get that month ($ f\left( x \right)$), and how many movies you go to depends on how much money you have that month ($ g\left( x \right)$). Do you see how many movies you go to depends on how many babysitting jobs you have that month ($ g\left( {f\left( x \right)} \right)$)? (Remember, we work with inside functions first.)

Let’s show this graphically:

Graph of $ \boldsymbol {f(x)}$ | Graph of $ \boldsymbol {g(x)}$ |

Let’s say we took** 5** babysitting jobs last month. That translates into **$60** of babysitting money that month (see graph to left). That **output of $60** then is used as the **input** into the graph at the right. The output of the new graph is **6**; we could go to **6 movies** that month.

To see this algebraically, $ f(x)=12x$ and $ \displaystyle g(x)=\frac{x}{{10}}$, so $ \displaystyle g(f(5))=g(12\times 5)=g(60)=\frac{{60}}{{10}}=6$.

Here are more examples, with more complicated graphs:

I know this can be really confusing, but if you go through it a few times, it gets easier!

### Compositions Using Tables

You also may be asked to **evaluate composition of functions using tables**. You’ll see similar problems here in the **Inverses of Functions** section. Here are some problems:

## Decomposition of Functions

Sometimes we have to **decompose functions** or “pull them apart”. I like to think of this like performing surgery on them – opening them up and seeing what the pieces are!

Note that there may be more than one way to decompose functions, and some functions can’t even really be decomposed! But you should get problems that make it pretty straightforward.

The best way to show this is with an example. Let’s say we have the following functions:

**Compose Function**

Now, let’s first find $ f\left( {g\left( {h\left( {k\left( x \right)} \right)} \right)} \right)$ or $ (f\circ g\circ h\circ k)\left( x \right)$ (compose the function). To “build” the function, we need to start from the inside and go outwards. We won’t worry about multiplying out and simplifying for now.

**Decompose Function**

Now, let’s say we were given $ d\left( x \right)=\left( {{{{\left( {10x+16} \right)}}^{2}}-4} \right)+3$ (in its “unsimplified” form). Let’s go the opposite way, or “decompose” the function: look at the **last operation done**, and that will be on the outside of the composed function. The last thing we did was **add 3 **($ f\left( x \right)$), before that, we **took the square and subtracted 4 **($ g\left( x \right)$), and even before that, we **multiplied by 2 **($ h\left( x \right)$) the function “$ 5x+8$” ($ k\left( x \right)$).

When we decompose, the function on the **outside** (or the **left**) is the **last thing** we do. Since we performed the functions above in the following order: $ k\left( x \right)$ first, followed by $ h\left( x \right)$, then $ g\left( x \right)$, and finally** $ f\left( x \right)$**, we have to write the composition in the opposite order. So, $ \displaystyle d\left( x \right)=\left( {{{{\left( {10x+16} \right)}}^{2}}-4} \right)+3=f\left( {g\left( {h\left( {k\left( x \right)} \right)} \right)} \right)$ or $ \displaystyle (f\circ g\circ h\circ k)\left( x \right)$. Tricky!

Let’s try another one; decompose $ j\left( x \right)={{\left( {5\left( {2x+3} \right)+8} \right)}^{2}}-4$. Let’s look at the functions again, since we have to decompose by using them:

The last thing we did was **square something** and **subtract 4** ($ g\left( x \right)$), before that, we **multiplied it by 5 and then added 8** ($ k\left( x \right)$), before that, we **added 3 **($ f\left( x \right)$), and then before that we **multiplied ****by 2** ($ h\left( x \right)$). Again, since we work from the inside out, we have to start with the **last thing we did** and go forward: $ j\left( x \right)={{\left( {5\left( {2x+3} \right)+8} \right)}^{2}}-4\,\,\,=\,\,\,g\left( {k\left( {f\left( {h\left( x \right)} \right)} \right)} \right)$ or $ (g\circ k\circ f\circ h)\left( x \right)$. Work it the other way; it works!

## Domains of Composites

### Domains of Composites Algebraically

Sometimes in Advanced Algebra or even Pre-Calculus you’ll be asked to find the **domains of compositions of functions**, both graphically and algebraically. This isn’t totally intuitive, but if you learn a few rules, it’s really not bad at all. Let’s first review the case where you have to worry about domains; we looked at it here in the **Algebraic Functions** section. (There are other types of functions, like **trigonometric functions**, that have domain restrictions, but we won’t address these here.)

A **domain is restricted** if:

- It is
**randomly indicated**that way in the problem. For example, $ f\left( x \right)=3x-1,\,\,x\ge 0$. - There is a
**variable in the denominator**and that denominator could be**0**. For example, $ \displaystyle f\left( x \right)=\frac{1}{{x-3}}$. (In this case, $ x-3\ne 0;\,\,\,\,\,x\ne 3$). - There is a
**variable underneath an even radical sign**, and that radicand (underneath the radical sign) could be negative. For example, $ f\left( x \right)=\sqrt{{x+4}}$. (In this case, $ x+4\ge 0;\,\,\,\,\,\,x\ge -4$). - (More advanced – see
**Logarithmic Functions**section) If there’s a**variable in the argument of a log**or**ln**function; log arguments must be greater than**0**. For example, $ f\left( x \right)=\log \left( {8-x} \right)$. (In this case, $ 8-x>0;\,\,\,\,x<8$).

Note that if we could have a mixture of the above restrictions, for example, for $ \displaystyle f\left( x \right)=\frac{{\sqrt{x}}}{{x-1}}$, $ x\ge 0$ and $ x\ne 1$, so the domain of $ x$ is $ \left[ {0,1} \right)\cup \left( {1,\infty } \right)$.

The best way to show how to get the domain of a composite is to jump right in and do a problem.

**Problem:**

Suppose $ f\left( x \right)=3x-1,\,\,x\ge 0$ and $ g\left( x \right)=\sqrt{{x-2}}$. Find the composition $ g\left( {f\left( x \right)} \right)$ and it’s domain.

**Solution:**

To get the composition, we put the inner function as the “**new $ x$**” in the outer function, so $ \displaystyle g\left( {f\left( x \right)} \right)=g\left( {3x-1} \right)=\sqrt{{\left( {3x-1} \right)-2}}=\sqrt{{3x-3}}$. Because of the even root, we have (at a minimum), $ 3x-3\ge 0;\,\,\,\,\,\,\,\,x\ge 1$.

But we can’t just look at the** composite function alone to get the domain of the composition** **of functions**; unfortunately, it’s a little trickier than this. We also need to see what values $ x$ can be for the **inside function**, since $ x$ goes directly into that function. Since the inside function is $ f\left( x \right)=3x-1,\,\,x\ge 0$, we know that $ x\ge 0$ (this was **given **as a domain restriction in the problem).

Then we have to **put these two restrictions together** to get the domain of the composite, which means taking the **intersection** or “and” (both have to work) of $ \displaystyle x\ge 0$ and $ \displaystyle x\ge 1$, which is $ \displaystyle x\ge 1$. (For example, **.5** doesn’t work, since it’s not both $ \ge 0$ and $ \ge 1$.) The domain of $ g\left( {f\left( x \right)} \right)$ is $ \left[ {1,\,\,\infty } \right)$.

Remember also that if either the domain of the inner or domain of outer (where you put the inner) is **all real numbers (no restrictions)**, you don’t have to worry about that part of the intersection (see examples below).

**Note**: Instead of actually getting the composite function like we did above, we can also **restrict the inner function to the outer domain** directly. So, in the above example, we would have seen that the domain of the outer is $ x\ge 2$ because of the even radical, and then gotten the inner function (the “**new $ x$**”) in the outer domain this way: $ 3x-1\ge 2;\,\,\,\,\,3x\ge 3;\,\,\,\,\,x\ge 1$. Coupled with the restriction of the inner function ($ \displaystyle x\ge 0$), we still have $ \displaystyle x\ge 1$.

**A trick:**

I like to just remember the following “trick”: **Domain of Composite = **The Intersection of {the **D**omain of the** I**nner** F**unction} and {Restricting the **I**nner **F**unction to the **O**uter **D**omain}.

Another way to write this is the **Domain of the Composite** is:

$ \text{D}\,\text{I}\,\text{F }\,\,\cap \text{ }\,\,\text{I}\,\text{F}\to \,\,\text{O}\,\text{D}$

Let’s do more examples. For the following functions, find the composition and its domain:

Let’s do one more that happens to involve a **Rational Function**, that we will learn about here in the **Solving Rational Functions, including Asymptotes **section. To get the domain of the following composition, we will have to use a **sign chart**. We’ve worked with sign charts here in the** Quadratic Inequalities **section, and they are a useful tool!

### Domains of Composites Graphically

We can determine the domains of composites graphically too, and this way is actually better to see what’s going on. I call these the **X-Y-X** method (from the outside-in), since that is the sequence of events (look at **X** in the outside graph, then use it as a **Y** on the inside graph, then pick the **X** from the inside graph). This is the same as **applying the domain of the outside function as the range of the inside function**, and then getting the inner function’s new domain.

Here are some examples:

If we knew what these functions were algebraically (we’ll see how later!), we could use the $ \displaystyle \text{D}\,\text{I}\,\text{F }\cap \text{ I}\,\text{F}\,\to \,\text{O}\,\text{D}$ method. I know this is really difficult, but follow these steps and you’ll be able to do any of the problems!

## Applications of Compositions

Here are a couple of composites applications you may see in your Algebra class:

**Learn these rules, and practice, practice, practice**!

Click on Submit (the arrow to the right of the problem) to solve this problem. You can also type in more problems, or click on the 3 dots in the upper right hand corner to drill down for example problems.

If you click on “Tap to view steps”, you will go to the **Mathway** site, where you can register for the **full version** (steps included) of the software. You can even get math worksheets.

You can also go to the **Mathway** site here, where you can register, or just use the software for free without the detailed solutions. There is even a Mathway App for your mobile device. Enjoy!

On to **Algebra Word Problems **– you are ready!