If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Intro to composing functions

This video is about composing functions, which is the process of building up a function by composing it from other functions. It explains how to evaluate the composition of functions step by step, using examples with three different function definitions: f (x), g(t), and h(x). Created by Sal Khan.

## Want to join the conversation?

• could you still answer f(g(x)) without knowing what "x" is? •   Yes. You can literally plug in the whole equation for g(x) in for f(x). For example:

f(x) = 2x + 1 and g(x) = 4/x

Then to solve for f(g(x)), you would plug in g(x) (the whole formula), in to f(x) for x. So...

f(g(x)) = 2(4/x) + 1 = 8/x + 1

This is just a simple example but you can do it with many more complicated formulas as well.
For example:
(given f(x) = 2x+3 and g(x) = -x^2 + 5
( f o g)(x) = f (g(x))
= f (–x^2 + 5)
= 2(g(x)) + 3
= 2(–x^2 + 5) + 3
= –2x^2 + 10 + 3
= –2x^2 + 13

Yes I know that these formulas are not as complicated as many people doing Algebra 2 could do, but I was just giving another example...

Hope this helps... :)
• can a function have more than one variable? like: f(a,b) or something •  Absolutely! A function with more than one variable would be called a multivariable function. and that is actually the correct way of notating it! A function with 2 variables would make a 3D object, 3 would make a 4D object, etc. Great question!
• will i need this for real life. plzzz help i need to kno •   Yes; say that I sell cars. In the function f(x) = y, the input (or x) is the number of cars being made in the year and the output (or y) is the price one needs to sell a car for. And then I will need to calculate the least amount of cars I would have to sell in order to earn enough money to pay my employees. The price of the car in that year will be P and the number of cars I will need to sell will be S, so I will now have a new function called g(P) = S.
However, it's too much unnecessary work for me to have those two separated because P, the price one needs to sell a car for, equals my definition of y, which equals f(x). So instead of going through two functions, I can now use g(f(x)) to find out how many cars I need to sell in the least in each year.
• Hey guys
Is it necessary to complete Algebra 2 before staring Precalculus ? • At where did you get (-3)^2-1 from? • WHAT IS THIS, I'm totally CONFUSED- • is the chart and graph the same for each example? • I have a question that is more general. I'm taking Precalculus next year, and was planning on studying in advance through Khan Academy. Has anyone taken Precalculus before? If so, does the curriculum in Khan Academy align with what is being taught at school? • Precalc Honors for me included topics such as:
Graphing linear, exponential, quadratics, cubics, quartics, stuff with higher degrees, logs, natural logs, powers of e.
Solving inequalities, factoring, difference of squares, difference quotient, stretch/shrink of graphs, vertical/horizontal shifts of graphs, reflections of graphs, horizontal/vertical asymptotes, properties of logs, solving logs, unit circle, radians, degrees, linear velocity, angular velocity, graphing trig functions, angle of depression/elevation, domain/range of trig functions, solving triangles, rule of sines, rule of cosines, equations/graphing/rules of: roses, limacons, cardioids, parabolas, ellipses, hyperbolas, and parametrics. Limits, sigma notation, geometric and arithmetic, half life, apert formula, a=pe(1+r/n)^nt thing, explicit/recursive.
This isn't a comprehensive list, since I don't recall everything, and also what I learn may not be what you learn, but this should give you a general idea.
• I have a few questions, why is it called class 12 math (India)? Is it like Indian math or something? Also I am in 8th grade, do you think I am too young to be learning this? Is this only for 12th graders? On my study guide, it says that F(x)= 8 =x(x-5)(2x-4). I know that an easy guess for x is 1, and if you write it out you can confirm it without strenuous arithmetic. but I don't understand how it goes from F(x) is 8, and 8=F(1), to saying that (x-1) is a factor of the equation 0 = 2x^3 - 14x^2 + 20x - 8
(2x^3 - 14x^2 + 20x is the standard form of x(x-5)(2x-4))

....Oh wait, does any real possible answer to x minus itself make a zero? And if so,
Also, is there an easier way to find a possible x (such as the 1 in the above equations) than guessing? • ƒ(x) = x(x - 5)(2x - 4)
ƒ(1) = 8
That means when you plug in 1 for "x" in the above expression, you will get 8.
Remainder Theorem tells us that when we divide ƒ(x) by a linear binomial of the form (x - a) then the remainder is ƒ(a). We know that ƒ(1) = 8. It follows that if we divide ƒ(x) by (x - 1), then our remainder is 8. We can make (x - 1) a factor of ƒ(x) if we add something to the function that will get rid of the remainder. Since the remainder is 8 and we want to get rid of that, we subtract 8 to get:
ƒ₁(x) = 2x³ - 14x² + 20x - 8
If we divide by (x - 1) our remainder is:
ƒ₁(1)
Which we note is 0, because the first 3 terms are from the original function ƒ(x) and that already yielded 8, and when we combine that with the remaining -8, we get 0. Therefore (x - 1) is indeed a factor of 2x³ - 14x² + 20x - 8.
Your second question asks if there is an easier way to solve the following equation:
x(x - 5)(2x - 4) = 8
Here is the systematic algebraic way to do it:
First expand the LHS:
2x³ - 14x² + 20x = 8
Subtract 8:
2x³ - 14x² + 20x - 8 = 0
We solve this equation by factoring it. From our analysis above, we know that (x - 1) is a factor of the polynomial, so we want to divide the polynomial by (x - 1) and find the quotient. We can do this with synthetic division. This yields:
(x - 1)(2x² - 12x + 8) = 0
We can continue to search for roots by finding the roots of the quadratic:
2(x - 1)(x² - 6x + 4) = 0
(x - 1)(x² - 6x + 4) = 0
The quadratic is not factorable. The quadratic formula yields roots 3 ± √5.
Therefore the solutions to the equation:
x(x - 5)(2x - 4) = 8
are:
x ∈ {1, 3 ± √5}
Comment if you have questions.