Advanced Placement
Skip to the notes

AP Precalculus

Topic 2.7: Composition of Functions

Watch now22 min

Updated · For the May 2027 AP exam

Composing functions and taking compositions apart, in equations, tables and graphs. Find the unit-conversion step that left a new airliner without fuel at 41,000 feet, and how far it could glide.

Topic 2.7 key terms

composite function
The function f∘gf\circ g, defined by (f∘g)(x)=f(g(x))(f\circ g)(x) = f(g(x)): the output values of gg are used as input values of ff.
inside-out order
In f(g(x))f(g(x)) the inner function gg acts first and the outer function ff acts second.
not commutative
f∘gf\circ g and g∘fg\circ f are typically different functions, so f(g(x))f(g(x)) and g(f(x))g(f(x)) are typically different values.
identity function
i(x)=xi(x) = x. Composing with it leaves any function unchanged: f(i(x))=i(f(x))=f(x)f(i(x)) = i(f(x)) = f(x), like adding 0 or multiplying by 1.
substitution
To build f(g(x))f(g(x)) from formulas, substitute g(x)g(x) for every instance of xx in ff.
domain of a composite
The inputs xx of gg whose outputs g(x)g(x) are in the domain of ff.
decomposition
Rewriting a function as a composition of simpler functions; the last operation performed is the outer function.
inside vs. outside
Composing with x+kx + k or kxkx on the inside, f(x+k)f(x+k) or f(kx)f(kx), transforms the graph horizontally; on the outside, f(x)+kf(x)+k or k f(x)k\,f(x), vertically.

Transcript

2,813 words · 10 parts

Flight 143

It’s a little after eight on a summer evening in 1983, and Air Canada Flight 143, a brand-new Boeing 767, is cruising at forty-one thousand feet over northern Ontario, carrying sixty-nine people. Then a warning goes off in the cockpit, low fuel pressure on the left side, and the captain turns for Winnipeg right away and starts down. Within minutes the left engine quits, and then the right one stops too, so now this airliner has no engines at all.

Every screen in the cockpit goes black, and all the pilots have left are four little dials, a compass, an artificial horizon, an airspeed indicator and an altimeter. Nothing was leaking, the tanks were simply empty, which is strange, because people had measured this jet’s fuel by hand and done the arithmetic, twice, and every multiplication was right.

By the end of this lesson, you’ll be able to find the exact step, on paper, where more than half of this jet’s fuel disappeared before takeoff, and work out, minute by minute, how far it could still glide with both engines dead. Both come down to one idea: feeding the output of one function straight into another. To see it, we have to go back a few hours, to the ramp in Montreal.

Sixty-four centimeters

The fuel gauges on this jet were blank that day, so the only way to know how much fuel it had was to measure it by hand. Under each wing is a dripstick, a measuring rod you pull down out of the tank, and on the first tank it read sixty-four centimeters. But you can’t burn a length, so the crew used a table made for this tank, which turns a stick reading into a volume of fuel.

Sixty-four goes in and three thousand nine hundred twenty-four liters come out, so the table is really a function, centimeters in, liters out, and let’s call it V, for volume. But the flight plan asks for kilograms, since what matters is how much the fuel weighs, so we need a second function that turns liters into kilograms.

Jet fuel has a mass of about point eight kilograms per liter, so the second function multiplies by point eight, and watch what happens to our number on the way. That number came out of the table as an output. Hand it to the second function, and now it’s an input. Keep your eye on that handoff.

On paper, V is a drip table, so it takes sixty-four and hands back three thousand nine hundred twenty-four liters, and m takes that number and hands back about three thousand one hundred kilograms. In one line we write m of V of sixty-four, which says feed sixty-four to V, then feed whatever comes out to m.

You read it from the inside out, because m can’t start until it has the volume, so V has to go first, even though m is written first. You’ll also see it as m circle V, which we call a composite function, and that open circle has nothing to do with multiplying. In general, f composed with g means g goes first, and g’s outputs become f’s inputs, so the function written closest to the x is always the one that acts first.

The other tank’s stick read sixty-two centimeters, so now you find m of V of sixty-two, the kilograms of fuel in that second tank. That’s exactly how AP questions like to ask it, with one function in a table and the other as a formula. So the tanks really held about six thousand one hundred fifty kilograms, far short of the twenty-two thousand three hundred needed, but that’s not what anyone wrote down.

Their second function wasn’t times point eight, it was times one point seven seven. Both tanks together held seven thousand six hundred eighty-two liters, and times one point seven seven, that’s about thirteen thousand six hundred, which everyone read as kilograms.

They thought they were about eight thousand seven hundred kilograms short. They divided by the same one point seven seven and pumped in about five thousand liters. On paper, the jet now had all twenty-two thousand three hundred. But one point seven seven turns liters into pounds, not kilograms, and a pound is less than half a kilogram, so the jet took off with less than half the fuel everybody thought it had.

Side by side, you can see the first function was perfect both times, and the second function decided what the number meant, so it has to fit what the first one hands it, liters in and kilograms out. To be fair to them, this was one of the airline’s first jets to measure fuel in kilograms instead of pounds. And the official inquiry found that nobody had clearly been given this job, and that with blank gauges the jet should never have left.

Which comes first?

Order matters too. You would care a lot if your teacher offered to curve a seventy on a test and let you choose the order: adding ten points, and multiplying by one point one. Take a moment to think about it. Which order would you ask for?

Adding first is s of a of seventy, eighty times one point one, eighty-eight, while multiplying first is a of s of seventy, seventy-seven plus ten, eighty-seven. The extra point comes from the ten, because when it goes in first, the one point one turns it into eleven. So s of a and a of s are different functions, and that’s true for most pairs.

Most pairs, not all. Double then triple, or triple then double, and you get six times the input either way. Typically, though, f of g and g of f are different. Composition isn’t commutative.

The Mirror Room

Tables and formulas are two ways to compose, and AP questions also hand you graphs, so here’s the most beautiful way I know to compose with graphs. The floor is a coordinate plane, the straight ribbon of light is g, the curved one is f, and standing along the line y equals x is a real mirror.

For f of g of eight, the beam starts at eight and travels up to g, and since g of eight is five, it turns there, carrying the output five. It runs sideways to the mirror, and watch the glass, because the five that came out of g as an output turns into an input for f.

That’s the mirror’s job, because every point on y equals x is as high as it is far across, so a height of five becomes a position of five. Then the beam runs to f, and f of five is three, so it carries the three back over our eight and drops a bead, and f of g of eight is three.

Now you drive. Slide the emitter until the bead lands right on the x-axis, where f of g of x is zero. Now let’s sweep the emitter across, dropping a bead at every input. Look at what the beads draw: f of g, a parabola twice as wide as f, and shifted to the right. Now let’s swap the two sculptures, so the beam meets f first.

It’s the same two functions, but the curve is different, half as tall as f and lifted up, which is what not commutative looks like. Now let’s make the inside function the mirror itself, and every bead lands right on f. Let’s flatten the room onto the board, where the mirror becomes the line y equals x.

The mirror hands back exactly what it gets, so y equals x is called the identity function, and composing with it changes nothing, like adding zero or multiplying by one. It works from the outside too, because i of f of x just hands back whatever f made, so composing with the identity in either order gives you f again.

Here are two new functions as tables, with the inputs zero through four along the top, f’s outputs in the middle row, and g’s outputs along the bottom. For f of g of two, start inside, g of two is three, then three becomes f’s input, and f of three is two.

Do that for every input: zero goes to one, then three, one to four, then one, two to three, then two, three to zero, then four, and four to two, then zero. That’s the table of f of g, and every column is a point, like a bead in the mirror room.

Every x gets the whole inside

With formulas, let’s build f of g of x when f of x is x squared minus three x and g of x is two x plus one. Think of f’s x as an empty slot, so f squares whatever is in the slot and subtracts three of it.

For f of g of x, the whole inside function goes into every slot, so we get two x plus one, squared, minus three times two x plus one. That expands to four x squared plus four x plus one, minus six x, minus three, which leaves four x squared minus two x minus two. The classic mistake is filling only the first slot, but every x in f gets the whole inside.

Try one yourself. If f of x is x squared plus four and g of x is x minus three, which expression is f of g of x?

How far can it glide?

Now back to Flight 143, where the second engine has just stopped at about thirty-five thousand feet, and the question is how far this jet can still glide. From above, the answer looks like a ring around the jet, everywhere it can still reach, and right now it reaches about seventy nautical miles out.

Winnipeg is sixty-five nautical miles away, just inside the edge. Gimli is forty-five, well inside. Watch the ring as the minutes go by. Winnipeg never gets more than about five nautical miles inside the edge. An edge is no place to bet sixty-nine lives, so at eight thirty-two the captain turned for Gimli.

So where does that seventy come from? The first officer, Maurice Quintal, found that they were losing about five thousand feet for every ten nautical miles. So every five hundred feet buys about a nautical mile, and from h feet up the jet can glide about h over five hundred nautical miles, which we’ll call R of h.

The height was falling about two thousand feet a minute, so if t is the number of minutes since the second engine stopped, h of t is thirty-five thousand minus two thousand t. Nobody had range as a function of time, but range depends on height and height depends on time, so the composite, R of h of t, does the job.

At t equals zero, the height is thirty-five thousand feet and the range is seventy nautical miles, and ten minutes later the height is fifteen thousand feet and the range is thirty. For one formula, the whole inside function goes into R’s slot, and dividing each part by five hundred leaves seventy minus four t, so the ring shrinks four nautical miles every minute.

So how far could the jet still glide five minutes after the second engine stopped, in nautical miles? Keep that ring in mind, because Gimli was so far inside it that it caused a surprising problem.

When the beam escapes

Sometimes a composition can’t be done for every input, so here f is the square root, which only takes inputs of zero or more, and g of x is nine minus x squared. Starting from two, g of two is five, and the square root of five is about two point two four, so we get a bead.

Starting from four, g of four is negative seven, and when the beam crosses the mirror at negative seven, there’s no ribbon to catch it, so it flies off into the dark. The beads only land between negative three and three, and they make a perfect semicircle.

An input gets through only if g can take it and f can take what g hands over, so for the domain of f of g, nine minus x squared can’t be negative, and x stays between negative three and three.

Here’s a sneaky one. Let f square, and let g take the square root. Then f of g of x simplifies to x. But the chain still can’t take a negative, so its domain is only x greater than or equal to zero. Try negative four, and the square root has nothing to hand over, so the chain stops before f ever gets a turn, even though the simplified formula would happily say negative four.

Inside and outside

To take a function apart, imagine typing it into a calculator. For the square root of three x minus one, the last key you’d press is the square root. That last key is the outside function, f of x equals the square root of x, and everything before it is the inside, g of x equals three x minus one.

Sometimes the inside shows up twice. Take h of x equals x plus one, squared, plus three times x plus one. Cover each x plus one with a box: box squared, plus three box. What’s left is f, so f of x equals x squared plus three x. The box held x plus one, so h of x is f of x plus one.

Try one. Two x minus one, cubed, plus five is f of two x minus one. What is f of x? Taking a function apart is the slot move, run backward. Find the inside, cover it with a box, and read off the outside.

Here’s f alone, with a glass block that adds three to any number passing through, and inside, before f, it slides the whole graph three to the left. It goes left because f gets every input three early, so everything happens three units sooner, which is why the drone show in the transformations lesson flew left for plus three. f hits its lowest point when it’s handed a three, and with the block in front, x only has to be zero to hand it that three, so the low point moves from three to zero.

Outside, after f, it adds three to f’s output, so the graph lifts straight up. So inside moves the graph sideways, and outside moves it up and down. That’s also why f of g came out wider, and g of f came out shorter. Your turn. Drag the times-two block to the spot that makes the graph twice as tall.

On the AP exam

Here’s how AP questions put it all together, with f given as a graph made of straight pieces and g of x equal to x squared minus one. Start with this one, and find f composed with g, at one.

Real exams also ask harder questions, like solving f of g of x equals zero, and since f is zero only at negative two and three, g of x must equal negative two or three. x squared minus one can’t equal negative two, and the sentence that earns the point is why, x squared minus one is never less than negative one.

The other equation, x squared minus one equals three, means x squared is four, so x is two or negative two. So the solutions are negative two and two, and they check, because g of two is three and f of three is zero.

Gimli

Here’s the problem I promised. Gimli was so far inside the ring that the jet came in much too high, and with no engines, there’s no going around for another try. Captain Bob Pearson was an experienced glider pilot, so he crossed the controls and turned the jet partly sideways in a sideslip, something airline pilots almost never do, to lose height and speed fast.

They touched down within eight hundred feet of the start of the runway. The nose wheel never locked, so the nose scraped along the concrete in a shower of sparks, which helped stop the jet. At the far end, families from a drag-racing weekend were camped in tents and trailers, and the jet stopped before it reached them, and all sixty-nine people on board got out alive.

And you’ve done both things I promised, because you found the step where the fuel went missing, the second function, times one point seven seven, which turned liters into pounds, and you built the function the crew needed in the air, range from height, composed with height from time. The jet was repaired and flew for almost twenty-five more years, and everybody called it the Gimli Glider. Next time we’ll run a function backwards, from the kilograms you need to the liters you pour, and that’s called an inverse function.

Unit 2: Exponential and Logarithmic Functions

  1. 2.1Change in Arithmetic and Geometric Sequences
  2. 2.2Change in Linear and Exponential Functions
  3. 2.3Exponential Functions
  4. 2.4Exponential Function Manipulation
  5. 2.5Exponential Function Context and Data Modeling
  6. 2.6Competing Function Model Validation
  7. 2.7Composition of Functions
  8. 2.8Inverse Functions
  9. 2.9Logarithmic Expressions
  10. 2.10Inverses of Exponential Functions
  11. 2.11Logarithmic Functions
  12. 2.12Logarithmic Function Manipulation
  13. 2.13Exponential and Logarithmic Equations and Inequalities
  14. 2.14Logarithmic Function Context and Data Modeling
  15. 2.15Semi-log Plots