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.

Main content

What is the range of a function?

Sal introduces the concept of "range" of a function and gives examples for functions and their ranges.

Want to join the conversation?

  • leafers ultimate style avatar for user Andrija Despotović
    If g(x)=x^2/x
    and
    x^2/x=x
    then can we say that:
    g(x)=x
    And if we can, how than for x=0 this expression is undefined?

    In Serbia, we learned that expressions needs to be simplified if it is possible. So x^2/x is same as x, and regular way to describe it is to write it like that, just x.

    I`m interested in this, because if this is the case with functions, any expression (X) could be writen like that - X^2/X which then means that no expression (X) is defined for X=0, regardless of what expression is.

    For example, F(x)=345x is defined for input value of 0, and has output of 0. But 345x=(345x)^2/345x, it is undefined for x=0.


    Im sorry if this is stupid question, and if i missed some basic rule with functions, but this is not clear to me. Can we transform expressions in functions like we do in other mathematical expressions or can we not?
    (35 votes)
    Default Khan Academy avatar avatar for user
  • leafers sapling style avatar for user Alexandra Kathline Selwood
    OK so I'm totally lost by this. Is this at all like the domain on the function? They seem totally different but also like the exact same thing.
    (6 votes)
    Default Khan Academy avatar avatar for user
  • orange juice squid orange style avatar for user Danissia Magallanes
    At Sal says that the definition is F(x) is going to be equal to x^2. Does that mean that if I have a function notation such as f(x)=x+4 and a given x is 2, do I have to square the 2?
    (7 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Stefen
      Yes - that is how it works, if you have f(x)=x² and are asked what is f(2), then you replace every instance of x in the function definition with 2 so given f(x) = x², that means f(2) = 2² = 4.
      Here is another example: If f(x) = x² + 5x then f(2) = 2² + (5)(2) = 4 + 10 = 14
      (12 votes)
  • duskpin tree style avatar for user GirlOnFire
    what is the difference between f(x) and y values?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      f(x) is Y.
      The equation f(x) = 2x - 5 is the same a y = 2x - 5 provided the equation with Y is a function. Not all equation are functions. So, you can't always swap out Y for f(x). However, you can always swap out f(x) for Y.
      (11 votes)
  • piceratops sapling style avatar for user Eliza
    Sorry if this was asked already but what is a non real number and what would an example be?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • male robot johnny style avatar for user karthiknandan542003
    What if the input is an imaginary number (i) ? how will the graph be?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user 315183
    At why cant y be negative? Is this true for all problems or only dis one
    (3 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      To answer you question of if it is always true, the answer is no. If you start from the quadratic parent function, y=x^2, then y cannot be negative.
      One way to include negatives is to reflect it across the x axis by adding a negative y = -x^2. With this y cannot be positive and the range is y≤0. The other way to include negatives is to shift the function down. So y = x^2 -2 shifts the whole function down 2 units, and y ≥ -2.
      (4 votes)
  • spunky sam blue style avatar for user Ramkumarananthakrishnan
    Hi,

    I have a function f(x) = 1/(x-2) where x belongs to R. We know that

    Domain will be all numbers but 2 since the function will not be defined at 2.


    And the range is all real numbers except 0.

    The definition of range is the set of all possible values that the function will give when we give in the domain as input.
    My question is this:
    now if I were to use any value from the domain (say 50000 ) 1/x-2 will give me a value less than 1 i.e 1/49998. I am not able to find any value ,in the domain,which when substituted gives me a value greater than one. So shouldn't the range be (-1,1]?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • starky ultimate style avatar for user Harsh Sharma
    i just wanna ask that we know that f(x)=y but is it true for variable other than x, is f(n)=y
    is this correct
    (2 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      We use x and y because they are graphed on a Cartesian Plane. f(n) is a little confusing because this is somewhat reserved for sequences where n is a set of whole numbers which most of the time start at 1, so that is not a good choice - saying f(n) = 3n + 1 would not be the same as y = 3n + 1. I suppose if you say that y = 3a + 5 (which could be done because a variable is just a variable), then saying f(a) = 3a + 5 would be equivalent, but is obscured by the inability to graph on a normal Cartesian Plane and possibly confusing to other mathematicians.
      (4 votes)
  • blobby green style avatar for user Ese Emuo
    I don't understand the difference in the two equations represented other than one is f(x) and the other is g(x). How did you come up with two separate answers for the domain?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      They are almost the same, but g(x) has to exclude 0 from the beginning because you cannot divide by 0 which is why Sal put a circle on the graph and f(x) includes 0. They are two different functions f(x) is quadratic and g(x) ends up almost linear. That is why their ranges are so different.
      (3 votes)

Video transcript

- As a little bit of a review, we know that if we have some function, let's call it "f". We don't have to call it "f", but "f" is the letter most typically used for functions, that if I give it an input, a valid input, if I give it a valid input, and I use the variable "x" for that valid input, it is going to map that to an output. It is going to map that, or produce, given this x, it's going to product an output that we would call "f(x)." And we've already talked a little bit about the notion of a domain. A domain is the set of all of the inputs over which the function is defined. So if this the domain here, if this is the domain here, and I take a value here, and I put that in for x, then the function is going to output an f(x). If I take something that's outside of the domain, let me do that in a different color... If I take something that is outside of the domain and try to input it into this function, the function will say, "hey, wait wait," "I'm not defined for that thing" "that's outside of the domain." Now another interesting thing to think about, and that's actually what the focus of this video is, okay, we know the set of all of the valid inputs, that's called the domain, but what about all, the set of all of the outputs that the function could actually produce? And we have a name for that. That is called the range of the function. So the range. The range, and the most typical, there's actually a couple of definitions for range, but the most typical definition for range is "the set of all possible outputs." So you give me, you input something from the domain, it's going to output something, and by definition, because we have outputted it from this function, that thing is going to be in the range, and if we take the set of all of the things that the function could output, that is going to make up the range. So this right over here is the set of all possible, all possible outputs. All possible outputs. So let's make that a little bit more concrete, with an example. So let's say that I have the function f(x) defined as, so once again, I'm gonna input x's, and I have my function f, and I'm gonna output f(x). And let's say this def... The function definition here, the thing that tries to figure out, "okay, given an x, what f(x) do I produce?", the definition says "f(x) is going to be equal" "to whatever my input is, squared." Well, just as a little bit of review, we know what the domain here is going to be. The domain is the set of all valid inputs. So what are the valid inputs here? Well, I could take any real number and input into this, and I could take any real number and I can square it, there's nothing wrong with that, and so the domain is all real numbers. All, all real, all real numbers. But what's the range? Maybe I'll do that in a different color just to highlight it. What is going to be the range here, what is the set of all possible outputs? Well if you think about, actually, to help us think about, let me actually draw a graph here. Of what this looks like. What this looks like. So the graph of "f(x) is equal to x squared" is going to look something like this. So, it's gonna look, it's going to look something like this. I'm obviously hand-drawing it, so it's not perfect. It's gonna be a parabola with a, with a vertex right here at the origin. So this is the graph, this is the graph, "y is equal to f(x)," this of course is the x-axis, this of course is the y-axis. So let's think about it, what is the set of all possible outputs? Well in this case, the set of all possible outputs is the set of all possible y's here. Well, we see, y can take on any non-negative value. y could be zero, y could one, y could be pi, y could be e, but y cannot be negative. So the range here is, the range... We could, well we could say it a couple of ways, we could say, "f(x)", let me write it this way. "f(x) is a member of the real numbers" "such that, is such that f(x) is greater than" "or equal to zero." We could write it that way, if we wanted to write it in a less mathy notation, we could say that "f(x) is going to be" "greater than or equal to zero." f(x) is not going to be negative, so any non-negative number, the set of all non-negative numbers, that is our range. Let's do another example of this, just to make it a little bit, just to make it a little bit, a little bit clearer. Let's say that I had, let's say that I had g(x), let's say I have g(x), I'll do this in white, let's say it's equal to "x squared over x." So we could try to simplify g(x) a little bit, we could say, "look, if I have x squared" "and I divide it by x, that's gonna," "that's the same thing as g(x) being equal to x." "x squared over x" is x, but we have to be careful. Because right over here, we have to, in our domain, x cannot be equal to zero. If x is equal to zero, we get zero over zero, we get indeterminate form. So in order for this function to be the exact same function, we have to put that, 'cause it's not obvious now from the definition, we have to say, "x cannot be equal to zero." So g(x) is equal to x for any x as long as x is not equal to zero. Now these two function definitions are equivalent. And we could even graph it. We could graph it, it's going to look, I'm gonna do a quick and dirty version of this graph. It's gonna look something like, this. It's gonna have a slope of one, but it's gonna have a hole right at zero, 'cause it's not defined at zero. So it's gonna look like this. So the domain here, the domain of g is going to be, "x is a member of the real numbers" "such that x does not equal zero," and the range is actually going to be the same thing. The range here is going to be, we could say "f(x) is a member of the real numbers" "such that f(x) does not equal zero." "f(x) does not equal zero." So the domain is all real numbers except for zero, the range is all real numbers except for zero. So the big takeaway here is the range is all the pos... The set of all possible outputs of your function. The domain is the set of all valid inputs into your function.