- [Instructor] We're going to do in this video is review
the notion of composite functions
and then build some skills recognizing
how functions can actually be composed.
If you've never heard of the term composite functions
or if the first few minutes of this video
look unfamiliar to you,
I encourage you to watch the algebra videos
on composite functions on Khan Academy.
The goal of this one is to really be a little
bit of a practice before we get into some skills
that are necessary in calculus,
and particularly the chain rule.
So let's just review what a composite function is.
So let's say that I have,
let's say that I have f of x,
f of x being equal to one plus x.
And let's say that we have g of x
is equal to, let's say g of x is
equal to cosine of x.
So what would f of g of x be,
f of g of x?
And I encourage you to pause this video
and try to work it out on your own.
Well one way to think about it is
the input into f of x is no longer x,
it is g of x.
So everywhere where we see an x
in the definition of f of x,
we would replace with the g of x.
So this is gonna be equal to,
this is gonna be equal to one plus.
Instead of the input being x,
the input is g of x, so the output
is one plus g of x.
And g of x, of course, is cosine of x.
So instead of writing g of x there,
I could write cosine of x.
And one way to visualize this is,
I'm putting my x into g of x first,
so x goes into the function g,
and it outputs g of x.
And then we're gonna take that output, g of x,
and then input it into f of x,
or input it into the function f, I should say.
We input into the function f,
and then that is going to output f of
whatever the input was, and the input is g of x,
g of x.
So now with that review out of the way,
let's see if we can go the other way around.
Let's see if we can look at some type
of a function definition and say,
hey, can we express that as a composition
of other functions.
So let's start with, let's say
that I have a g of x
is equal to cosine of
sine of x plus one.
And I also wanna state,
there's oftentimes more than one way
to compose, or to construct a function
based on the composition of other ones.
But with that said, pause this video and say,
hey, can I express g of x
as a composition of two other functions,
let's say an f and an h of x?
So there's a couple of ways that you could think about it.
You could say, alright, well let's see,
I have this sine of x right over here.
So what if I called that an f of x?
So let's say I called that,
well actually let me use a different variable
so we don't get confused here.
Let me call this u of x,
the sine of x right over there.
So this would be cosine of u of x plus one.
And so if we then divided,
if we then defined another function as v of x
being equal to cosine of whatever its input is
plus one, well then this looks like the composition
of v and u of x.
Instead of v of x, if we did v of u of x,
then this would be cosine of u of x plus one,
let me write that down.
So if we wrote v of u of x,
which is sine of x, if we did v of u of x,
that is going to be equal to
cosine of, instead of an x plus one,
it's going to be a u of x plus one.
And u of x, let me write this here,
u of x is equal to sine of x.
That's how we set this up.
So we can either write cosine of u of x plus one,
or cosine of sine of x plus one,
which was exactly what we had before.
And so this function, g of x,
is we say u of x is equal to sine of x,
if we say u of x is equal to sine of x,
and v of x is equal to cosine of x plus one,
then we could write g of x as the composition
of these two functions.
Now you could even make it a composition of three functions.
We could keep u of x to be equal to sine of x.
We could define, let's say, a w of x
to be equal to x plus one.
And so then, let's think about it.
W of x,
w of u of x, I should say,
w of u, I'll do the same color,
w of u of x is going to be equal to.
Now my input is no longer x, it's u of x,
so it's going to be a u of x plus one,
or just sine of x plus one.
So that's sine of x plus one.
And then if we define a third function,
let's say, let's see, I'll call it,
let's call it h; we're running out of variables,
although there are a lot of letters left.
So if I say h of x is just equal to the cosine
of whatever I input, so it's equal to the cosine of x,
well then h of w of u of x
is gonna be g of x.
Let me write that down.
H of w of u of x,
u of x, is going to be equal to,
remember, h of x takes the cosine
of whatever its input is,
so it's gonna take the cosine.
Now its input is w of u of x.
We already figured out w of u of x
is going to be this business.
So it's going to be sine of x plus one,
where the u of x is sine of x,
but then we input that into w,
so we got sine of x plus one,
and then we inputed that into h
to get cosine of that,
which is our original expression,
which is equal to g of x.
So the whole point here is to appreciate
how to recognize compositions of functions.
Now I wanna stress, it's not always
going to be a composition of a function.
For example, if I have some function,
let me just clear this out,
if I had some function f of x
is equal to cosine of x times sine of x,
it would be hard to express this as
a composition of functions,
but I can represent it as the product of functions.
For example, I could say cosine of x,
I could say u of x is equal to cosine of x.
And I could say v of x, it's a different color,
I could say v of x
is equal to sine of x.
And so here, f of x wouldn't be the composition
of u and v, it would be the product.
F of x is equal to u of x
times v of x.
If we were take the composition,
if we were to say u of v of x,
pause the video, think about what that is,
and that's a little bit of review.
Well this is going to be, I take u of x
takes the cosine of whatever is input,
and now the input is v of x, which would be sine of x;
sine of x.
And then if you did v of u of x,
well that'd be the other way around.
It would be sine of cosine of x.
But anyway, this is once again, just to
help us recognize, hey, do I have,
when I look at an expression or a function definition,
am I looking at products of functions,
am I looking at compositions of functions?
Sometimes you're looking at products of compositions
or quotients of compositions,
all sorts of different combinations of how
you can put functions together to create new functions.