Combining and Composing Functions Advanced. This lesson goes beyond core Algebra I. You can skip it.
Progress can't be saved in this browser, so this lesson's status can't be set.
Learning goals
- Add, subtract, multiply and divide two functions, excluding any input where the divisor is zero
- Compose with , inner first
- Substitute the whole inner rule to get a composed formula
- Show that usually differs from
- Require an input allowed into both functions in turn
Building new functions by arithmetic
Suppose and give two runners’ positions in meters from the same starting mark, seconds after they start. The second runner has a two-meter head start. At time , the sum of their positions is . The difference tells how far the first runner is ahead; it is negative while the first runner is behind.
You evaluate both functions at the same input, then combine their outputs. In general:
Each combination is a new function. For example, means “evaluate both functions at the input and add their outputs.”
The sum, difference and product use only inputs accepted by both functions. The quotient needs that same shared domain and one further condition: . Even if both outputs exist, their quotient does not exist when its denominator is zero.
Worked example 1 Adding, subtracting, multiplying, and dividing two functions
Let and , now treated simply as algebra rules that accept any real number , not only the runner story’s elapsed time. Build all four combinations, and find where the quotient is defined.
For the sum, subtraction, and product, substitute the two rules and simplify:
For the quotient, write the fraction and then find the input that would make the denominator zero:
So is defined for every input except . You can also evaluate any combination at a number. At , for instance, and , so and .
Check your understanding
If and , what is ?
Add the two rules at the same input, then combine like terms.
The function just means 'evaluate , evaluate , and add the two outputs.' The choice drops the from and keeps only its constant term. The choice adds the two -terms but drops the constant . The choice multiplies the -terms, , instead of adding them.
Composing: feeding one function into another
Picture two machines in an assembly line. The first receives the input, and its output goes directly into the second. This differs from evaluating both functions at the original input.
Make it concrete with and . Start with an input, say . Run first: . Now take that result, , and run it through : . The end product of the two-step process is . Written on one line, this is : the inner function acts on , and acts on whatever hands it.
This two-step operation is composition, and it has its own symbol. The composition of and is written (read ” composed with ,” or ” after ”), and it is defined by
The little ring is not multiplication and not the letter o; it is the composition sign. The right-hand side, , is the form you actually calculate with.
Notice how different this is from the product from the last section. The product runs and side by side on the same input and multiplies the two outputs. Composition runs them in a chain: ‘s output becomes ‘s input. For and at , the product is , but the composition is .
In , work from the inside out, as with nested arithmetic parentheses. The inner function is , the one applied directly to . The outer function is , which receives . Thus runs first even though it is written second in .
Worked example 2 Composing at a number in both orders
Let and . You already found above by running first and then . Now reverse the order and compute : run on first, then run on the result.
So , whereas . Reversing the order changed the answer.
Finding a formula for a composition
A formula for describes the whole two-step process. Build it by substituting the entire expression wherever the rule for expects an input. Keep parentheses around that expression.
Worked example 3 Finding a formula for and
Let and . Find formulas for and .
For , substitute the whole rule into in place of its input, then expand the square. Recall , so with and :
For , substitute the whole rule into in place of its input:
These two formulas describe different functions. Putting into and into gives and , the same numbers the previous worked example found by running the machines step by step.
Check your understanding
If and , what is ?
Substitute the whole rule for into in place of its input.
The choice is actually , the OTHER order. Always check which function is inner. The choice drops the from 's rule instead of substituting it whole, and is , composing with itself instead of with .
Check your understanding
If and , what is ?
Work from the inside out. First run on the input .
Then feed that output into .
So . The choice is , which skips the inner function entirely. The choice stops after only the inner step, reporting instead of feeding it into . The choice is , the reversed order.
Order matters: a composition is not commutative
The examples show that composition is not commutative: you cannot generally swap its order. Squaring and then adding four gives . Adding four first and then squaring gives . In the second order, the added four is part of what gets squared.
Some pairs do give the same function in both orders, but that must be checked. Equality of functions requires the same domain and the same output at every allowed input. A disagreement such as at input proves these two compositions differ; agreement at one input alone would not prove equality.
The domain of a composition
A composition accepts an input only if both steps can be carried out.
Worked example 4 The domain of a composition
Let and . Find and its domain.
Substitute into to get the formula:
At , the inner step works: . The outer step fails because is undefined. At , both steps work: , then . Since accepts every real input and produces zero only at , the domain of is all real numbers except .
You can use the same two checks to find the domain of any composition.
Which inputs a composition accepts#
Take and , using real numbers. At input , the first step fails because would divide by zero. At input , the first step gives , but the second step fails because is not real. Input passes both steps: and .
For any composition , first must be in the domain of . Otherwise does not exist, so there is no output to pass to . Next, the produced value must be in the domain of . Otherwise the second step has no value.
These conditions are also sufficient: when exists and accepts it, exists. Thus the domain consists exactly of the inputs passing both checks.
Keep those checks even if the formula simplifies. For example, if and , then
The simplified expression accepts , but this composition does not: its first step is undefined. For every other input, is nonzero, so the second step is allowed. Simplifying a formula does not restore an excluded input.
Check your understanding
Let and . Which input is NOT in the domain of ?
An input survives only if accepts it and then accepts 's output. Here accepts every number, so look for the input whose output rejects. Since cannot take , find where .
At the inner output is , which cannot use, so is excluded.
Composition models a two-step process
When one quantity determines a second, which then determines a third, you can write the chain as a composition. Examples include discounts followed by fees, converted readings, and area determined by a changing length.
Worked example 5 A discount followed by shipping
An online store takes percent off every item, then adds a flat shipping fee of dollars to the discounted price. Model the final price as a composition, and find it for an item that normally costs dollars.
Name the two steps. Taking percent off leaves percent of the price, so the discount function is . Adding shipping to a price is . The store discounts first and then adds shipping to the discounted price, so shipping is the outer function and the final price is :
For an item with :
The final price is dollars. Had the store instead added shipping first and then discounted, the result would be , which at gives dollars. That policy discounts the shipping fee too, so it costs one dollar less.