Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Y vs f(x)

  1. Aug 27, 2011 #1


    User Avatar

    Simple question:

    When should you use "y = x2 + 1" instead of "f(x) = x2 + 1", and vise versa?

    I've asked something sorta similar to this before, still a bit confused about the above specifically though.
    Last edited: Aug 27, 2011
  2. jcsd
  3. Aug 27, 2011 #2
    When you've already defined y=f(x).
  4. Aug 27, 2011 #3


    User Avatar

    What do you mean?
  5. Aug 27, 2011 #4
    In general y is used to express relationship between the expression and the coordinate axis although in most cases the fact that y is a function of x is implicitly assumed. The f(x) notation is much more general, used to express the dependency of an expression to it's variables. For example if we take the expression x2 + y then f(x) = x2 + y and f(y) = x2 + y take on very different meanings. The first expressions depends on the variable x with y as a parameter while the second is the other way around.
  6. Aug 27, 2011 #5


    User Avatar
    Science Advisor
    Homework Helper

    Hi Fuz! :smile:
    Simple, but a little misleading, it should really be …

    When should you use "y = x2 + 1" instead of "y(x) = x2 + 1", and vice versa?​

    In other words, when can we abbreviate "y(x)" to "y" ?

    The answer is: we can do it whenever it isn't misleading. :smile:
  7. Aug 27, 2011 #6
    These sorts of things confused me, too, and I think that the source of the confusion is, in large part, that "function" was never really defined until I took this math class called Abstract Vector Spaces (which is essentially a more abstract linear algebra but at my college, this is used as a gateway into proof-based courses.) Before that, I really got confused by a lot of this stuff. To me, a function was "f(x)" and and it "drew" a graph on the xy plane (or something similar in 3 space, 4 space, etc).

    So, I will give a brief definition of "function" and perhaps it will help:

    A function f from S to S' is a rule that assigns to each element s in S, one element s' in S'. We write f(s) = s'

    It is important to realize that f and f(x) are NOT the same things. f is the function and f(x) is the image of x under f. The functions that you deal with are usually going to have some nice algebraic way to describe how f acts on each x (i.e. there is a formula.) But this need not be the case. For example, if S is a dozen assorted donuts, and S' is a set of 12 people who are eating the donuts, we could define a function E from S to S' such that each donut is mapped to the person who eats it.

    Now, in your case, all of your functions are going to be from subsets of the Real Numbers to subsets of the Real Numbers. So, in higher level classes, you might see something like this, define f: R -> R by the rule f(x) = x^2. Or you might see it like this: x |-> x^2. (forgive me, I can never really get tex to work properly on this forum.)

    Sometime long ago, Descartes got an idea. He thought it would be nice to represent such functions (from R to R) in the plane. There would be two axes. The horizontal would represent the domain, and the vertical axis would represent the co-domain (or whatever you want to call it.) To draw a graph of the function, we would take any point x on the horizontal axis, and put a dot above it so that the dot was f(x) units high on the vertical axis. If you do this for each point x in the real numbers, you get the graph of the function.

    I know this doesn't answer your question directly, but I do think that this might have caused some of the confusion.
  8. Aug 27, 2011 #7


    User Avatar


    What's the difference between y(x) and f(x)? y(x) and y? When is it not misleading? Haha. I'm still not quite in what circumstances it is appropriate to use one over the other.

    Thanks for the replies, guys!
  9. Aug 27, 2011 #8


    User Avatar
    Homework Helper

    The same reason we choose to use x instead of c. Since x and y are adjacent letters in the alphabet, this could be the reason why people tend to let x be the independent variable and y the independent variable. However, you can choose whatever letters you want.

    y alone is ambiguous. One cannot tell what variables feed into y. However, if you say y(x), this explicitly tells you what variable(s) y depends on.
  10. Aug 27, 2011 #9
    ^ "y" is the name of the function, "y(x)" is the particular function value when we evaluate the function at x. If you choose to call the function "f", that's fine too. I think tiny-tim's post was pretty misleading, but he made a valid point -- nowhere in your opening post did you say that (the number) y was related to (the number) x by a function named "f". Sure, it's pretty clear that there's function relationship between y and x, i.e. when x changes, y changes; but you didn't specify that this was indeed denoted by the name "f". You could have called the function "DONUT_LOL", and then we would have "DONUT_LOL(x) = x2 + 1". For the purposes of your OP post, the name "y(x)" is pretty obvious because you have already said that y is related to x -- thus it's pretty self-explained to write "y" as the name of the function instead of just as the symbol representing a number related to x. It's not really addressing your question, but it's just for a bit of specificity here. Honestly though, it wasn't that misleading, but of course we mathematicians like to be precise, so make sure you clearly explain every claim you make and notation you use.

    Now this segues pretty well into answering your OP question ... I always find difficulties explaining function notation to people who are new to it or don't quite understand it.

    We can pretty explicitly define a function relationship between real numbers x and y by saying that y = x2 + 1. It's very obvious that y takes on different values when x is a different number. So in this interpretation, x is a (potentially) changing number, and y changes according to "one greater than the square of x", as the equation specifies. We could say "y is a function of x" and write y = y(x), or perhaps decide to name the function "f" and write y = f(x) = x2 + 1. Note that here we are interpreting this as a denotation that y changes when x changes. Here, that is why we choose to write "f(x)" or "y(x)" instead of simply "y". We want to make explicit that y is a function of x.

    Suppose we name your example function "f". Then we get f(x) = x2 + 1. Now choose a fixed number denoted by y, and suppose f(x) = y. Now we have y = f(x) = x2 + 1. This asks me to find number(s) x such that f(x) = y. I can pick y as as I like -- if I want f(x) = 5, this asks for all x such that 5 = x2 + 1. I get that |x| = 2 (two distinct numbers). Unlike in the last interpretation, y was fixed and we were asked to find x's, which turn out to be fixed when y is fixed. Here, we're not trying to say that y is a function of x -- we're trying to show that y is a number that is unchanging, and that we can find values in the domain that correspond to this number under the image of the function "f".

    A third interpretation is similar to the first: if I want to have the notion that y is a function of x, but we don't know in which way, we can write "y = f(x)". This shows that function's name is indeed "f". The point of using such notation is that we can use the name "f" in following presentations without ambiguity or confusion -- suppose we want to discuss the derivative of f: we lose no precision in writing f'(x) to denote that. Also, we don't know quite what f does to the number x in order to yield the number y ... In this sense, "f" is not "fixed", and we can consider "f" as being any function without loss of precision. Alternatively, we might want to consider f as fixed in order to discuss things that can be done with f -- differentiating, discussing its continuity, domain, etc. In the previous example, we say that the function f takes a real number, squares it, and adds one to it. This is denoted by y = x2 + 1. Observe that we have abandoned the name "f"! We don't need it here; again for example, if we want to talk about the derivative, we can simply write [itex]\frac{dy}{dx} = 2x[/itex]. Here, we know what f does to x, so we can just abbreviate this by forgetting the "f(x)" notation and writing "y = x2 + 1".

    These three separate interpretations, and probably more I have accidentally left out, are key to understanding the use of function notation. Always try to use notation wisely to minimize ambiguity and maximize precision.
    Last edited: Aug 27, 2011
  11. Aug 27, 2011 #10


    User Avatar

    I appreciate your help. So do you have to declare that y = f(x) before you use f(x) everytime? I'm not sure if my understanding is correct, but if you have f(x) = x2 + 1, is the "f" just a synonym for "x2 + 1" while "f(x)" is the number you get when you set "x" to some number in the function "f"?
  12. Aug 27, 2011 #11
    Exactly. Great that you're understanding this, glad I could help. And yeah, make sure you define (or at least are clear about) what "f" is before you use it, as with any mathematical object.
  13. Aug 29, 2011 #12
    The real answer to this is that as much as math totes rigor, the notation often isn't rigorous.

    I encourage you to always ask yourself two things about every variable and expression you encounter in your equations:

    1) What is the TYPE of the expression. (Types are things like "real", "integer", and "function from real to real"), and

    2) Where are my variables introduced and what is their scope?

    To give an example, many people will abuse the hell out of f(x) and say that f(x) is a function. It's not. "f" is the function. f(x) is f EVALUATED at x.

    The second question is harder to answer, because it isn't taught in any math class I've ever taken. It's just something you pick up over time, I guess. Most of the time, variables are introduced either through an explicit binder ("there is a y such that ...", or "let x = ..."), or implicitly in the context of the problem ("x + 0 = 0 + x", which we'd write explicitly as "for all x, x + 0 = 0 + x").
  14. Aug 29, 2011 #13
    If you EVALUATE the function f at some x ( or c )for example, you will get an expression y = x^2 + 1 ( or y = c^2 + 1 ). It just goes to show that you take a number, perform operations then you get a resulting number. This is the same as saying f( x ) ( or f ( c ) ).. which is *supposed* to indicate the number or object obtained by performing operations ( specified by f ) on a given x ( i.e., evaluation ).
    However, some confusion may arise from the notation f ( x ) = x^2 + 1, which is to *specify* the function f, by specifying how it maps one object to another. But the function itself, you can think about as an "abstract set of rules". So f( x ) = x^2 + 1 may specify the rule attached to the function f, or y = x^2 + 1 can specify how x under the operations becomes y.
  15. Aug 29, 2011 #14
    In general:

    [tex]f: \mathbb{R} \rightarrow \mathbb{R}[/tex]

    That is, [itex]f[/itex] is a binary operator which maps the reals onto themselves i.e taking an argument [itex]x[/itex] and producing a result or mapping it into the reals again; [itex]f(x)[/itex]. This produces an ordered pair [itex][x, f(x)]\;[/itex].
  16. Aug 30, 2011 #15


    User Avatar
    Science Advisor

    Nope. A http://en.wikipedia.org/wiki/Binary_operator" [Broken] has arity 2, that is, a function R2->R.
    Last edited by a moderator: May 5, 2017
  17. Aug 30, 2011 #16
    Oops! Thanks for the correction. This is true the arity of a function is 1.
    Last edited by a moderator: May 5, 2017
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook