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

Does a vertical line represent a function?

Explaining why a vertical line doesn't represent a function. Created by Sal Khan.

Want to join the conversation?

  • duskpin ultimate style avatar for user Ronit Patel
    can a horizontal line represent a function?
    (19 votes)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user Teddy Karrer
    could he have just used the vertical line test?
    (11 votes)
    Default Khan Academy avatar avatar for user
    • leaf red style avatar for user Noble Mushtak
      Yes, he could've. If he did that, then he would've noticed that the relation intersects the vertical line x=-2 at infinitely many points. This is because the relation is x=-2, so obviously it intersects it at infinitely many points.

      However, I think Sal was trying to demonstrate a more rigorous way of testing a relation for being a function. Instead of just doing a vague, vertical line test, he used the definition of a function to test the relation for being a function.

      I hope this helps!
      (39 votes)
  • blobby green style avatar for user ursaciucantonio
    3.14159, he actually started defining pi :)
    (8 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user areesha.kadiwal
    Can there be many domain but getting only one range? If the line will be horizontal will it be a function?
    (4 votes)
    Default Khan Academy avatar avatar for user
    • leaf blue style avatar for user Stefen
      One domain and one range although the domain can consist of the union of various regions on the x-axis. EG {-100 < x < -10} U {-1 < x < 1} U {10 < x < 100}. the U is the symbol of union.
      A horizontal line is a function, but a pretty boring one since no matter what x value you input, the output will always be the same. EG f(x)=5. No matter what x is, the output is always 5. As you can see, the output value does not depend on the input value x.
      (2 votes)
  • purple pi pink style avatar for user Amy D
    So is Sal saying that x -> f(x) -> infinity is not a function? If you just wrote the infinity sign could it be considered as only one output?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Johnathan
      Infinity cannot be a single output. This rhetorical question I'm about to give you came from another user: "Think of the biggest, biggest, biggest number you can then keep adding 1." There is no definite answer for infinity, so it can't be considered as a single output.
      (6 votes)
  • aqualine ultimate style avatar for user Haya Aboudan
    is a function with multiple outputs a logarithm?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • stelly blue style avatar for user Kim Seidel
      No. A function, by definition, can not have multiple outs for a specific input value. Each input can create only one output to be a function. Thus, any equation that doesn't meet this definition would not be a function.

      FYI.. there are logarithmic functions.
      (4 votes)
  • purple pi teal style avatar for user drew
    Is there any recommended time frame a course should take?
    (2 votes)
    Default Khan Academy avatar avatar for user
    • boggle purple style avatar for user saturn
      not really. one of the best things about KA is that you can learn at your own pace. it also depends on how much content the course contains and how much time you're dedicating yourself to learning on khan. are you here on a daily or weekly basis? do you set aside one hour or five hours for active learning on here? for instance, i spend around one-two hours a week on khan and it usually takes me a month to get through a single unit. thus, a course with twelve units would take me a year to complete. the bottom line is that it's really up to you :)
      (3 votes)
  • blobby blue style avatar for user Johnny
    Would a drastically curved line on a graph represent a function? Does the curve have to go through x and y to be a function?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • purple pi purple style avatar for user RJacob1
      For a relation to be a function, use the Vertical Line Test: Draw a vertical line anywhere on the graph, and if it never hits the graph more than once, it is a function. If your vertical line hits twice or more, it's not a function. For example, a circle is not a function because when you draw a vertical line on top of its graph, the vertical line will cut through the circle twice.
      (5 votes)
  • hopper jumping style avatar for user Sam D
    What's the vertical and horizontal line test?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • mr pink green style avatar for user David Severin
      The vertical line test is used to determine if a graph of a relationship is a function or not. if you can draw any vertical line that intersects more than one point on the relationship, then it is not a function. This is based on the fact that a vertical line is a constant value of x, so if there is one input, x, with more than two outputs, y, then it breaks the function rule. A horizontal line test does not have as much meaning.
      (4 votes)
  • male robot hal style avatar for user Leo
    Can a vertical line be represented by an equation?
    (2 votes)
    Default Khan Academy avatar avatar for user

Video transcript

In the following graph, is y a function of x? So in order for y to be a function of x, for any x that you input into the function, any x for which the function is defined. So let's say we have y is equal to f of x. So we have our little function machine. It should spit out exactly one value of y. If it spits out multiple values of y, we don't know what f of x is going to be equal to. It could be equal to any of those possible values for y. So let's see if, for this graph, whether for a given x it spits out exactly one y. Well, the function seems to be only defined so the domain of this function is x is equal to negative 2. That's the only place where we have a definition for it. And if we try to input negative 2 into this little black box, what do we get? Do we get exactly one thing? No. If we put in negative 2 here, we could get anything. The point negative 2, 9 is on this relation. Negative 2, 8 is on this relation. Negative 2, 7; negative 2, 7.5; negative 2, 3.14159-- they're all on these. So if you put a negative 2 into this relation, essentially, you actually get an infinite set of values. It could be 9. It could be 3.14. It could be 8. It could be negative 8. You get an infinite number of results. So since it does not map to exactly one output of this function, in the following graph, y is not a function of x.