1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The Modulus function . Need a little Explanation

  1. Aug 4, 2012 #1
    So I have been dealing with the modulus function for almost a year now , I didn't ran into it many times so didn't really tried to understand it well . But it has started to get a little bit confusing . So if someone helps me I will be really happy .
    From what I know
    f(x) = |x| = { x ; x >= 0 and -x ;x<=0

    That means |-5| = 5 and |5| = 5
    And it has a graph

    But this does not satisfy my intuition , for me the function and the graph says two different thing , I mean the function says
    f(x) = |x| = {-x ;x<=0

    so if I plug in -5 which is less than 0 then the output should be -5 only
    I know I am wrong but I am just going with function definition . What does the definition actually say ?

    Also I encounter problems while sketching graphs of the mod function .
    If someone can help me with the graph of
    f(x) = |1-x+|x|| it would be awesome
    I can graph it using wolframalpha but I want to know how it came about
  2. jcsd
  3. Aug 4, 2012 #2


    User Avatar
    Science Advisor

    Hey nishantve1.

    What the definition means is that you negate the number if less than zero and keep the original if greater than 0 (or equal).

    So with your example of -5, if we negate this we get -(-5) = +5 = 5. Another example is -10 which we negate giving us -(-10) = +10 = 10.

    Now if we give say +5, we leave it alone giving us + 5 = 5.

    Basically we define |x| to be -x if x < 0 and x if x >= 0, and the above examples show how we calculate this.
  4. Aug 4, 2012 #3
    Check this absolute value article over at Wikipedia, it might help a bit (the first paragraph sums it up nicely).

    Thinking of it as "absolute value" instead of "modulus" might help you grasp the concept.

    For the case above f(x) = |1-x + |x|| you have 2 absolute value functions within one another.

    Imagine the case: |x| - x which is the same as -x + |x|

    If x is positive, it ends up being x-x... what happens when x is negative? remember that -(-1) = 1
  5. Aug 4, 2012 #4


    User Avatar
    Science Advisor

    Then your difficulty is not so much algebra as arithmetic. The "algebra" you have written correctly- if x< 0 then |x|= -x. So, because -5< 0, |-5|= -(-5). If you think that is -5 then the difficulty is basic arithmetic: you can think of this as (-1)(-5)= 5. Or you can, a little more sophisticated, think of -(-5) as the "negative" (additive inverse) of -5. And, since -5+ 5= 0, 5 is the "negative" of -5. Either way, |-5|= -(-5)= 5.

  6. Aug 4, 2012 #5
    Others have already answered the question, but I wanted to mention this point. It's often confusing for students.

    A negative number is a point on the number line "to the left" of zero, or technically, a real number which is less than zero as defined by the '<' relationship. In this sense, the fact that -5 is five units to the left of zero is functioning like an address. A house address on a street, or a memory address in a computer, to mention two familiar contemporary usages. An address is an label; but unlike completely arbitrary labels, the address space is endowed with an order relation so that we can find our way around.

    On the other hand, what do we mean when x is a variable and we say -x?

    Do we mean that x, or perhaps -x, is to be found to the left of zero on the number line? No, not at all! What we mean is that if x is to the left, we want -x to denote the point equidistant on the right; and vice versa.

    In other words, -5 denotes the point five units to the left of zero.

    But if x is a variable, and x = -5, then -x = 5, a point to the RIGHT of zero.

    We are overloading the meaning of '-'. Sometimes it's and address that tells us which side of zero we're on; and other times, it's an instruction or operator that flips the direction while preserving the magnitude of a number.

    This is why -x confuses students. We're actually flim-flamming them a bit, by using '-' two different ways.
    Last edited: Aug 4, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook